]> matita.cs.unibo.it Git - helm.git/blob - helm/gTopLevel/Makefile
- added testlibrary .opts
[helm.git] / helm / gTopLevel / Makefile
1 BIN_DIR = /usr/local/bin
2 REQUIRES = lablgtkmathview helm-cic_textual_parser helm-tex_cic_textual_parser \
3            gdome2-xslt helm-mathql_interpreter helm-mathql_generator \
4            helm-tactics hbugs-client mathml-editor helm-cic_transformations \
5            helm-cic_textual_parser2 helm-cic_cache
6 PREDICATES = "gnome,init,glade"
7 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o
8 OCAMLFIND = ocamlfind
9 OCAMLC = $(OCAMLFIND) ocamlc -thread $(OCAMLOPTIONS)
10 OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(OCAMLOPTIONS)
11 OCAMLDEP = ocamldep -pp camlp4o
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 all: styles gTopLevel
17 opt: styles gTopLevel.opt
18
19 start:
20         $(MAKE) -C ../hbugs/ start
21 stop:
22         $(MAKE) -C ../hbugs/ stop
23
24 INTERFACE_FILES = \
25         proofEngine.mli logicalOperations.mli oldDisambiguate.mli \
26   disambiguatingParser.mli termEditor.mli texTermEditor.mli xmlDiff.mli \
27   chosenTransformer.mli termViewer.mli invokeTactics.mli hbugs.mli \
28   chosenTermEditor.mli 
29
30 DEPOBJS = \
31         $(INTERFACE_FILES) $(INTERFACE_FILES:%.mli=%.ml) \
32         gTopLevel.ml regtest.ml testlibrary.ml batchParser.ml batchParser.mli
33
34 TOPLEVELOBJS = $(INTERFACE_FILES:%.mli=%.cmo) gTopLevel.cmo
35 REGTESTOBJS = \
36         $(INTERFACE_FILES:%.mli=%.cmo) batchParser.cmo regtest.cmo
37 TESTLIBOBJS = \
38         $(INTERFACE_FILES:%.mli=%.cmo) testlibrary.cmo
39
40 $(INTERFACE_FILES:%.mli=%.cmo): $(LIBRARIES)
41 $(INTERFACE_FILES:%.mli=%.cmx): $(LIBRARIES_OPT)
42
43 styles:
44         @echo "***********************************************************************"
45         @if [ -d stylesheets -a -d meta_stylesheets ] ; then echo -e "* stylesheets and metastylesheets found:                              *\\n* I will create the request hyperlinks in styles                      *" ; else echo -e "* stylesheets or meta_stylesheets not found:                          *\\n* you should check-out the two directories from the MoWGLI repository *" ; exit -1 ; fi
46         @echo "***********************************************************************"
47         mkdir styles
48         (cd styles && for i in ../stylesheets/*.xsl ; do ln -s $$i; done)
49         (cd styles && for i in ../stylesheets/generated/*.xsl ; do ln -s $$i; done)
50         (cd styles && rm rootcontent.xsl && ln -s ../rootcontent.xsl)
51         
52 depend:
53         $(OCAMLDEP) $(DEPOBJS) > .depend
54
55 gTopLevel: $(TOPLEVELOBJS) $(LIBRARIES)
56         $(OCAMLC) -linkpkg -o $@ $(TOPLEVELOBJS)
57 gTopLevel.opt: $(TOPLEVELOBJS:.cmo=.cmx) $(LIBRARIES_OPT)
58         $(OCAMLOPT) -linkpkg -o $@ $(TOPLEVELOBJS:.cmo=.cmx)
59
60 testlibrary: $(TESTLIBOBJS) $(LIBRARIES)
61         $(OCAMLC) -linkpkg -o $@ $(TESTLIBOBJS)
62 testlibrary.opt: $(TESTLIBOBJS:.cmo=.cmx) $(LIBRARIES)
63         $(OCAMLOPT) -linkpkg -o $@ $(TESTLIBOBJS:.cmo=.cmx)
64 regtest: $(REGTESTOBJS) $(LIBRARIES)
65         $(OCAMLC) -linkpkg -o $@ $(REGTESTOBJS)
66 regtest.opt: $(REGTESTOBJS:.cmo=.cmx) $(LIBRARIES)
67         $(OCAMLOPT) -linkpkg -o $@ $(REGTESTOBJS:.cmo=.cmx)
68
69 .SUFFIXES: .ml .mli .cmo .cmi .cmx
70 .ml.cmo:
71         $(OCAMLC) -c $<
72 .mli.cmi:
73         $(OCAMLC) -c $<
74 .ml.cmx:
75         $(OCAMLOPT) -c $<
76
77 $(TOPLEVELOBJS): $(LIBRARIES)
78 $(TOPLEVELOBJS:.cmo=.cmx)): $(LIBRARIES_OPT)
79
80 clean:
81         rm -f *.cm[iox] *.o gTopLevel{,.opt} regtest{,.opt}
82 install:
83         cp gTopLevel gTopLevel.opt $(BIN_DIR)
84 uninstall:
85         rm -f $(BIN_DIR)/gTopLevel $(BIN_DIR)/gTopLevel.opt
86
87 .PHONY: install uninstall clean test
88
89 INTESTS := $(wildcard tests/*.cic)
90 OUTTESTS := $(patsubst %, %.test, $(INTESTS))
91 gentest: $(OUTTESTS)
92 cleantest:
93         rm -f $(OUTTESTS)
94 tests/%.cic.test: tests/%.cic regtest
95         time ./regtest -gen $<
96 test: regtest
97         ./regtest $(INTESTS) 2> /dev/null
98 envtest: regtest
99         ./regtest -dump $(INTESTS) 2> /dev/null
100
101 ifneq ($(MAKECMDGOALS), depend)
102    include .depend   
103 endif