]> matita.cs.unibo.it Git - helm.git/blob - helm/gTopLevel/topLevel/Makefile
packege dependences calculation patched
[helm.git] / helm / gTopLevel / topLevel / Makefile
1 BIN_DIR = /usr/local/bin
2 REQUIRES = helm-urimanager helm-cic_textual_parser helm-cic_proof_checking helm-mathql helm-mathql_interpreter
3 PREDICATES =
4 OCAMLOPTIONS = -I .. -package "$(REQUIRES)" -predicates "$(PREDICATES)"
5 OCAMLDEPOPTIONS = $(shell ocamlfind query -recursive -predicates "$(PREDICATES)" -i-format $(REQUIRES))
6 OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
7 OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
8 OCAMLDEP = ocamldep -I .. -I ../../ocaml/mathql_interpreter -I ../../ocaml/mathql
9
10 LIBRARIES = $(shell ocamlfind query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
11 LIBRARIES_OPT = $(shell ocamlfind query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
12
13 all: topLevel
14 opt: topLevel.opt
15
16 DEPOBJS = topLevel.ml
17
18 TOPLEVELOBJS = ../mQueryLevels.cmo ../mQueryGenerator.cmo topLevel.cmo
19
20 depend:
21         $(OCAMLDEP) $(OCAMLDEPOPTIONS) $(DEPOBJS) > .depend
22
23 topLevel: $(TOPLEVELOBJS) $(LIBRARIES)
24         $(OCAMLC)  -linkpkg -o topLevel $(TOPLEVELOBJS)
25
26 topLevel.opt: $(TOPLEVELOBJS:.cmo=.cmx) $(LIBRARIES_OPT)
27         $(OCAMLOPT) -linkpkg -o topLevel.opt $(TOPLEVELOBJS:.cmo=.cmx)
28
29 .SUFFIXES: .ml .mli .cmo .cmi .cmx
30 .ml.cmo: $(LIBRARIES)
31         $(OCAMLC) -c $<
32 .mli.cmi: $(LIBRARIES)
33         $(OCAMLC) -c $<
34 .ml.cmx: $(LIBRARIES_OPT)
35         $(OCAMLOPT) -c $<
36
37 clean:
38         rm -f *.cm[iox] *.o topLevel topLevel.opt
39
40 install:
41         cp topLevel topLevel.opt $(BIN_DIR)
42
43 uninstall:
44         rm -f $(BIN_DIR)/topLevel $(BIN_DIR)/topLevel.opt
45
46 .PHONY: install uninstall clean
47
48 ifneq ($(MAKECMDGOALS), depend)
49    include .depend   
50 endif