4 http_types http_constants http_misc http_tcp_server http_common \
5 http_request http_parser http_daemon http_response
6 THREADED_SRV = http_threaded_tcp_server
7 MODULES_MT = $(patsubst http_tcp_server, mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
8 MODULES_NON_MT = $(patsubst http_tcp_server, non_mt/$(THREADED_SRV) http_tcp_server, $(MODULES))
9 PUBLIC_MODULES = http_common http_types http_request http_daemon http_response
10 DESTDIR = $(shell $(OCAMLFIND) printconf stdlib)
12 all: all_non_mt all_mt
13 opt: opt_non_mt opt_mt
20 $(OCAMLDOC) -html -d doc/html *.mli
25 $(MAKE) -C examples/ opt
30 $(OCAMLDEP) *.ml *.mli > .depend
39 non_mt/$(THREADED_SRV).cmo: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
40 cp $(THREADED_SRV).{cmi,mli} non_mt/
42 non_mt/$(THREADED_SRV).cmx: non_mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
43 cp $(THREADED_SRV).{cmi,mli} non_mt/
46 mt/$(THREADED_SRV).cmo: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
47 cp $(THREADED_SRV).{cmi,mli} mt/
48 $(OCAMLC) $(THREADS_FLAGS) -c $<
49 mt/$(THREADED_SRV).cmx: mt/$(THREADED_SRV).ml $(THREADED_SRV).cmi
50 cp $(THREADED_SRV).{cmi,mli} mt/
51 $(OCAMLOPT) $(THREADS_FLAGS) -c $<
53 http.cma: $(patsubst %,%.cmo,$(MODULES_NON_MT))
55 http.cmxa: $(patsubst %,%.cmx,$(MODULES_NON_MT))
56 $(OCAMLOPT) -a -o $@ $^
57 http_mt.cma: $(patsubst %,%.cmo,$(MODULES_MT))
59 http_mt.cmxa: $(patsubst %,%.cmx,$(MODULES_MT))
60 $(OCAMLOPT) -a -o $@ $^
64 cat META.in | sed -e 's/@DISTVERSION@/$(DISTVERSION)/' > META
67 $(MAKE) -C examples/ clean
68 for d in . mt non_mt; do \
69 rm -f $$d/*.cm[ioax] $$d/*.cmxa $$d/*.[ao] $$d/test{,.opt}; \
71 rm -f {mt,non_mt}/$(THREADED_SRV).mli
73 rm -f doc/html/*.html doc/html/*.css
74 distclean: clean docclean
75 $(MAKE) -C examples/ distclean
78 distreal: distclean depend
81 $(patsubst %, %.ml, $(MODULES)) \
82 $(patsubst %, %.mli, $(MODULES) $(THREADED_SRV)) \
83 mt/ non_mt/ $(EXTRA_DIST) examples/ debian/ \
85 -find $(DISTDIR)/ -type d -name CVS -exec rm -rf {} \;
86 -find $(DISTDIR)/ -type f -name ".cvs*" -exec rm -f {} \;
87 tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
91 (cd $(DISTDIR)/ && debuild)
94 $(OCAMLFIND) install -destdir $(DESTDIR) $(PKGNAME) \
95 $(patsubst %, %.mli, $(PUBLIC_MODULES)) \
96 $(patsubst %, %.cmi, $(PUBLIC_MODULES)) \
97 http{,_mt}.cm{,x}a http{,_mt}.a META
100 all opt world all_non_mt all_mt opt_non_mt opt_mt \
101 examples examples.opt depend clean distclean dist \
102 install meta doc deb distreal distrm