4 http_constants http_types http_parser_sanity http_misc http_common \
5 http_tcp_server http_parser http_message http_request http_daemon \
6 http_response http_user_agent
8 THREADED_SRV = http_threaded_tcp_server
9 MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
10 MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
19 OCAMLDOC_STUFF = *.mli
23 DESTDIR = $(shell $(OCAMLFIND) printconf destdir)
25 all: all_non_mt all_mt
26 opt: opt_non_mt opt_mt
32 doc: all $(DOCDIR)/index.html $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.ps $(OCAMLDOC_STUFF)
34 $(OCAMLDOC) -html -d $(DOCDIR) $(OCAMLDOC_STUFF)
35 $(TEXDIR)/ocaml-http.tex: $(OCAMLDOC_STUFF)
36 $(OCAMLDOC) -latex -o $@ $^
37 $(TEXDIR)/ocaml-http.ps: $(TEXDIR)/ocaml-http.tex
42 $(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
44 $(DOTDIR)/ocaml-http.dot: *.ml *.mli
45 $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli
50 $(MAKE) -C examples/ opt
55 $(OCAMLDEP) *.ml *.mli > .depend
64 non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
65 cp $(THREADED_SRV).{cmi,mli} non_mt/
67 non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
68 cp $(THREADED_SRV).{cmi,mli} non_mt/
71 mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
72 cp $(THREADED_SRV).{cmi,mli} mt/
73 $(OCAMLC) $(THREADS_FLAGS) -c $<
74 mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
75 cp $(THREADED_SRV).{cmi,mli} mt/
76 $(OCAMLOPT) $(THREADS_FLAGS) -c $<
78 http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
80 http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
81 $(OCAMLOPT) -a -o $@ $^
82 http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
84 http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
85 $(OCAMLOPT) -a -o $@ $^
89 cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
92 $(MAKE) -C examples/ clean
93 for d in . mt non_mt; do \
94 rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt}; \
96 rm -f {mt,non_mt}/$(THREADED_SRV).mli
99 $(DOCDIR)/*.html $(DOCDIR)/*.css \
100 $(DOTDIR)/*.dot $(DOTDIR)/*.ps \
101 $(TEXDIR)/*.{dvi,ps,ps.gz,pdf,aux,log,out,toc,tmp,haux,sty,tex}
103 $(MAKE) -C examples/ distclean
105 dist: distreal distrm
107 if [ -d $(DISTDIR) ]; then rm -rf $(DISTDIR); else true; fi
108 mkdir -p $(DISTDIR)/doc/
109 cp -r doc/html/ $(DISTDIR)/doc/
110 cp doc/dot/ocaml-http.ps $(DISTDIR)/doc/modules.ps
111 cp doc/latex/ocaml-http.ps $(DISTDIR)/doc/
112 distreal: distdoc distclean depend
114 $(patsubst %, %.ml, $(MODULES)) \
115 $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV)) \
116 mt/ non_mt/ $(EXTRA_DIST) examples/ debian/; \
118 cp -r $$f $(DISTDIR)/; \
120 -find $(DISTDIR)/ -type d -name CVS -exec rm -rf {} \;
121 -find $(DISTDIR)/ -type f -name ".cvs*" -exec rm -f {} \;
122 tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
125 deb: docclean distreal
126 (cd $(DISTDIR)/ && debuild)
129 $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME) \
130 $(patsubst %, %.mli, $(PUBLIC_MODULES)) \
131 $(patsubst %, %.cmi, $(PUBLIC_MODULES)) \
132 $(wildcard *.cma *.cmxa *.a) META
135 all opt world all_non_mt all_mt opt_non_mt opt_mt \
136 examples examples.opt depend clean distclean dist \
137 install meta doc deb distreal distrm