]> matita.cs.unibo.it Git - helm.git/blob - helm/gTopLevel/Makefile.in
added test script for typechecking URIs given on STDIN
[helm.git] / helm / gTopLevel / Makefile.in
1 BIN_DIR = /usr/local/bin
2
3 TEST_REQUIRES = \
4         helm-registry \
5         helm-mathql_interpreter \
6         helm-mathql_generator \
7         helm-tactics \
8         helm-cic_transformations \
9         helm-cic_textual_parser2 \
10         helm-xmldiff \
11         lablgtk2 \
12         mathml-editor \
13         lablgtkmathview \
14         dbi.mysql
15
16 REQUIRES = $(TEST_REQUIRES) gdome2-xslt helm-hbugs lablgtk2.init lablgtk2.glade
17
18 OCAMLOPTIONS = \
19         -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o -thread
20 OCAMLFIND = @OCAMLFIND@
21 OCAMLDEBUGOPTIONS = -g
22 OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) $(OCAMLOPTIONS)
23 OCAMLOPT = $(OCAMLFIND) ocamlopt $(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 \
42         logicalOperations.mli \
43         disambiguatingParser.mli \
44         termEditor.mli \
45         texTermEditor.mli \
46         chosenTransformer.mli \
47         termViewer.mli \
48         invokeTactics.mli \
49         hbugs.mli \
50         chosenTermEditor.mli \
51         helmGtkLogger.mli
52
53 DEPOBJS = \
54         $(INTERFACE_FILES) $(INTERFACE_FILES:%.mli=%.ml) \
55         gTopLevel.ml regtest.ml testlibrary.ml batchParser.ml batchParser.mli
56
57 TOPLEVELOBJS = $(INTERFACE_FILES:%.mli=%.cmo) gTopLevel.cmo
58 TESTOBJS = \
59         disambiguatingParser.cmo \
60         batchParser.cmo
61 REGTESTOBJS = $(TESTOBJS) regtest.cmo
62 TESTLIBOBJS = $(TESTOBJS) testlibrary.cmo
63
64 $(INTERFACE_FILES:%.mli=%.cmo): $(LIBRARIES)
65 $(INTERFACE_FILES:%.mli=%.cmx): $(LIBRARIES_OPT)
66
67 styles:
68         @echo "***********************************************************************"
69         @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
70         @echo "***********************************************************************"
71         mkdir styles
72         (cd styles && for i in ../stylesheets/*.xsl ; do ln -s $$i; done)
73         (cd styles && for i in ../stylesheets/generated/*.xsl ; do ln -s $$i; done)
74         (cd styles && rm rootcontent.xsl && ln -s ../rootcontent.xsl)
75         
76 depend:
77         $(OCAMLDEP) $(DEPOBJS) > .depend
78
79 gTopLevel: $(TOPLEVELOBJS) $(LIBRARIES)
80         $(OCAMLC) -thread -linkpkg -o $@ $(TOPLEVELOBJS)
81 gTopLevel.opt: $(TOPLEVELOBJS:.cmo=.cmx) $(LIBRARIES_OPT)
82         $(OCAMLOPT) -thread -linkpkg -o $@ $(TOPLEVELOBJS:.cmo=.cmx)
83
84 testlibrary: $(TESTLIBOBJS) $(TEST_LIBRARIES)
85         $(OCAMLFIND) ocamlc -thread $(OCAMLDEBUGOPTIONS) -linkpkg \
86                 -package "$(TEST_REQUIRES)" -o $@ $(TESTLIBOBJS)
87 testlibrary.opt: $(TESTLIBOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
88         $(OCAMLFIND) ocamlopt -thread -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
89                 $(TESTLIBOBJS:.cmo=.cmx)
90
91 regtest: $(REGTESTOBJS) $(TEST_LIBRARIES)
92         $(OCAMLFIND) ocamlc -thread $(OCAMLDEBUGOPTIONS) -linkpkg \
93                 -package "$(TEST_REQUIRES)" -o $@ $(REGTESTOBJS)
94 regtest.opt: $(REGTESTOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
95         $(OCAMLFIND) ocamlopt -thread -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
96                 $(REGTESTOBJS:.cmo=.cmx)
97
98 .SUFFIXES: .ml .mli .cmo .cmi .cmx
99 .ml.cmo:
100         $(OCAMLC) -c $<
101 .mli.cmi:
102         $(OCAMLC) -c $<
103 .ml.cmx:
104         $(OCAMLOPT) -c $<
105
106 $(TOPLEVELOBJS): $(LIBRARIES)
107 $(TOPLEVELOBJS:.cmo=.cmx)): $(LIBRARIES_OPT)
108
109 clean:
110         rm -f *.cm[iox] *.o gTopLevel{,.opt} regtest{,.opt} testlibrary{,.opt}
111 install:
112         cp gTopLevel gTopLevel.opt $(BIN_DIR)
113 uninstall:
114         rm -f $(BIN_DIR)/gTopLevel $(BIN_DIR)/gTopLevel.opt
115
116 .PHONY: install uninstall clean test
117
118 INTESTS := $(wildcard tests/*.cic)
119 OUTTESTS := $(patsubst %, %.test, $(INTESTS))
120 gentest: $(OUTTESTS)
121 cleantest:
122         rm -f $(OUTTESTS)
123 tests/%.cic.test: tests/%.cic regtest
124         time ./regtest -gen $<
125 test: regtest
126         ./regtest $(INTESTS) 2> /dev/null
127 test.opt: regtest.opt
128         ./regtest.opt $(INTESTS) 2> /dev/null
129 envtest: regtest
130         ./regtest -dump $(INTESTS) 2> /dev/null
131 envtest.opt: regtest.opt
132         ./regtest.opt -dump $(INTESTS) 2> /dev/null
133 librarytest: testlibrary
134         ./testlibrary -vars -varsprefix cic:/Coq index.txt 2>/dev/null >LOG
135 librarytest.opt: testlibrary.opt
136         ./testlibrary.opt -vars -varsprefix cic:/Coq index.txt 2>/dev/null >LOG
137 typecheck_uri: typecheck_uri.ml
138         $(OCAMLFIND) ocamlc -thread -package helm-cic_proof_checking -linkpkg -o $@ $<
139 typecheck_uri.opt: typecheck_uri.ml
140         $(OCAMLFIND) opt -thread -package helm-cic_proof_checking -linkpkg -o $@ $<
141
142 MAIN = ./gTopLevel
143 ARGS =
144 debug:
145         echo "load_printer \"threads.cma\"" > .debug_script
146         $(OCAMLFIND) query -recursive -predicates "mt,byte" -a-format \
147                 helm-cic_unification | \
148                 sed 's/\(.*\)/load_printer "\1"/' \
149                 >> .debug_script
150         echo "install_printer CicMetaSubst.fppsubst" >> .debug_script
151         echo "install_printer CicMetaSubst.fppterm" >> .debug_script
152         echo "install_printer CicMetaSubst.fppmetasenv" >> .debug_script
153         ledit $(OCAMLDEBUG) \
154                 -source .debug_script \
155     -I +threads \
156                 $(shell $(OCAMLFIND) query -recursive -i-format $(REQUIRES)) \
157                 $(MAIN) $(ARGS)
158
159 ifneq ($(MAKECMDGOALS), depend)
160    include .depend   
161 endif
162