1 BIN_DIR = /usr/local/bin
2 REQUIRES = unix helm-registry helm-cic_textual_parser \
3 helm-mathql helm-mathql_interpreter helm-mathql_generator
5 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread
6 OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
7 OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
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))
19 DEPOBJS = $(MQTOP) $(MQITOP) $(MQGTOP)
20 AUXOBJS = mQGTopParser.ml mQGTopParser.mli mQGTopLexer.ml
23 opt: $(DEPOBJS:.ml=.opt)
26 $(OCAMLDEP) $(DEPOBJS) $(AUXOBJS) > .depend
28 mqtop: $(MQTOP:.ml=.cmo) $(LIBRARIES)
29 $(OCAMLC) -linkpkg -o mqtop $(MQTOP:.ml=.cmo)
31 mqtop.opt: $(MQTOP:.ml=.cmx) $(LIBRARIES_OPT)
32 $(OCAMLOPT) -linkpkg -o mqtop.opt $(MQTOP:.ml=.cmx)
34 mqitop: $(MQITOP:.ml=.cmo) $(LIBRARIES)
35 $(OCAMLC) -linkpkg -o mqitop $(MQITOP:.ml=.cmo)
37 mqitop.opt: $(MQITOP:.ml=.cmx) $(LIBRARIES_OPT)
38 $(OCAMLOPT) -linkpkg -o mqitop.opt $(MQITOP:.ml=.cmx)
40 mqgtop: mQGTopParser.cmi $(AUXOBJS:.ml=.cmo) $(MQGTOP:.ml=.cmo) $(LIBRARIES)
41 $(OCAMLC) -linkpkg -o mqgtop $(AUXOBJS:.ml=.cmo) $(MQGTOP:.ml=.cmo)
43 mqgtop.opt: $(AUXOBJS:.ml=.cmx) $(MQGTOP:.ml=.cmx) $(LIBRARIES_OPT)
44 $(OCAMLOPT) -linkpkg -o mqgtop.opt $(AUXOBJS:.ml=.cmx) $(MQGTOP:.ml=.cmx)
46 .SUFFIXES: .ml .mli .cmo .cmi .cmx .mly .mll
49 .mli.cmi: $(LIBRARIES)
51 .ml.cmx: $(LIBRARIES_OPT)
60 $(DEPOBJS:%.ml=%.cmo): $(LIBRARIES)
61 $(DEPOBJS:%.ml=%.cmx): $(LIBRARIES_OPT)
64 rm -f *.cm[iox] *.o $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) \
65 mQGTopParser.ml mQGTopParser.mli mQGTopLexer.ml
68 cp $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) $(BIN_DIR)
72 rm -f $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt)
74 .PHONY: install uninstall clean
76 ifneq ($(MAKECMDGOALS), depend)