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