Makefile.frag 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. phpincludedir=$(prefix)/include/php
  2. PDO_HEADER_FILES= \
  3. php_pdo.h \
  4. php_pdo_driver.h \
  5. php_pdo_error.h
  6. $(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re
  7. @(cd $(top_srcdir); \
  8. if test -f ./pdo_sql_parser.re; then \
  9. $(RE2C) $(RE2C_FLAGS) --no-generation-date -o pdo_sql_parser.c pdo_sql_parser.re; \
  10. else \
  11. $(RE2C) $(RE2C_FLAGS) --no-generation-date -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re; \
  12. fi)
  13. install-pdo-headers:
  14. @echo "Installing PDO headers: $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/"
  15. @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/pdo
  16. @for f in $(PDO_HEADER_FILES); do \
  17. if test -f "$(top_srcdir)/$$f"; then \
  18. $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
  19. elif test -f "$(top_builddir)/$$f"; then \
  20. $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
  21. elif test -f "$(top_srcdir)/ext/pdo/$$f"; then \
  22. $(INSTALL_DATA) $(top_srcdir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
  23. elif test -f "$(top_builddir)/ext/pdo/$$f"; then \
  24. $(INSTALL_DATA) $(top_builddir)/ext/pdo/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/pdo; \
  25. else \
  26. echo "hmmm"; \
  27. fi \
  28. done;
  29. # mini hack
  30. install: $(all_targets) $(install_targets) install-pdo-headers