elaborate wsdl files at build-time
[sfa.git] / wsdl / Makefile
index 3b82120..21d17d3 100644 (file)
@@ -16,7 +16,29 @@ aggregate.wsdl:
 sfa.wsdl:
        PYTHONPATH=../ ./gw2wsdl.py --registry --slice-manager --aggregate > $@
 
+#################### install
+# DESTDIR set but the calling Makefile in ../
+INSTALL_PATH=/var/www/html/wsdl
+INSTALLED=$(foreach wsdl,$(ALL),$(DESTDIR)$(INSTALL_PATH)/$(wsdl))
+
+foo:
+       @echo INSTALLED=$(INSTALLED)
+
+install: $(INSTALLED)
+
+$(DESTDIR)$(INSTALL_PATH):
+       install -d -m 0755 $(DESTDIR)$(INSTALL_PATH)
+
+$(DESTDIR)$(INSTALL_PATH)/%: wsdl=$(notdir $@)
+$(DESTDIR)$(INSTALL_PATH)/%: $(DESTDIR)$(INSTALL_PATH) %
+       install -c -m 0755 $(wsdl) $@
+
+#################### clean
 clean:
        rm -f *wsdl
 
-.PHONY: all clean
+install-clean:
+       rm -f $(INSTALLED)
+
+.PHONY: all clean install install-clean
+