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