1 # $Id: Makefile,v 1.28 2006/05/10 08:35:48 rich Exp $
3 include Makefile.config
6 -package dynlink,pxp-lex-utf8,pxp-engine,netclient,cduce,extlib,calendar,pcre
8 OCAMLCFLAGS := -g -I examples/adwords
9 OCAMLOPTFLAGS := -I examples/adwords
13 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLOPTFLAGS)
15 all: pa_ocsoapclientstubs.cmo wsdl_validate.opt wsdltointf.opt \
16 oCSoap.cmo oCSoap.cmx META
20 sed -e 's/@VERSION@/$(VERSION)/g' < $< > $@
22 pa_ocsoapclientstubs.cmo: pa_ocsoapclientstubs.ml4
23 ocamlc -pp "camlp5o pa_extend.cmo q_MLast.cmo -loc loc -impl" \
24 -I +camlp5 -c -impl $<
26 wsdl_validate.opt: wsdl.cmx wsdl_validate.cmx
27 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -linkpkg $^ -o $@
29 wsdltointf.opt: wsdl.cmx wsdltointf.cmx
30 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -linkpkg $^ -o $@
36 examples/adwords/AccountService.wsdl \
37 examples/adwords/AdGroupService.wsdl \
38 examples/adwords/CampaignService.wsdl \
39 examples/adwords/CreativeService.wsdl \
40 examples/adwords/InfoService.wsdl \
41 examples/adwords/KeywordService.wsdl \
42 examples/adwords/ReportService.wsdl \
43 examples/adwords/TrafficEstimatorService.wsdl
46 examples/adwords/accountService_types.cmx \
47 examples/adwords/accountService_conv.cmx \
48 examples/adwords/accountService.cmx \
49 examples/adwords/adGroupService_types.cmx \
50 examples/adwords/adGroupService_conv.cmx \
51 examples/adwords/adGroupService.cmx \
52 examples/adwords/campaignService_types.cmx \
53 examples/adwords/campaignService_conv.cmx \
54 examples/adwords/campaignService.cmx \
55 examples/adwords/creativeService_types.cmx \
56 examples/adwords/creativeService_conv.cmx \
57 examples/adwords/creativeService.cmx \
58 examples/adwords/infoService_types.cmx \
59 examples/adwords/infoService_conv.cmx \
60 examples/adwords/infoService.cmx \
61 examples/adwords/keywordService_types.cmx \
62 examples/adwords/keywordService_conv.cmx \
63 examples/adwords/keywordService.cmx \
64 examples/adwords/reportService_types.cmx \
65 examples/adwords/reportService_conv.cmx \
66 examples/adwords/reportService.cmx \
67 examples/adwords/trafficEstimatorService_types.cmx \
68 examples/adwords/trafficEstimatorService_conv.cmx \
69 examples/adwords/trafficEstimatorService.cmx
71 examples/adwords/test1.opt: oCSoap.cmx $(ADWORDS_CMX) \
72 examples/adwords/headers.cmx examples/adwords/test1.cmx
73 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -linkpkg \
76 examples/adwords/test2.opt: oCSoap.cmx $(ADWORDS_CMX) \
77 examples/adwords/headers.cmx examples/adwords/test2.cmx
78 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -linkpkg \
81 examples/adwords/example.opt: oCSoap.cmx $(ADWORDS_CMX) \
82 examples/adwords/example.cmx
83 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -linkpkg \
86 examples/adwords/fault.opt: oCSoap.cmx $(ADWORDS_CMX) \
87 examples/adwords/fault.cmx
88 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -linkpkg \
91 examples/adwords/%Service.cmx: examples/adwords/%Service.intf
92 ocamlfind ocamlopt $(OCAMLOPTFLAGS) -c \
93 -pp "camlp5o ./pa_ocsoapclientstubs.cmo -impl" -c -impl $<
95 examples: examples/adwords/test1.opt examples/adwords/test2.opt examples/adwords/example.opt
99 examples/adwords/accountService.intf examples/adwords/accountService_types.ml examples/adwords/accountService_conv.ml: examples/adwords/AccountService.wsdl wsdltointf.opt
101 examples/adwords/adGroupService.intf examples/adwords/adGroupService_types.ml examples/adwords/adGroupService_conv.ml: examples/adwords/AdGroupService.wsdl wsdltointf.opt
103 examples/adwords/campaignService.intf examples/adwords/campaignService_types.ml examples/adwords/campaignService_conv.ml: examples/adwords/CampaignService.wsdl wsdltointf.opt
105 examples/adwords/creativeService.intf examples/adwords/creativeService_types.ml examples/adwords/creativeService_conv.ml: examples/adwords/CreativeService.wsdl wsdltointf.opt
107 examples/adwords/infoService.intf examples/adwords/infoService_types.ml examples/adwords/infoService_conv.ml: examples/adwords/InfoService.wsdl wsdltointf.opt
109 examples/adwords/keywordService.intf examples/adwords/keywordService_types.ml examples/adwords/keywordService_conv.ml: examples/adwords/KeywordService.wsdl wsdltointf.opt
111 examples/adwords/reportService.intf examples/adwords/reportService_types.ml examples/adwords/reportService_conv.ml: examples/adwords/ReportService.wsdl wsdltointf.opt
113 examples/adwords/trafficEstimatorService.intf examples/adwords/trafficEstimatorService_types.ml examples/adwords/trafficEstimatorService_conv.ml: examples/adwords/TrafficEstimatorService.wsdl wsdltointf.opt
116 #examples/fusionforge/FusionForge.intf examples/fusionforge/FusionForge_types.ml examples/fusionforge/FusionForge_conv.ml: examples/fusionforge/FusionForge.wsdl wsdltointf.opt
117 # ./wsdltointf.opt $<
120 # examples/fusionforge/FusionForge_types.cmx \
121 # examples/fusionforge/FusionForge_conv.cmx \
122 # examples/fusionforge/FusionForge.cmx \
123 # examples/fusionforge/test.cmx
125 #examples/fusionforge/test.opt: oCSoap.cmx $(FUSIONFORGE_CMX)
126 # ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -linkpkg $^ -o $@
128 #examples: examples/fusionforge/test.opt
130 # Download fresh WSDL files from Google.
132 download_google_wsdl:
133 for f in $(ADWORDS_WSDL); do \
134 b=`basename $$f .wsdl`; \
135 wget --no-check-certificate -O /tmp/wsdl https://adwords.google.com/api/adwords/v2/$$b?wsdl; \
136 if [ $$? -eq 0 ]; then mv /tmp/wsdl $$f; else exit 1; fi; \
141 CLEANFILES := core *.bak *~ *.cmi *.cmo *.cma *.a *.o *.cmx *.cmxa *.opt
144 for d in . examples/adwords; do (cd $$d; rm -f $(CLEANFILES)); done
145 -$(RM) examples/adwords/*.intf examples/adwords/*_conv.ml \
146 examples/adwords/*_types.ml
147 -$(RM) examples/fusionforge/*.intf examples/fusionforge/*_conv.ml \
148 examples/fusionforge/*_types.ml
155 .PHONY: clean distclean
159 INSTALLFILES = META *.cmi *.cmo *.cmx *.o *.mli *.opt
163 ocamlfind install ocsoap $(INSTALLFILES)
166 ocamlfind install -destdir $(DESTDIR)$(shell ocamlc -where) \
167 ocsoap $(INSTALLFILES)
173 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLPACKAGES) -c $<
176 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLPACKAGES) -c $<
179 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLPACKAGES) -c $<
182 ocamlfind ocamlc $(OCAMLCFLAGS) -c -package cduce \
183 -pp "$(CDUCE_MKSTUBS)" -impl $<
186 ocamlfind ocamlopt $(OCAMLOPTFLAGS) -c -package cduce \
187 -pp "$(CDUCE_MKSTUBS)" -impl $<
190 $(CDUCE) --compile $<
192 .SUFFIXES: .mli .ml .cmi .cmo .cmx .cd .cdo
194 # Build dependencies.
196 ifeq ($(wildcard .depend),.depend)
202 .depend: $(wildcard *.mli) $(wildcard *.ml) \
203 $(wildcard examples/adwords/*.mli) $(wildcard examples/adwords/*.ml)
204 $(OCAMLDEP) $^ > .depend
205 for f in examples/adwords/*.intf; do \
207 -pp "camlp5o ./pa_ocsoapclientstubs.cmo pr_o.cmo -impl" $$f \
214 $(MAKE) check-manifest
215 rm -rf $(PACKAGE)-$(VERSION)
216 mkdir $(PACKAGE)-$(VERSION)
217 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
218 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
219 rm -rf $(PACKAGE)-$(VERSION)
220 ls -l $(PACKAGE)-$(VERSION).tar.gz
223 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
226 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
227 sed -e "s|^|$$b|" -e "s|^\./||"; \
228 done | sort > .check-manifest; \
229 sort MANIFEST > .orig-manifest; \
230 diff -u .orig-manifest .check-manifest; rv=$$?; \
231 rm -f .orig-manifest .check-manifest; \
234 # Developer documentation (in html/ subdirectory).
239 -ocamlfind ocamldoc $(OCAMLPACKAGES) $(OCAMLDOCFLAGS) \
242 .PHONY: depend dist check-manifest