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