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