]> matita.cs.unibo.it Git - helm.git/blob - helm/gTopLevel/Makefile.in
4c3138a39201e02f8dd26d1e29a837c652147dea
[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-cic_textual_parser \
11         helm-tex_cic_textual_parser \
12         mathml-editor \
13         lablgtkmathview
14
15 REQUIRES = $(TEST_REQUIRES) gdome2-xslt helm-hbugs
16
17 PREDICATES = "gnome,init,glade"
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         oldDisambiguate.mli \
44         disambiguatingParser.mli \
45         termEditor.mli \
46         texTermEditor.mli \
47         xmlDiff.mli \
48         chosenTransformer.mli \
49         termViewer.mli \
50         invokeTactics.mli \
51         hbugs.mli \
52         chosenTermEditor.mli \
53         helmGtkLogger.mli
54
55 DEPOBJS = \
56         $(INTERFACE_FILES) $(INTERFACE_FILES:%.mli=%.ml) \
57         gTopLevel.ml regtest.ml testlibrary.ml batchParser.ml batchParser.mli
58
59 TOPLEVELOBJS = $(INTERFACE_FILES:%.mli=%.cmo) gTopLevel.cmo
60 TESTOBJS = \
61         oldDisambiguate.cmo \
62         disambiguatingParser.cmo \
63         batchParser.cmo
64 REGTESTOBJS = $(TESTOBJS) regtest.cmo
65 TESTLIBOBJS = $(TESTOBJS) testlibrary.cmo
66
67 $(INTERFACE_FILES:%.mli=%.cmo): $(LIBRARIES)
68 $(INTERFACE_FILES:%.mli=%.cmx): $(LIBRARIES_OPT)
69
70 styles:
71         @echo "***********************************************************************"
72         @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
73         @echo "***********************************************************************"
74         mkdir styles
75         (cd styles && for i in ../stylesheets/*.xsl ; do ln -s $$i; done)
76         (cd styles && for i in ../stylesheets/generated/*.xsl ; do ln -s $$i; done)
77         (cd styles && rm rootcontent.xsl && ln -s ../rootcontent.xsl)
78         
79 depend:
80         $(OCAMLDEP) $(DEPOBJS) > .depend
81
82 gTopLevel: $(TOPLEVELOBJS) $(LIBRARIES)
83         $(OCAMLC) -thread -linkpkg -o $@ $(TOPLEVELOBJS)
84 gTopLevel.opt: $(TOPLEVELOBJS:.cmo=.cmx) $(LIBRARIES_OPT)
85         $(OCAMLOPT) -thread -linkpkg -o $@ $(TOPLEVELOBJS:.cmo=.cmx)
86
87 testlibrary: $(TESTLIBOBJS) $(TEST_LIBRARIES)
88         $(OCAMLFIND) ocamlc -thread $(OCAMLDEBUGOPTIONS) -linkpkg \
89                 -package "$(TEST_REQUIRES)" -o $@ $(TESTLIBOBJS)
90 testlibrary.opt: $(TESTLIBOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
91         $(OCAMLFIND) ocamlopt -thread -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
92                 $(TESTLIBOBJS:.cmo=.cmx)
93
94 regtest: $(REGTESTOBJS) $(TEST_LIBRARIES)
95         $(OCAMLFIND) ocamlc -thread $(OCAMLDEBUGOPTIONS) -linkpkg \
96                 -package "$(TEST_REQUIRES)" -o $@ $(REGTESTOBJS)
97 regtest.opt: $(REGTESTOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
98         $(OCAMLFIND) ocamlopt -thread -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
99                 $(REGTESTOBJS:.cmo=.cmx)
100
101 .SUFFIXES: .ml .mli .cmo .cmi .cmx
102 .ml.cmo:
103         $(OCAMLC) -c $<
104 .mli.cmi:
105         $(OCAMLC) -c $<
106 .ml.cmx:
107         $(OCAMLOPT) -c $<
108
109 $(TOPLEVELOBJS): $(LIBRARIES)
110 $(TOPLEVELOBJS:.cmo=.cmx)): $(LIBRARIES_OPT)
111
112 clean:
113         rm -f *.cm[iox] *.o gTopLevel{,.opt} regtest{,.opt} testlibrary{,.opt}
114 install:
115         cp gTopLevel gTopLevel.opt $(BIN_DIR)
116 uninstall:
117         rm -f $(BIN_DIR)/gTopLevel $(BIN_DIR)/gTopLevel.opt
118
119 .PHONY: install uninstall clean test
120
121 INTESTS := $(wildcard tests/*.cic)
122 OUTTESTS := $(patsubst %, %.test, $(INTESTS))
123 gentest: $(OUTTESTS)
124 cleantest:
125         rm -f $(OUTTESTS)
126 tests/%.cic.test: tests/%.cic regtest
127         time ./regtest -gen $<
128 test: regtest
129         ./regtest $(INTESTS) 2> /dev/null
130 test.opt: regtest.opt
131         ./regtest.opt $(INTESTS) 2> /dev/null
132 envtest: regtest
133         ./regtest -dump $(INTESTS) 2> /dev/null
134 envtest.opt: regtest.opt
135         ./regtest.opt -dump $(INTESTS) 2> /dev/null
136 librarytest: testlibrary
137         ./testlibrary -vars -varsprefix cic:/Coq index.txt 2>/dev/null >LOG
138 librarytest.opt: testlibrary.opt
139         ./testlibrary.opt -vars -varsprefix cic:/Coq index.txt 2>/dev/null >LOG
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