]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/ocaml-http/Makefile
- added mt and non_mt dirs to dist stuff
[helm.git] / helm / DEVEL / ocaml-http / Makefile
1 include Makefile.defs
2
3 MODULES = http_common http_misc http_types http_request http_parser http_tcp_server http_daemon http_response
4 THREADED_SRV = http_threaded_tcp_server
5 MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
6 MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
7 PUBLIC_MODULES = http_common http_types http_request http_daemon http_response
8 DESTDIR = $(shell $(OCAMLFIND) printconf stdlib) 
9
10 all: all_non_mt all_mt
11 opt: opt_non_mt opt_mt
12 all_non_mt: http.cma
13 opt_non_mt: http.cmxa
14 all_mt: http_mt.cma
15 opt_mt: http_mt.cmxa
16 world: all opt
17 doc: *.mli
18         $(OCAMLDOC) -html -d doc/html *.mli
19
20 examples:
21         $(MAKE) -C examples/
22 examples.opt:
23         $(MAKE) -C examples/ opt
24
25 include .depend
26
27 depend:
28         $(OCAMLDEP) *.ml *.mli > .depend
29
30 %.cmi: %.mli
31         $(OCAMLC) -c $<
32 %.cmo: %.ml %.cmi
33         $(OCAMLC) -c $<
34 %.cmx: %.ml %.cmi
35         $(OCAMLOPT) -c $<
36
37 non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
38         cp $(THREADED_SRV).{cmi,mli} non_mt/
39         $(OCAMLC) -c $<
40 non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
41         cp $(THREADED_SRV).{cmi,mli} non_mt/
42         $(OCAMLOPT) -c $<
43
44 mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
45         cp $(THREADED_SRV).{cmi,mli} mt/
46         $(OCAMLC) $(THREADS_FLAGS) -c $<
47 mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
48         cp $(THREADED_SRV).{cmi,mli} mt/
49         $(OCAMLOPT) $(THREADS_FLAGS) -c $<
50
51 http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
52         $(OCAMLC) -a -o $@ $^
53 http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
54         $(OCAMLOPT) -a -o $@ $^
55 http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
56         $(OCAMLC) -a -o $@ $^
57 http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
58         $(OCAMLOPT) -a -o $@ $^
59
60 meta: META
61 META: META.in
62         cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
63
64 clean:
65         $(MAKE) -C examples/ clean
66         for d in . mt non_mt; do        \
67                 rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt};     \
68         done
69         rm -f {mt,non_mt}/$(THREADED_SRV).mli
70 docclean:
71         rm -f doc/html/*.html doc/html/*.css
72 distclean: clean docclean
73         $(MAKE) -C examples/ distclean
74         -rm -f META
75 dist: distclean depend
76         mkdir $(DISTDIR)
77         cp -r   \
78                 $(patsubst %, %.ml, $(MODULES)) \
79                 $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV))        \
80                 mt/ non_mt/ $(EXTRA_DIST) examples/     debian/ \
81                 $(DISTDIR)/
82         -find $(DISTDIR)/ -type d -name CVS -exec rm -rf {} \;
83         -find $(DISTDIR)/ -type f -name ".cvs*" -exec rm -f {} \;
84         tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
85         rm -rf $(DISTDIR)/
86 install: META
87         $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME)     \
88                 META $(patsubst %, %.mli, $(PUBLIC_MODULES))    \
89                 $(patsubst %, %.cmi, $(PUBLIC_MODULES)) http.cm{,x}a http.a
90
91 .PHONY: \
92         all opt world all_non_mt all_mt opt_non_mt opt_mt       \
93         examples examples.opt depend clean distclean dist       \
94         install meta doc
95