]> matita.cs.unibo.it Git - helm.git/blob - helm/gTopLevel/Makefile
- split regtest/testlibrary/gTopLevel objects so that the first two
[helm.git] / helm / gTopLevel / Makefile
1 BIN_DIR = /usr/local/bin
2 TEST_REQUIRES = \
3         helm-mathql_interpreter \
4         helm-mathql_generator \
5         helm-tactics \
6         helm-cic_transformations \
7         helm-cic_textual_parser2 \
8         helm-cic_textual_parser \
9         helm-tex_cic_textual_parser \
10         mathml-editor \
11         lablgtkmathview \
12         helm-cic_cache
13 REQUIRES = \
14         $(TEST_REQUIRES) \
15         gdome2-xslt \
16         hbugs-client \
17         helm-cic_cache
18 PREDICATES = "gnome,init,glade"
19 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o
20 OCAMLFIND = ocamlfind
21 OCAMLDEBUGOPTIONS = -g
22 OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) $(OCAMLOPTIONS)
23 OCAMLOPT = $(OCAMLFIND) opt $(OCAMLOPTIONS)
24 OCAMLDEP = $(OCAMLFIND) ocamldep -pp camlp4o
25 OCAMLDEBUG = wowcamldebug
26
27 LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
28 LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
29 TEST_LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(TEST_REQUIRES))
30 TEST_LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(TEST_REQUIRES))
31
32 all: styles gTopLevel
33 opt: styles gTopLevel.opt
34
35 start:
36         $(MAKE) -C ../hbugs/ start
37 stop:
38         $(MAKE) -C ../hbugs/ stop
39
40 INTERFACE_FILES = \
41         proofEngine.mli logicalOperations.mli oldDisambiguate.mli \
42   disambiguatingParser.mli termEditor.mli texTermEditor.mli xmlDiff.mli \
43   chosenTransformer.mli termViewer.mli invokeTactics.mli hbugs.mli \
44   chosenTermEditor.mli 
45
46 DEPOBJS = \
47         $(INTERFACE_FILES) $(INTERFACE_FILES:%.mli=%.ml) \
48         gTopLevel.ml regtest.ml testlibrary.ml batchParser.ml batchParser.mli
49
50 TOPLEVELOBJS = $(INTERFACE_FILES:%.mli=%.cmo) gTopLevel.cmo
51 REGTESTOBJS = \
52         oldDisambiguate.cmo \
53         disambiguatingParser.cmo \
54         batchParser.cmo \
55         regtest.cmo
56 TESTLIBOBJS = testlibrary.cmo
57
58 $(INTERFACE_FILES:%.mli=%.cmo): $(LIBRARIES)
59 $(INTERFACE_FILES:%.mli=%.cmx): $(LIBRARIES_OPT)
60
61 styles:
62         @echo "***********************************************************************"
63         @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
64         @echo "***********************************************************************"
65         mkdir styles
66         (cd styles && for i in ../stylesheets/*.xsl ; do ln -s $$i; done)
67         (cd styles && for i in ../stylesheets/generated/*.xsl ; do ln -s $$i; done)
68         (cd styles && rm rootcontent.xsl && ln -s ../rootcontent.xsl)
69         
70 depend:
71         $(OCAMLDEP) $(DEPOBJS) > .depend
72
73 gTopLevel: $(TOPLEVELOBJS) $(LIBRARIES)
74         $(OCAMLC) -thread -linkpkg -o $@ $(TOPLEVELOBJS)
75 gTopLevel.opt: $(TOPLEVELOBJS:.cmo=.cmx) $(LIBRARIES_OPT)
76         $(OCAMLOPT) -thread -linkpkg -o $@ $(TOPLEVELOBJS:.cmo=.cmx)
77
78 testlibrary: $(TESTLIBOBJS) $(TEST_LIBRARIES)
79         $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) -linkpkg \
80                 -package "$(TEST_REQUIRES)" -o $@ $(TESTLIBOBJS)
81 testlibrary.opt: $(TESTLIBOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
82         $(OCAMLFIND) opt -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
83                 $(TESTLIBOBJS:.cmo=.cmx)
84
85 regtest: $(REGTESTOBJS) $(TEST_LIBRARIES)
86         $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) -linkpkg \
87                 -package "$(TEST_REQUIRES)" -o $@ $(REGTESTOBJS)
88 regtest.opt: $(REGTESTOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
89         $(OCAMLOPT) opt -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
90                 $(REGTESTOBJS:.cmo=.cmx)
91
92 .SUFFIXES: .ml .mli .cmo .cmi .cmx
93 .ml.cmo:
94         $(OCAMLC) -c $<
95 .mli.cmi:
96         $(OCAMLC) -c $<
97 .ml.cmx:
98         $(OCAMLOPT) -c $<
99
100 $(TOPLEVELOBJS): $(LIBRARIES)
101 $(TOPLEVELOBJS:.cmo=.cmx)): $(LIBRARIES_OPT)
102
103 clean:
104         rm -f *.cm[iox] *.o gTopLevel{,.opt} regtest{,.opt} testlibrary{,.opt}
105 install:
106         cp gTopLevel gTopLevel.opt $(BIN_DIR)
107 uninstall:
108         rm -f $(BIN_DIR)/gTopLevel $(BIN_DIR)/gTopLevel.opt
109
110 .PHONY: install uninstall clean test
111
112 INTESTS := $(wildcard tests/*.cic)
113 OUTTESTS := $(patsubst %, %.test, $(INTESTS))
114 gentest: $(OUTTESTS)
115 cleantest:
116         rm -f $(OUTTESTS)
117 tests/%.cic.test: tests/%.cic regtest
118         time ./regtest -gen $<
119 test: regtest
120         ./regtest $(INTESTS) 2> /dev/null
121 envtest: regtest
122         ./regtest -dump $(INTESTS) 2> /dev/null
123 librarytest: testlibrary.opt
124         ./testlibrary.opt - <index.txt 2>/dev/null >LOG &
125
126 MAIN = ./gTopLevel
127 ARGS =
128 debug:
129         $(OCAMLFIND) query -recursive -predicates byte -a-format \
130                 helm-cic_unification | \
131                 sed 's/\(.*\)/load_printer "\1"/' \
132                 > .debug_script
133         echo "install_printer CicMetaSubst.fppsubst" >> .debug_script
134         echo "install_printer CicMetaSubst.fppterm" >> .debug_script
135         echo "install_printer CicMetaSubst.fppmetasenv" >> .debug_script
136         $(OCAMLDEBUG) \
137                 -source .debug_script \
138                 $(shell $(OCAMLFIND) query -recursive -i-format $(REQUIRES)) \
139                 $(MAIN) $(ARGS)
140
141 ifneq ($(MAKECMDGOALS), depend)
142    include .depend   
143 endif
144