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