deepen slicemgr cleanup
[sfa.git] / wsdl / Makefile
1 # attempt to update at build-time
2
3 INTERFACES=sfa registry aggregate
4
5 WSDLS = $(foreach interface,$(INTERFACES),$(interface).wsdl)
6 HTMLS = $(foreach interface,$(INTERFACES),$(interface).html)
7
8 all: $(WSDLS) $(HTMLS)
9
10 # temporary: turn off wsdl generation as it is failing
11 #TEMPORARY_OFF = yes
12
13 ifdef TEMPORARY_OFF
14 registry.wsdl aggregate.wsdl sfa.wsdl:
15         touch $@
16 else
17 registry.wsdl: sfa2wsdl.py
18         PYTHONPATH=../ ./sfa2wsdl.py --registry > $@
19
20 aggregate.wsdl: sfa2wsdl.py
21         PYTHONPATH=../ ./sfa2wsdl.py --aggregate > $@
22
23 sfa.wsdl: sfa2wsdl.py
24         PYTHONPATH=../ ./sfa2wsdl.py --registry --aggregate > $@
25 endif
26
27 #################### install
28 # DESTDIR set but the calling Makefile in ../
29 INSTALL_PATH=/var/www/html/wsdl
30 INSTALLED=$(foreach wsdl,$(WSDLS),$(DESTDIR)$(INSTALL_PATH)/$(wsdl))
31
32 install: $(INSTALLED)
33
34 $(DESTDIR)$(INSTALL_PATH):
35         install -d -m 0755 $(DESTDIR)$(INSTALL_PATH)
36
37 $(DESTDIR)$(INSTALL_PATH)/%: wsdl=$(notdir $@)
38 $(DESTDIR)$(INSTALL_PATH)/%: $(DESTDIR)$(INSTALL_PATH) %
39         install -c -m 0755 $(wsdl) $@
40
41 #################### clean
42 clean::
43         rm -f $(WSDLS)
44
45 install-clean:
46         rm -f $(INSTALLED)
47
48 .PHONY: all clean install install-clean
49
50 #################### generate html document
51 %.html: %.wsdl wsdl2html.xsl
52         xsltproc $(XSLTFLAGS) wsdl2html.xsl $*.wsdl > $@ || rm $@
53
54 clean::
55         rm -f $(HTMLS)
56
57
58 backup:
59         $(foreach wsdl,$(WSDLS), cp $(wsdl) $(wsdl).bak;)
60         $(foreach html,$(HTMLS), cp $(html) $(html).bak;)
61
62 diff:
63         $(foreach wsdl,$(WSDLS), diff $(wsdl) $(wsdl).bak;)
64         $(foreach html,$(HTMLS), diff $(html) $(html).bak;)