5 http_constants http_types http_parser_sanity http_misc http_common \
6 http_tcp_server http_parser http_message http_request http_daemon \
7 http_response http_user_agent
9 THREADED_SRV = http_threaded_tcp_server
10 MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
11 MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
20 OCAMLDOC_STUFF = *.mli
24 DESTDIR = $(shell $(OCAMLFIND) printconf destdir)
26 all: all_non_mt all_mt
27 opt: opt_non_mt opt_mt
33 doc: all $(DOCDIR)/index.html $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.ps $(OCAMLDOC_STUFF)
35 $(OCAMLDOC) -html -d $(DOCDIR) $(OCAMLDOC_STUFF)
36 $(TEXDIR)/ocaml-http.tex: $(OCAMLDOC_STUFF)
37 $(OCAMLDOC) -latex -o $@ $^
38 $(TEXDIR)/ocaml-http.ps: $(TEXDIR)/ocaml-http.tex
43 $(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
45 $(DOTDIR)/ocaml-http.dot: *.ml *.mli
46 $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli
51 $(MAKE) -C examples/ opt
56 $(OCAMLDEP) *.ml *.mli > .depend
65 non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
66 cp $(THREADED_SRV).{cmi,mli} non_mt/
68 non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
69 cp $(THREADED_SRV).{cmi,mli} non_mt/
72 mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
73 cp $(THREADED_SRV).{cmi,mli} mt/
74 $(OCAMLC) $(THREADS_FLAGS) -c $<
75 mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
76 cp $(THREADED_SRV).{cmi,mli} mt/
77 $(OCAMLOPT) $(THREADS_FLAGS) -c $<
79 http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
81 http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
82 $(OCAMLOPT) -a -o $@ $^
83 http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
85 http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
86 $(OCAMLOPT) -a -o $@ $^
90 cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
93 $(MAKE) -C examples/ clean
94 for d in . mt non_mt; do \
95 rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt}; \
97 rm -f {mt,non_mt}/$(THREADED_SRV).mli
100 $(DOCDIR)/*.html $(DOCDIR)/*.css \
101 $(DOTDIR)/*.dot $(DOTDIR)/*.ps \
102 $(TEXDIR)/*.{dvi,ps,ps.gz,pdf,aux,log,out,toc,tmp,haux,sty,tex}
104 $(MAKE) -C examples/ distclean
106 dist: distreal distrm
108 if [ -d $(DISTDIR) ]; then rm -rf $(DISTDIR); else true; fi
109 mkdir -p $(DISTDIR)/doc/
110 cp -r doc/html/ $(DISTDIR)/doc/
111 cp doc/dot/ocaml-http.ps $(DISTDIR)/doc/modules.ps
112 cp doc/latex/ocaml-http.ps $(DISTDIR)/doc/
113 distreal: distdoc distclean depend
115 $(patsubst %, %.ml, $(MODULES)) \
116 $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV)) \
117 mt/ non_mt/ $(EXTRA_DIST) examples/ debian/; \
119 cp -r $$f $(DISTDIR)/; \
121 -find $(DISTDIR)/ -type d -name .svn -exec rm -rf {} \;
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