]> matita.cs.unibo.it Git - helm.git/blob - helm/http_getter/Makefile
added generation of DOT modules dependency graph
[helm.git] / helm / http_getter / Makefile
1 VERSION = 0.2.0
2 NAME = http_getter
3 DISTDIR = http-getter-$(VERSION)
4 REQUIRES = http dbm pcre netclient pxp shell threads zip
5 COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o
6 OCAMLFIND = ocamlfind
7 OCAMLC = $(OCAMLFIND) ocamlc $(COMMONOPTS)
8 OCAMLOPT = $(OCAMLFIND) ocamlopt $(COMMONOPTS)
9 OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMONOPTS)
10 OCAMLDOC =      \
11         ocamldoc        \
12                 $(shell $(OCAMLFIND) query -i-format http)      \
13                 $(shell $(OCAMLFIND) query -i-format dbm)       \
14                 $(shell $(OCAMLFIND) query -i-format pcre)      \
15                 $(shell $(OCAMLFIND) query -i-format netclient) \
16                 $(shell $(OCAMLFIND) query -i-format pxp)       \
17                 $(shell $(OCAMLFIND) query -i-format shell)     \
18                 $(shell $(OCAMLFIND) query -i-format threads)   \
19                 $(shell $(OCAMLFIND) query -i-format zip)
20 MODULES =       \
21         http_getter_debugger threadSafe                                                 \
22         http_getter_types http_getter_misc http_getter_const    \
23         http_getter_env http_getter_common http_getter_map              \
24         http_getter_cache
25
26 OBJS = $(patsubst %,%.cmo,$(MODULES))
27 OBJSOPT = $(patsubst %,%.cmx,$(MODULES))
28
29 all: byte
30 byte: $(NAME)
31 opt: $(NAME).opt
32 world: byte opt
33
34 include .depend
35 depend:
36         $(OCAMLDEP) *.ml *.mli > .depend
37
38 %.cmi: %.mli
39         $(OCAMLC) -c $<
40 %.cmo: %.ml %.cmi
41         $(OCAMLC) -c $<
42 %.cmx: %.ml %.cmi
43         $(OCAMLOPT) -c $<
44 include Makefile.overrides
45 $(NAME).cmo: $(NAME).ml
46         $(OCAMLC) -c $<
47 $(NAME).cmx: $(NAME).ml
48         $(OCAMLOPT) -c $<
49 $(NAME): $(OBJS) $(NAME).ml
50         $(OCAMLC) -linkpkg -thread -o $@ $^
51 $(NAME).opt: $(OBJSOPT) $(NAME).ml
52         $(OCAMLOPT) -linkpkg -thread -o $@ $^
53
54 http_getter.dot: *.ml *.mli
55         $(OCAMLDOC) -dot -o $@ $^
56
57 distclean: clean
58 clean:
59         rm -f *.cm[aiox] *.o $(NAME){,.opt} *.dot
60 dist: distclean depend
61         mkdir $(DISTDIR)/
62         cp      \
63                 $(patsubst %, %.ml, $(MODULES)) \
64                 $(patsubst %, %.mli, $(MODULES))        \
65                 $(NAME).ml      \
66                 Makefile .depend        \
67                 $(DISTDIR)/
68         tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
69         rm -rf $(DISTDIR)/
70
71 .PHONY: all byte opt world depend clean
72