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: $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.tex $(OCAMLDOC_STUFF)
33 $(OCAMLDOC) -html -d $(DOCDIR) $(OCAMLDOC_STUFF)
34 $(TEXDIR)/ocaml-http.tex: $(OCAMLDOC_STUFF)
35 $(OCAMLDOC) -latex -o $@ $^
36 $(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
38 $(DOTDIR)/ocaml-http.dot: *.ml *.mli
39 $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli
44 $(MAKE) -C examples/ opt
49 $(OCAMLDEP) *.ml *.mli > .depend
58 non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
59 cp $(THREADED_SRV).{cmi,mli} non_mt/
61 non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
62 cp $(THREADED_SRV).{cmi,mli} non_mt/
65 mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
66 cp $(THREADED_SRV).{cmi,mli} mt/
67 $(OCAMLC) $(THREADS_FLAGS) -c $<
68 mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
69 cp $(THREADED_SRV).{cmi,mli} mt/
70 $(OCAMLOPT) $(THREADS_FLAGS) -c $<
72 http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
74 http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
75 $(OCAMLOPT) -a -o $@ $^
76 http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
78 http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
79 $(OCAMLOPT) -a -o $@ $^
83 cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
86 $(MAKE) -C examples/ clean
87 for d in . mt non_mt; do \
88 rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt}; \
90 rm -f {mt,non_mt}/$(THREADED_SRV).mli
93 $(DOCDIR)/*.html $(DOCDIR)/*.css \
94 $(DOTDIR)/*.dot $(DOTDIR)/*.ps \
97 $(MAKE) -C examples/ distclean
100 distreal: distclean depend
101 if [ -d $(DISTDIR) ]; then rm -rf $(DISTDIR); else true; fi
104 $(patsubst %, %.ml, $(MODULES)) \
105 $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV)) \
106 mt/ non_mt/ $(EXTRA_DIST) examples/ debian/; \
108 cp -r $$f $(DISTDIR)/; \
110 -find $(DISTDIR)/ -type d -name CVS -exec rm -rf {} \;
111 -find $(DISTDIR)/ -type f -name ".cvs*" -exec rm -f {} \;
112 tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
115 deb: docclean distreal
116 (cd $(DISTDIR)/ && debuild)
119 $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME) \
120 $(patsubst %, %.mli, $(PUBLIC_MODULES)) \
121 $(patsubst %, %.cmi, $(PUBLIC_MODULES)) \
122 http{,_mt}.cm{,x}a http{,_mt}.a META
125 all opt world all_non_mt all_mt opt_non_mt opt_mt \
126 examples examples.opt depend clean distclean dist \
127 install meta doc deb distreal distrm