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