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