]> matita.cs.unibo.it Git - helm.git/blob - components/binaries/heights/Makefile
tagged 0.5.0-rc1
[helm.git] / components / binaries / heights / Makefile
1 include ../../../Makefile.defs
2
3 H=@
4
5 REQUIRES = helm-library
6
7 MLS = heights.ml
8 MLIS =
9 CLEAN =
10
11 LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
12 LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
13
14 CMOS = $(MLS:%.ml=%.cmo)
15 CMXS = $(MLS:%.ml=%.cmx)
16 CMIS = $(MLIS:%.mli=%.cmi)
17 EXTRAS =
18
19 OCAMLC = $(OCAMLFIND) ocamlc -thread -package "$(REQUIRES)" -linkpkg -rectypes
20 OCAMLOPT = $(OCAMLFIND) ocamlopt -thread -package "$(REQUIRES)" -linkpkg -rectypes
21 OCAMLDEP = $(OCAMLFIND) ocamldep
22 OCAMLYACC = ocamlyacc
23 OCAMLLEX = ocamllex
24
25 all: heights .depend
26         @echo -n
27
28 opt: heights.opt $(EXTRAS) .depend.opt
29         @echo -n
30
31 heights: $(CMIS) $(CMOS) $(EXTRAS) 
32         @echo "  OCAMLC $(CMOS)"
33         $(H)$(OCAMLC) -o $@ $(CMOS)
34
35 heights.opt: $(CMIS) $(CMXS) $(EXTRAS)
36         @echo "  OCAMLOPT $(CMXS)"
37         $(H)$(OCAMLOPT) -o $@ $(CMXS)
38
39 clean:
40         $(H)rm -f *.cm[iox] *.a *.o *.output
41         $(H)rm -f heights heights.opt $(CLEAN)
42
43 .depend: $(MLIS) $(MLS) $(EXTRAS)
44         @echo "  OCAMLDEP $(MLIS) $(MLS)"
45         $(H)$(OCAMLDEP) $(MLIS) $(MLS) > .depend
46
47 .depend.opt: $(MLIS) $(MLS) $(EXTRAS)
48         @echo "  OCAMLDEP -native $(MLIS) $(MLS)"
49         $(H)$(OCAMLDEP) -native $(MLIS) $(MLS) > .depend.opt
50
51 test: heights heights.conf.xml 
52         @echo "  HEIGHTS" 
53         $(H)$< 1> heights.txt 2> errors.txt
54
55 test.opt: heights.opt heights.conf.xml $(PACKAGES:%=%.conf.xml) 
56         @echo "  HEIGHTS.OPT" 
57         $(H)$< 1> heights.txt 2> errors.txt
58
59 export: clean
60         $(H)rm -f *~
61         @echo "  TAR heights"
62         $(H)cd .. && tar --exclude=heights/.svn -czf heights.tgz heights
63
64 depend: .depend 
65
66 depend.opt: .depend.opt 
67
68 %.cmi: %.mli $(EXTRAS)
69         @echo "  OCAMLC $<"
70         $(H)$(OCAMLC) -c $<
71 %.cmo %.cmi: %.ml $(EXTRAS) $(LIBRARIES)
72         @echo "  OCAMLC $<"
73         $(H)$(OCAMLC) -c $<
74 %.cmx: %.ml $(EXTRAS) $(LIBRARIES_OPT)
75         @echo "  OCAMLOPT $<"
76         $(H)$(OCAMLOPT) -c $<
77 %.ml %.mli: %.mly $(EXTRAS) 
78         @echo "  OCAMLYACC $<"
79         $(H)$(OCAMLYACC) -v $<
80 %.ml: %.mll $(EXTRAS) 
81         @echo "  OCAMLLEX $<"
82         $(H)$(OCAMLLEX) $<
83
84 include ../../../Makefile.defs
85
86 ifeq ($(MAKECMDGOALS),)
87   include .depend   
88 endif
89
90 ifeq ($(MAKECMDGOALS), all)
91   include .depend   
92 endif
93
94 ifeq ($(MAKECMDGOALS), opt)
95   include .depend.opt   
96 endif
97
98 ifeq ($(MAKECMDGOALS), test)
99   include .depend   
100 endif
101
102 ifeq ($(MAKECMDGOALS), test.opt)
103   include .depend.opt   
104 endif