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