]> matita.cs.unibo.it Git - helm.git/blob - helm/hbugs/common/Makefile
ca95aae243384c12e66c724c1cd5385fcc43f60e
[helm.git] / helm / hbugs / common / Makefile
1 REQUIRES = helm-xml helm-pxp pcre pxp http
2 COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o
3 OCAMLFIND = ocamlfind
4 OCAMLC = $(OCAMLFIND) ocamlc -thread $(COMMONOPTS)
5 OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(COMMONOPTS)
6 OCAMLDEP = $(OCAMLFIND) ocamldep $(COMMONOPTS)
7 OCAMLDOC =      \
8         ocamldoc        \
9                 $(shell $(OCAMLFIND) query -i-format helm-xml)  \
10                 $(shell $(OCAMLFIND) query -i-format helm-pxp)  \
11                 $(shell $(OCAMLFIND) query -i-format pcre)      \
12                 $(shell $(OCAMLFIND) query -i-format pxp-engine)        \
13                 $(shell $(OCAMLFIND) query -i-format threads)   \
14                 $(shell $(OCAMLFIND) query -i-format http)
15 MODULES =       \
16         hbugs_types threadSafe hbugs_misc       \
17         hbugs_common hbugs_id_generator hbugs_messages
18
19 OBJS = $(patsubst %,%.cmo,$(MODULES))
20 OBJSOPT = $(patsubst %,%.cmx,$(MODULES))
21 DEPS = $(shell $(OCAMLFIND) query -recursive -predicates byte -format "%d/%a" $(REQUIRES))
22 DEPSOPT = $(shell $(OCAMLFIND) query -recursive -predicates native -format "%d/%a" $(REQUIRES))
23
24 all: byte
25 byte: $(OBJS)
26 opt: $(OBJSOPT)
27 world: byte opt
28
29 hbugs_common.dot: *.ml *.mli
30         $(OCAMLDOC) -dot -o $@ $^
31
32 include .depend
33 depend:
34         $(OCAMLDEP) *.ml *.mli > .depend
35
36 %.cmi: %.mli
37         $(OCAMLC) -c $<
38 %.cmo: %.ml %.cmi
39         $(OCAMLC) -c $<
40 %.cmx: %.ml %.cmi
41         $(OCAMLOPT) -c $<
42 include Makefile.overrides
43 $(OBJS): $(DEPS)
44 $(OBJSOPT): $(DEPSOPT)
45
46 distclean: clean
47 clean:
48         rm -f *.cm[aiox] *.o $(NAME){,.opt}
49
50 .PHONY: all byte opt world depend clean
51