]> matita.cs.unibo.it Git - helm.git/blob - helm/hxp/Makefile
ocaml 3.09 transition
[helm.git] / helm / hxp / Makefile
1 BIN_DIR = /usr/local/bin
2 REQUIRES = zip
3 # unix helm-cic_textual_parser \
4 # helm-mathql helm-mathql_interpreter helm-mathql_generator
5 PREDICATES =
6 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)"
7 OCAMLC = ocamlfind ocamlc $(OCAMLOPTIONS)
8 OCAMLOPT = ocamlfind ocamlopt $(OCAMLOPTIONS)
9 OCAMLDEP = ocamldep
10 OCAMLYACC = ocamlyacc
11 OCAMLLEX = ocamllex
12
13 LIBRARIES = $(shell ocamlfind query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
14 LIBRARIES_OPT = $(shell ocamlfind query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
15
16 HXPTOP = hxpTop.ml
17
18 DEPOBJS = $(HXPTOP)
19 AUXOBJS = hxpTypes.ml hxpParser.ml hxpParser.mli hxpLexer.ml hxpXML.ml 
20
21 all: hxp
22 opt: hxp.opt
23
24 depend: $(AUXOBJS)
25         $(OCAMLDEP) $(DEPOBJS) $(AUXOBJS) > .depend
26
27 hxp: hxpParser.cmi $(AUXOBJS:.ml=.cmo) $(HXPTOP:.ml=.cmo) $(LIBRARIES)
28         $(OCAMLC) -linkpkg -o hxp $(AUXOBJS:.ml=.cmo) $(HXPTOP:.ml=.cmo)
29
30 hxp.opt: $(AUXOBJS:.ml=.cmx) $(HXPTOP:.ml=.cmx) $(LIBRARIES_OPT)
31         $(OCAMLOPT) -linkpkg -o hxp.opt $(AUXOBJS:.ml=.cmx) $(HXPTOP:.ml=.cmx)
32
33 .SUFFIXES: .ml .mli .cmo .cmi .cmx .mly .mll
34 .ml.cmo: $(LIBRARIES)
35         $(OCAMLC) -c $<
36 .mli.cmi: $(LIBRARIES)
37         $(OCAMLC) -c $<
38 .ml.cmx: $(LIBRARIES_OPT)
39         $(OCAMLOPT) -c $<
40 .mly.ml: 
41         $(OCAMLYACC) $<
42 .mly.mli:
43         $(OCAMLYACC) $<
44 .mll.ml:
45         $(OCAMLLEX) $<
46
47 $(DEPOBJS:%.ml=%.cmo): $(LIBRARIES)
48 $(DEPOBJS:%.ml=%.cmx): $(LIBRARIES_OPT)
49
50 clean:
51         rm -f *.cm[iox] *.o hxp hxp.opt \
52         hxpParser.ml hxpParser.mli hxpLexer.ml
53
54 install:
55         cp hxp hxp.opt $(BIN_DIR)
56
57 uninstall:
58         cd $(BIN_DIR)
59         rm -f hxp hxp.opt
60
61 .PHONY: install uninstall clean
62
63 ifneq ($(MAKECMDGOALS), depend)
64    include .depend   
65 endif
66