]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/mathql_test/Makefile
- New interface for the MathQL interpreter (1.3 version)
[helm.git] / helm / ocaml / mathql_test / Makefile
1 BIN_DIR = /usr/local/bin
2 REQUIRES = unix helm-cic helm-cic_textual_parser helm-mathql helm-mathql_interpreter 
3 PREDICATES =
4 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)"
5 OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
6 OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
7 OCAMLDEP = ocamldep
8
9 LIBRARIES = $(shell ocamlfind query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
10 LIBRARIES_OPT = $(shell ocamlfind query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
11
12 MQTOP = mqtop.ml
13 MQITOP = mqitop.ml
14
15 DEPOBJS = $(MQTOP) $(MQITOP) 
16
17 all: $(DEPOBJS:.ml=)
18 opt: $(DEPOBJS:.ml=.opt)
19
20 depend:
21         $(OCAMLDEP) $(DEPOBJS) > .depend
22
23 mqtop: $(MQTOP:.ml=.cmo) $(LIBRARIES)
24         $(OCAMLC) -linkpkg -o mqtop $(MQTOP:.ml=.cmo)
25
26 mqtop.opt: $(MQTOP:.ml=.cmx) $(LIBRARIES_OPT)
27         $(OCAMLOPT) -linkpkg -o mqtop.opt $(MQTOP:.ml=.cmx)
28
29 mqitop: $(MQITOP:.ml=.cmo) $(LIBRARIES)
30         $(OCAMLC) -linkpkg -o mqitop $(MQITOP:.ml=.cmo)
31
32 mqitop.opt: $(MQITOP:.ml=.cmx) $(LIBRARIES_OPT)
33         $(OCAMLOPT) -linkpkg -o mqitop.opt $(MQITOP:.ml=.cmx)
34
35 .SUFFIXES: .ml .mli .cmo .cmi .cmx
36 .ml.cmo: $(LIBRARIES)
37         $(OCAMLC) -c $<
38 .mli.cmi: $(LIBRARIES)
39         $(OCAMLC) -c $<
40 .ml.cmx: $(LIBRARIES_OPT)
41         $(OCAMLOPT) -c $<
42
43 $(DEPOBJS:%.ml=%.cmo): $(LIBRARIES)
44 $(DEPOBJS:%.ml=%.cmx): $(LIBRARIES_OPT)
45
46 clean:
47         rm -f *.cm[iox] *.o $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) 
48
49 install:
50         cp $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) $(BIN_DIR)
51
52 uninstall:
53         cd $(BIN_DIR)
54         rm -f $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt)
55
56 .PHONY: install uninstall clean
57
58 ifneq ($(MAKECMDGOALS), depend)
59    include .depend   
60 endif
61