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