]> matita.cs.unibo.it Git - helm.git/blob - helm/http_getter/Makefile
bumped version (tag soon)
[helm.git] / helm / http_getter / Makefile
1 VERSION = 0.2.3
2 NAME = http_getter
3
4 DISTDIR = http-getter-$(VERSION)
5 EXTRA_DIST = AUTHORS COPYING NEWS README BUGS
6 DOCS = doc/http_getter.conf.xml.sample
7
8 REQUIRES = http dbm pcre pxp shell threads zip
9 COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o
10 OCAMLFIND = ocamlfind
11 OCAMLC = $(OCAMLFIND) ocamlc -thread $(COMMONOPTS)
12 OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(COMMONOPTS)
13 OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMONOPTS)
14 OCAMLDOC =      \
15         ocamldoc        \
16                 $(shell $(OCAMLFIND) query -i-format http)      \
17                 $(shell $(OCAMLFIND) query -i-format dbm)       \
18                 $(shell $(OCAMLFIND) query -i-format pcre)      \
19                 $(shell $(OCAMLFIND) query -i-format pxp)       \
20                 $(shell $(OCAMLFIND) query -i-format shell)     \
21                 $(shell $(OCAMLFIND) query -i-format threads)   \
22                 $(shell $(OCAMLFIND) query -i-format zip)
23 MODULES =       \
24         http_getter_debugger threadSafe                                                         \
25         http_getter_types zack http_getter_misc http_getter_const       \
26         http_getter_env http_getter_common http_getter_map                      \
27         http_getter_cache
28
29 OBJS = $(patsubst %,%.cmo,$(MODULES))
30 OBJSOPT = $(patsubst %,%.cmx,$(MODULES))
31
32 all: byte
33 byte: $(NAME)
34 opt: $(NAME).opt
35 world: byte opt
36
37 include .depend
38 depend:
39         $(OCAMLDEP) *.ml *.mli > .depend
40
41 %.cmi: %.mli
42         $(OCAMLC) -c $<
43 %.cmo: %.ml %.cmi
44         $(OCAMLC) -c $<
45 %.cmx: %.ml %.cmi
46         $(OCAMLOPT) -c $<
47 include Makefile.overrides
48 $(NAME).cmo: $(NAME).ml
49         $(OCAMLC) -c $<
50 $(NAME).cmx: $(NAME).ml
51         $(OCAMLOPT) -c $<
52 $(NAME): $(OBJS) $(NAME).ml
53         $(OCAMLC) -linkpkg -thread -o $@ $^
54 $(NAME).opt: $(OBJSOPT) $(NAME).ml
55         $(OCAMLOPT) -linkpkg -thread -o $@ $^
56
57 http_getter.dot: *.ml *.mli
58         $(OCAMLDOC) -dot -o $@ $^
59
60 distclean: clean
61 clean:
62         rm -f *.cm[aiox] *.o $(NAME){,.opt} *.dot
63 dist: distclean depend
64         if [ -d $(DISTDIR) ]; then rm -rf $(DISTDIR); else true; fi
65         mkdir $(DISTDIR)/
66         mkdir $(DISTDIR)/doc
67         cp $(DOCS) $(DISTDIR)/doc/
68         for m in $(patsubst %, %.mli, $(MODULES)); do   \
69                 if [ "$$m" != "http_getter_types.mli" ]; then   \
70                         cp $$m $(DISTDIR)/;     \
71                 fi;     \
72         done
73         cp      \
74                 $(patsubst %, %.ml, $(MODULES)) \
75                 $(NAME).ml      \
76                 Makefile Makefile.overrides .depend     \
77                 $(DISTDIR)/
78         cp $(EXTRA_DIST) $(DISTDIR)/
79         tar cvzf $(DISTDIR).tar.gz $(DISTDIR)/
80         rm -rf $(DISTDIR)/
81 distcheck: dist
82         tar xvzf $(DISTDIR).tar.gz
83         cd $(DISTDIR); make
84         rm -rf $(DISTDIR)
85
86 .PHONY: all byte dist distcheck opt world depend clean distclean
87