]> matita.cs.unibo.it Git - helm.git/blob - DEVEL/ocaml-http/0.1.4-3/Makefile
tagging
[helm.git] / DEVEL / ocaml-http / 0.1.4-3 / Makefile
1 include Makefile.defs
2 export SHELL=/bin/bash
3
4 MODULES = \
5         http_constants \
6         http_types \
7         http_parser_sanity \
8         http_misc \
9         http_common \
10         http_tcp_server \
11         cookie_lexer \
12         http_parser \
13         http_message \
14         http_request \
15         http_daemon \
16         http_response \
17         http_user_agent \
18         $(NULL)
19
20 THREADED_SRV = http_threaded_tcp_server
21 MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
22 MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
23 PUBLIC_MODULES = \
24         http_types      \
25         http_common     \
26         http_message    \
27         http_request    \
28         http_daemon     \
29         http_response   \
30         http_user_agent
31 OCAMLDOC_STUFF = *.mli
32 DOCDIR = doc/html
33 DOTDIR = doc/dot
34 TEXDIR = doc/latex
35 DESTDIR = $(shell $(OCAMLFIND) printconf destdir) 
36
37 all: all_non_mt all_mt
38 opt: opt_non_mt opt_mt
39 all_non_mt: http.cma
40 opt_non_mt: http.cmxa
41 all_mt: http_mt.cma
42 opt_mt: http_mt.cmxa
43 world: all opt
44 doc: all $(DOCDIR)/index.html $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.ps $(OCAMLDOC_STUFF)
45 $(DOCDIR)/index.html:
46         $(OCAMLDOC) -html -d $(DOCDIR) $(OCAMLDOC_STUFF)
47 $(TEXDIR)/ocaml-http.tex: $(OCAMLDOC_STUFF)
48         $(OCAMLDOC) -latex -o $@ $^
49 $(TEXDIR)/ocaml-http.ps: $(TEXDIR)/ocaml-http.tex
50         cd $(TEXDIR);           \
51         latex ocaml-http;       \
52         latex ocaml-http;       \
53         dvips ocaml-http
54 $(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
55         $(DOT) -Tps $< > $@
56 $(DOTDIR)/ocaml-http.dot: *.ml *.mli
57         $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli
58
59 examples:
60         $(MAKE) -C examples/
61 examples.opt:
62         $(MAKE) -C examples/ opt
63
64 include .depend
65
66 depend:
67         $(OCAMLDEP) *.ml *.mli > .depend
68
69 %.ml: %.mll
70         $(OCAMLLEX) $<
71 %.cmi: %.mli
72         $(OCAMLC) -c $<
73 %.cmo: %.ml %.cmi
74         $(OCAMLC) -c $<
75 %.cmx: %.ml %.cmi
76         $(OCAMLOPT) -c $<
77
78 non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
79         cp $(THREADED_SRV).{cmi,mli} non_mt/
80         $(OCAMLC) -c $<
81 non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
82         cp $(THREADED_SRV).{cmi,mli} non_mt/
83         $(OCAMLOPT) -c $<
84
85 mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
86         cp $(THREADED_SRV).{cmi,mli} mt/
87         $(OCAMLC) $(THREADS_FLAGS) -c $<
88 mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
89         cp $(THREADED_SRV).{cmi,mli} mt/
90         $(OCAMLOPT) $(THREADS_FLAGS) -c $<
91
92 http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
93         $(OCAMLC) -a -o $@ $^
94 http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
95         $(OCAMLOPT) -a -o $@ $^
96 http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
97         $(OCAMLC) -a -o $@ $^
98 http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
99         $(OCAMLOPT) -a -o $@ $^
100
101 meta: META
102 META: META.in
103         cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
104
105 clean:
106         $(MAKE) -C examples/ clean
107         for d in . mt non_mt; do        \
108                 rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt};     \
109         done
110         rm -f {mt,non_mt}/$(THREADED_SRV).mli
111 docclean:
112         -rm -f  \
113                 $(DOCDIR)/*.html $(DOCDIR)/*.css        \
114                 $(DOTDIR)/*.dot $(DOTDIR)/*.ps  \
115                 $(TEXDIR)/*.{dvi,ps,ps.gz,pdf,aux,log,out,toc,tmp,haux,sty,tex}
116 distclean: clean
117         $(MAKE) -C examples/ distclean
118         rm -f META
119 dist: distreal distrm
120 distdoc: all doc
121         if [ -d $(DISTDIR) ]; then rm -rf $(DISTDIR); else true; fi
122         mkdir -p $(DISTDIR)/doc/
123         cp -r doc/html/ $(DISTDIR)/doc/
124         cp doc/dot/ocaml-http.ps $(DISTDIR)/doc/modules.ps
125         cp doc/latex/ocaml-http.ps $(DISTDIR)/doc/
126 distreal: distdoc distclean depend
127         for f in        \
128                         $(patsubst %, %.ml, $(MODULES)) \
129                         $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV))        \
130                         mt/ non_mt/ $(EXTRA_DIST) examples/ debian/;    \
131         do      \
132                 cp -r $$f $(DISTDIR)/;  \
133         done
134         -find $(DISTDIR)/ -type d -name .svn -exec rm -rf {} \;
135         tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
136 distrm:
137         rm -rf $(DISTDIR)/
138 deb: docclean distreal
139         (cd $(DISTDIR)/ && debuild)
140         rm -rf $(DISTDIR)/
141 install: META
142         $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME)     \
143                 $(patsubst %, %.mli, $(PUBLIC_MODULES)) \
144                 $(patsubst %, %.cmi, $(PUBLIC_MODULES)) \
145                 $(wildcard *.cma *.cmxa *.a) META
146
147 .PHONY: \
148         all opt world all_non_mt all_mt opt_non_mt opt_mt       \
149         examples examples.opt depend clean distclean dist       \
150         install meta doc deb distreal distrm