1 BIN_DIR = /usr/local/bin
2 REQUIRES = unix helm-cic helm-cic_textual_parser helm-mathql helm-mathql_interpreter helm-mquery_generator
4 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)"
5 OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
6 OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
11 LIBRARIES = $(shell ocamlfind query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
12 LIBRARIES_OPT = $(shell ocamlfind query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
18 DEPOBJS = $(MQTOP) $(MQITOP) $(MQGTOP)
19 AUXOBJS = mQGTopParser.ml mQGTopLexer.ml
22 opt: $(DEPOBJS:.ml=.opt)
25 $(OCAMLDEP) $(DEPOBJS) > .depend
27 mqtop: $(MQTOP:.ml=.cmo) $(LIBRARIES)
28 $(OCAMLC) -linkpkg -o mqtop $(MQTOP:.ml=.cmo)
30 mqtop.opt: $(MQTOP:.ml=.cmx) $(LIBRARIES_OPT)
31 $(OCAMLOPT) -linkpkg -o mqtop.opt $(MQTOP:.ml=.cmx)
33 mqitop: $(MQITOP:.ml=.cmo) $(LIBRARIES)
34 $(OCAMLC) -linkpkg -o mqitop $(MQITOP:.ml=.cmo)
36 mqitop.opt: $(MQITOP:.ml=.cmx) $(LIBRARIES_OPT)
37 $(OCAMLOPT) -linkpkg -o mqitop.opt $(MQITOP:.ml=.cmx)
39 mqgtop: mQGTopParser.cmi $(AUXOBJS:.ml=.cmo) $(MQGTOP:.ml=.cmo) $(LIBRARIES)
40 $(OCAMLC) -linkpkg -o mqgtop $(AUXOBJS:.ml=.cmo) $(MQGTOP:.ml=.cmo)
42 mqgtop.opt: $(AUXOBJS:.ml=.cmx) $(MQGTOP:.ml=.cmx) $(LIBRARIES_OPT)
43 $(OCAMLOPT) -linkpkg -o mqgtop.opt $(AUXOBJS:.ml=.cmx) $(MQGTOP:.ml=.cmx)
45 .SUFFIXES: .ml .mli .cmo .cmi .cmx .mly .mll
48 .mli.cmi: $(LIBRARIES)
50 .ml.cmx: $(LIBRARIES_OPT)
59 $(DEPOBJS:%.ml=%.cmo): $(LIBRARIES)
60 $(DEPOBJS:%.ml=%.cmx): $(LIBRARIES_OPT)
63 rm -f *.cm[iox] *.o $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) \
64 mQGTopParser.ml mQGTopParser.mli mQGTopLexer.ml
67 cp $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt) $(BIN_DIR)
71 rm -f $(DEPOBJS:.ml=) $(DEPOBJS:.ml=.opt)
73 .PHONY: install uninstall clean
75 ifneq ($(MAKECMDGOALS), depend)