]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gTopLevel/Makefile
split into two major parts:
[helm.git] / helm / gTopLevel / Makefile
index f7738091b9b8224d4f802a24a4ebe71377f42c3f..8b89d823a18cd92a894456d40d1d7977ea9e8ffd 100644 (file)
 BIN_DIR = /usr/local/bin
-REQUIRES = lablgtkmathview helm-cic_textual_parser helm-tex_cic_textual_parser \
-           helm-cic_proof_checking helm-xml gdome2-xslt helm-cic_unification \
-           helm-mathql helm-mathql_interpreter helm-mathql_generator \
-                helm-tactics threads hbugs-client mathml-editor
+TEST_REQUIRES = \
+       helm-mathql_interpreter \
+       helm-mathql_generator \
+       helm-tactics \
+       helm-cic_transformations \
+       helm-cic_textual_parser2 \
+       helm-cic_textual_parser \
+       helm-tex_cic_textual_parser \
+       mathml-editor \
+       lablgtkmathview \
+       helm-cic_cache
+REQUIRES = \
+       $(TEST_REQUIRES) \
+       gdome2-xslt \
+       hbugs-client \
+       helm-cic_cache
 PREDICATES = "gnome,init,glade"
 OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -pp camlp4o
 OCAMLFIND = ocamlfind
-OCAMLC = $(OCAMLFIND) ocamlc -thread $(OCAMLOPTIONS)
-OCAMLOPT = $(OCAMLFIND) ocamlopt -thread $(OCAMLOPTIONS)
-OCAMLDEP = ocamldep -pp camlp4o
+OCAMLDEBUGOPTIONS = -g
+OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) $(OCAMLOPTIONS)
+OCAMLOPT = $(OCAMLFIND) opt $(OCAMLOPTIONS)
+OCAMLDEP = $(OCAMLFIND) ocamldep -pp camlp4o
+OCAMLDEBUG = wowcamldebug
 
