fllowup on standards
[m6w6/ext-http] / Makefile.frag
index 65547b8654b9ff6262437988d145a469bea53a23..47f1879338d1219a0ddf31d0d7ba0c9a3a2cd377 100644 (file)
@@ -1,22 +1,16 @@
-phpincludedir=$(prefix)/include/php
+# provide headers in builddir, so they do not end up in /usr/include/ext/http/src
 
-install-http-headers:
-       @echo "Installing HTTP headers:          $(INSTALL_ROOT)$(phpincludedir)/ext/http/"
-       @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http
-       @for f in $(HTTP_HEADER_FILES); do \
-               if test -f "$(top_srcdir)/$$f"; then \
-                       $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               elif test -f "$(top_builddir)/$$f"; then \
-                       $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               elif test -f "$(top_srcdir)/ext/http/$$f"; then \
-                       $(INSTALL_DATA) $(top_srcdir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               elif test -f "$(top_builddir)/ext/http/$$f"; then \
-                       $(INSTALL_DATA) $(top_builddir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               else \
-                       echo "WTF? $f $$f"; \
-               fi \
-       done;
+PHP_HTTP_HEADERS := $(addprefix $(PHP_HTTP_BUILDDIR)/,$(PHP_HTTP_HEADERS))
 
-# mini hack
-install: $(all_targets) $(install_targets) install-http-headers
+$(PHP_HTTP_BUILDDIR)/%.h: $(PHP_HTTP_SRCDIR)/src/%.h
+       @cat >$@ <$<
 
+all: http-build-headers
+clean: http-clean-headers
+
+.PHONY: http-build-headers
+http-build-headers: $(PHP_HTTP_HEADERS)
+
+.PHONY: http-clean-headers
+http-clean-headers:
+       -rm -f $(PHP_HTTP_HEADERS)