]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_test/Makefile
- New interface for the MathQL interpreter (1.3 version)
[helm.git] / helm / ocaml / mathql_test / Makefile
diff --git a/helm/ocaml/mathql_test/Makefile b/helm/ocaml/mathql_test/Makefile
new file mode 100644 (file)
index 0000000..f6f41aa
--- /dev/null
@@ -0,0 +1,61 @@
+BIN_DIR = /usr/local/bin
+REQUIRES = unix helm-cic helm-cic_textual_parser helm-mathql helm-mathql_interpreter 
+PREDICATES =
+OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)"
+OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
+OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
+OCAMLDEP = ocamldep
+
+LIBRARIES = $(shell ocamlfind query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+LIBRARIES_OPT = $(shell ocamlfind query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+
+MQTOP = mqtop.ml
+MQITOP = mqitop.ml
+
+DEPOBJS = $(MQTOP) $(MQITOP) 
+
+all: $(DEPOBJS:.ml=)
+opt: $(DEPOBJS:.ml=.opt)
+
+depend:
+       $(OCAMLDEP) $(DEPOBJS) > .depend
+
+mqtop: $(MQTOP:.ml=.cmo) $(LIBRARIES)
+       $(OCAMLC) -linkpkg -o mqtop $(MQTOP:.ml=.cmo)
+
+mqtop.opt: $(MQTOP:.ml=.cmx) $(LIBRARIES_OPT)
+       $(OCAMLOPT) -linkpkg -o mqtop.opt $(MQTOP:.ml=.cmx)
+
+mqitop: $(MQITOP:.ml=.cmo) $(LIBRARIES)
+       $(OCAMLC) -linkpkg -o mqitop $(MQITOP:.ml=.cmo)
+
+mqitop.opt: $(MQITOP:.ml=.cmx) $(LIBRARIES_OPT)
+       $(OCAMLOPT) -linkpkg -o mqitop.opt $(MQITOP:.ml=.cmx)
+
+.SUFFIXES: .ml .mli .cmo .cmi .cmx
+.ml.cmo: $(LIBRARIES)
+       $(OCAMLC) -c $<
+.mli.cmi: $(LIBRARIES)
+       $(OCAMLC) -c $<
+.ml.cmx: $(LIBRARIES_OPT)
+       $(OCAMLOPT) -c $<
+
+$(DEPOBJS:%.ml=%.cmo): $(LIBRARIES)
+$(DEPOBJS:%.ml=%.cmx): $(LIBRARIES_OPT)
+
+clean:
+       rm -f *.cm[iox] *.o $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) 
+
+install:
+       cp $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) $(BIN_DIR)
+
+uninstall:
+       cd $(BIN_DIR)
+       rm -f $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt)
+
+.PHONY: install uninstall clean
+
+ifneq ($(MAKECMDGOALS), depend)
+   include .depend   
+endif
+