-LIBRARIES = $(shell ocamlfind query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
-LIBRARIES_OPT = $(shell ocamlfind query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(REQUIRES))
+TEST_LIBRARIES = $(shell $(OCAMLFIND) query -recursive -predicates "byte $(PREDICATES)" -format "%d/%a" $(TEST_REQUIRES))
+TEST_LIBRARIES_OPT = $(shell $(OCAMLFIND) query -recursive -predicates "native $(PREDICATES)" -format "%d/%a" $(TEST_REQUIRES))
 
 all: styles gTopLevel
 opt: styles gTopLevel.opt
 
+start:
+       $(MAKE) -C ../hbugs/ start
+stop:
+       $(MAKE) -C ../hbugs/ stop
+
+INTERFACE_FILES = \
+       proofEngine.mli \
+       logicalOperations.mli \
+       oldDisambiguate.mli \
+       disambiguatingParser.mli \
+       termEditor.mli \
+       texTermEditor.mli \
+       xmlDiff.mli \
+       chosenTransformer.mli \
+       termViewer.mli \
+       invokeTactics.mli \
+       hbugs.mli \
+       chosenTermEditor.mli 
+
 DEPOBJS = \
-       xml2Gdome.ml xml2Gdome.mli proofEngine.ml proofEngine.mli \
-       doubleTypeInference.ml doubleTypeInference.mli cic2acic.ml cic2acic.mli\
-       cic2Xml.ml cic2Xml.mli logicalOperations.ml logicalOperations.mli \
-       sequentPp.ml sequentPp.mli mQueryGenerator.mli mQueryLevels.ml \
-       mQueryLevels2.mli mQueryLevels2.ml mQueryGenerator.ml misc.ml misc.mli \
-        disambiguate.ml disambiguate.mli termEditor.ml termEditor.mli \
-        texTermEditor.ml texTermEditor.mli applyStylesheets.ml \
-        applyStylesheets.mli termViewer.ml termViewer.mli invokeTactics.ml \
-        invokeTactics.mli hbugs.ml hbugs.mli gTopLevel.ml
-
-TOPLEVELOBJS = \
-       xml2Gdome.cmo doubleTypeInference.cmo cic2acic.cmo cic2Xml.cmo \
-        proofEngine.cmo logicalOperations.cmo sequentPp.cmo \
-       mQueryLevels2.cmo misc.cmo disambiguate.cmo \
-       termEditor.cmo texTermEditor.cmo applyStylesheets.cmo termViewer.cmo \
-       invokeTactics.cmo hbugs.cmo gTopLevel.cmo
+       $(INTERFACE_FILES) $(INTERFACE_FILES:%.mli=%.ml) \
+       gTopLevel.ml regtest.ml testlibrary.ml batchParser.ml batchParser.mli
+
+TOPLEVELOBJS = $(INTERFACE_FILES:%.mli=%.cmo) gTopLevel.cmo
+TESTOBJS = \
+       oldDisambiguate.cmo \
+       disambiguatingParser.cmo \
+       batchParser.cmo
+REGTESTOBJS = $(TESTOBJS) regtest.cmo
+TESTLIBOBJS = $(TESTOBJS) testlibrary.cmo
+
+$(INTERFACE_FILES:%.mli=%.cmo): $(LIBRARIES)
+$(INTERFACE_FILES:%.mli=%.cmx): $(LIBRARIES_OPT)
 
 styles:
        @echo "***********************************************************************"
        @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
        @echo "***********************************************************************"
        mkdir styles
-       (cd stylesheets && for i in *.xsl ; do ln -s ../stylesheets/$$i ../styles/$$i ; done)
-       (cd stylesheets/generated && for i in *.xsl ; do ln -s ../stylesheets/generated/$$i ../../styles/$$i ; done)
-       rm styles/rootcontent.xsl
-       ln -s ../rootcontent.xsl styles/rootcontent.xsl
-
+       (cd styles && for i in ../stylesheets/*.xsl ; do ln -s $$i; done)
+       (cd styles && for i in ../stylesheets/generated/*.xsl ; do ln -s $$i; done)
+       (cd styles && rm rootcontent.xsl && ln -s ../rootcontent.xsl)
+       
 depend:
        $(OCAMLDEP) $(DEPOBJS) > .depend
 
 gTopLevel: $(TOPLEVELOBJS) $(LIBRARIES)
-       $(OCAMLC) -linkpkg -o gTopLevel $(TOPLEVELOBJS)
-
+       $(OCAMLC) -thread -linkpkg -o $@ $(TOPLEVELOBJS)
 gTopLevel.opt: $(TOPLEVELOBJS:.cmo=.cmx) $(LIBRARIES_OPT)
-       $(OCAMLOPT) -linkpkg -o gTopLevel.opt $(TOPLEVELOBJS:.cmo=.cmx)
+       $(OCAMLOPT) -thread -linkpkg -o $@ $(TOPLEVELOBJS:.cmo=.cmx)
+
+testlibrary: $(TESTLIBOBJS) $(TEST_LIBRARIES)
+       $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) -linkpkg \
+               -package "$(TEST_REQUIRES)" -o $@ $(TESTLIBOBJS)
+testlibrary.opt: $(TESTLIBOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
+       $(OCAMLFIND) opt -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
+               $(TESTLIBOBJS:.cmo=.cmx)
+
+regtest: $(REGTESTOBJS) $(TEST_LIBRARIES)
+       $(OCAMLFIND) ocamlc $(OCAMLDEBUGOPTIONS) -linkpkg \
+               -package "$(TEST_REQUIRES)" -o $@ $(REGTESTOBJS)
+regtest.opt: $(REGTESTOBJS:.cmo=.cmx) $(TEST_LIBRARIES_OPT)
+       $(OCAMLOPT) opt -linkpkg -package "$(TEST_REQUIRES)" -o $@ \
+               $(REGTESTOBJS:.cmo=.cmx)
 
 .SUFFIXES: .ml .mli .cmo .cmi .cmx
 .ml.cmo:
@@ -65,16 +109,44 @@ $(TOPLEVELOBJS): $(LIBRARIES)
 $(TOPLEVELOBJS:.cmo=.cmx)): $(LIBRARIES_OPT)
 
 clean:
-       rm -f *.cm[iox] *.o gTopLevel gTopLevel.opt
-
+       rm -f *.cm[iox] *.o gTopLevel{,.opt} regtest{,.opt} testlibrary{,.opt}
 install:
        cp gTopLevel gTopLevel.opt $(BIN_DIR)
-
 uninstall:
        rm -f $(BIN_DIR)/gTopLevel $(BIN_DIR)/gTopLevel.opt
 
-.PHONY: install uninstall clean
+.PHONY: install uninstall clean test
+
+INTESTS := $(wildcard tests/*.cic)
+OUTTESTS := $(patsubst %, %.test, $(INTESTS))
+gentest: $(OUTTESTS)
+cleantest:
+       rm -f $(OUTTESTS)
+tests/%.cic.test: tests/%.cic regtest
+       time ./regtest -gen $<
+test: regtest
+       ./regtest $(INTESTS) 2> /dev/null
+envtest: regtest
+       ./regtest -dump $(INTESTS) 2> /dev/null
+librarytest: testlibrary.opt
+       ./testlibrary.opt index.txt 2>/dev/null >LOG &
+
+MAIN = ./gTopLevel
+ARGS =
+debug:
+       $(OCAMLFIND) query -recursive -predicates byte -a-format \
+               helm-cic_unification | \
+               sed 's/\(.*\)/load_printer "\1"/' \
+               > .debug_script
+       echo "install_printer CicMetaSubst.fppsubst" >> .debug_script
+       echo "install_printer CicMetaSubst.fppterm" >> .debug_script
+       echo "install_printer CicMetaSubst.fppmetasenv" >> .debug_script
+       ledit $(OCAMLDEBUG) \
+               -source .debug_script \
+               $(shell $(OCAMLFIND) query -recursive -i-format $(REQUIRES)) \
+               $(MAIN) $(ARGS)
 
 ifneq ($(MAKECMDGOALS), depend)
    include .depend   
 endif
+