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))
31 OCAMLDOC_STUFF = *.mli
35 DESTDIR = $(shell $(OCAMLFIND) printconf destdir)
37 all: all_non_mt all_mt
38 opt: opt_non_mt opt_mt
44 doc: all $(DOCDIR)/index.html $(DOTDIR)/ocaml-http.ps $(TEXDIR)/ocaml-http.ps $(OCAMLDOC_STUFF)
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
54 $(DOTDIR)/ocaml-http.ps: $(DOTDIR)/ocaml-http.dot
56 $(DOTDIR)/ocaml-http.dot: *.ml *.mli
57 $(OCAMLDOC) -dot -o $(DOTDIR)/ocaml-http.dot *.ml *.mli
62 $(MAKE) -C examples/ opt
67 $(OCAMLDEP) *.ml *.mli > .depend
78 non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
79 cp $(THREADED_SRV).{cmi,mli} non_mt/
81 non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
82 cp $(THREADED_SRV).{cmi,mli} non_mt/
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 $<
92 http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
94 http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
95 $(OCAMLOPT) -a -o $@ $^
96 http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
98 http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
99 $(OCAMLOPT) -a -o $@ $^
103 cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
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}; \
110 rm -f {mt,non_mt}/$(THREADED_SRV).mli
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}
117 $(MAKE) -C examples/ distclean
119 dist: distreal distrm
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
128 $(patsubst %, %.ml, $(MODULES)) \
129 $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV)) \
130 mt/ non_mt/ $(EXTRA_DIST) examples/ debian/; \
132 cp -r $$f $(DISTDIR)/; \
134 -find $(DISTDIR)/ -type d -name .svn -exec rm -rf {} \;
135 tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
138 deb: docclean distreal
139 (cd $(DISTDIR)/ && debuild)
142 $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME) \
143 $(patsubst %, %.mli, $(PUBLIC_MODULES)) \
144 $(patsubst %, %.cmi, $(PUBLIC_MODULES)) \
145 $(wildcard *.cma *.cmxa *.a) META
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