]> matita.cs.unibo.it Git - helm.git/blob - helm/mathql_test/Makefile
a4a0c181a73b920e6e7c79e6a36d90445bf3753d
[helm.git] / helm / mathql_test / Makefile
1 BIN_DIR = /usr/local/bin
2 REQUIRES = unix helm-cic_textual_parser helm-cic_proof_checking \
3            helm-mathql helm-mathql_interpreter helm-mathql_generator \
4            helm-tactics
5 PREDICATES =
6 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)"
7 OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
8 OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
9 OCAMLDEP = ocamldep
10 OCAMLYACC = ocamlyacc
11 OCAMLLEX = ocamllex
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 MQTOP = mqtop.ml
17 MQITOP = mqitop.ml
18 MQGTOP = mqgtop.ml
19
20 DEPOBJS = $(MQTOP) $(MQITOP) $(MQGTOP)
21 AUXOBJS = mQGTopParser.ml mQGTopParser.mli mQGTopLexer.ml 
22
23 all: $(DEPOBJS:.ml=)
24 opt: $(DEPOBJS:.ml=.opt)
25
26 depend: $(AUXOBJS)
27         $(OCAMLDEP) $(DEPOBJS) $(AUXOBJS) > .depend
28
29 mqtop: $(MQTOP:.ml=.cmo) $(LIBRARIES)
30         $(OCAMLC) -linkpkg -o mqtop $(MQTOP:.ml=.cmo)
31
32 mqtop.opt: $(MQTOP:.ml=.cmx) $(LIBRARIES_OPT)
33         $(OCAMLOPT) -linkpkg -o mqtop.opt $(MQTOP:.ml=.cmx)
34
35 mqitop: $(MQITOP:.ml=.cmo) $(LIBRARIES)
36         $(OCAMLC) -linkpkg -o mqitop $(MQITOP:.ml=.cmo)
37
38 mqitop.opt: $(MQITOP:.ml=.cmx) $(LIBRARIES_OPT)
39         $(OCAMLOPT) -linkpkg -o mqitop.opt $(MQITOP:.ml=.cmx)
40
41 mqgtop: mQGTopParser.cmi $(AUXOBJS:.ml=.cmo) $(MQGTOP:.ml=.cmo) $(LIBRARIES)
42         $(OCAMLC) -linkpkg -o mqgtop $(AUXOBJS:.ml=.cmo) $(MQGTOP:.ml=.cmo)
43
44 mqgtop.opt: $(AUXOBJS:.ml=.cmx) $(MQGTOP:.ml=.cmx) $(LIBRARIES_OPT)
45         $(OCAMLOPT) -linkpkg -o mqgtop.opt $(AUXOBJS:.ml=.cmx) $(MQGTOP:.ml=.cmx)
46
47 .SUFFIXES: .ml .mli .cmo .cmi .cmx .mly .mll
48 .ml.cmo: $(LIBRARIES)
49         $(OCAMLC) -c $<
50 .mli.cmi: $(LIBRARIES)
51         $(OCAMLC) -c $<
52 .ml.cmx: $(LIBRARIES_OPT)
53         $(OCAMLOPT) -c $<
54 .mly.ml: 
55         $(OCAMLYACC) $<
56 .mly.mli:
57         $(OCAMLYACC) $<
58 .mll.ml:
59         $(OCAMLLEX) $<
60
61 $(DEPOBJS:%.ml=%.cmo): $(LIBRARIES)
62 $(DEPOBJS:%.ml=%.cmx): $(LIBRARIES_OPT)
63
64 clean:
65         rm -f *.cm[iox] *.o $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) \
66         mQGTopParser.ml mQGTopParser.mli mQGTopLexer.ml
67
68 install:
69         cp $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) $(BIN_DIR)
70
71 uninstall:
72         cd $(BIN_DIR)
73         rm -f $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt)
74
75 .PHONY: install uninstall clean
76
77 ifneq ($(MAKECMDGOALS), depend)
78    include .depend   
79 endif
80