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