release v4.2.3
[m6w6/ext-http] / Makefile.frag
index f019ecc059a561d858e39b8dda0fc2684438fd4b..3dd9ce2629fa4eedce98563e83add6322feff557 100644 (file)
@@ -1,23 +1,16 @@
-# vim: noet ts=1 sw=1
+# provide headers in builddir, so they do not end up in /usr/include/ext/http/src
 
-phpincludedir=$(prefix)/include/php
+PHP_HTTP_HEADERS := $(addprefix $(PHP_HTTP_BUILDDIR)/,$(PHP_HTTP_HEADERS))
 
-install-http: install install-http-headers
+$(PHP_HTTP_BUILDDIR)/%.h: $(PHP_HTTP_SRCDIR)/src/%.h
+       @cat >$@ <$<
 
-install-http-headers:
-       @echo "Installing HTTP headers:          $(INSTALL_ROOT)$(phpincludedir)/ext/http/"
-       @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http
-       @for f in $(PHP_HTTP_HEADERS); 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"; \
-               fi \
-       done;
+$(all_targets): 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)