MAKEFLAGS+=--no-print-directory OCAMLPATH = ../ocaml/METAS/ OCAMLFIND = OCAMLPATH=$(OCAMLPATH):$$OCAMLPATH @OCAMLFIND@ CAMLP4O = @CAMLP4O@ LABLGLADECC = @LABLGLADECC@ REQUIRES = @FINDLIB_REQUIRES@ CREQUIRES = @FINDLIB_CREQUIRES@ DEPREQUIRES = @FINDLIB_DEPREQUIRES@ CLEANREQUIRES = @FINDLIB_CLEANREQUIRES@ HAVE_OCAMLOPT = @HAVE_OCAMLOPT@ OCAML_FLAGS = -pp $(CAMLP4O) PKGS = -package "$(REQUIRES)" CPKGS = -package "$(CREQUIRES)" DEPPKGS = -package "$(DEPREQUIRES)" CLEANPKGS = -package "$(CLEANREQUIRES)" OCAML_THREADS_FLAGS = -thread OCAML_DEBUG_FLAGS = -g OCAMLC_FLAGS = $(OCAML_FLAGS) $(OCAML_THREADS_FLAGS) OCAMLC = $(OCAMLFIND) ocamlc $(OCAMLC_FLAGS) $(OCAML_DEBUG_FLAGS) OCAMLOPT = $(OCAMLFIND) opt $(OCAMLC_FLAGS) OCAMLDEP = $(OCAMLFIND) ocamldep $(OCAML_FLAGS) # objects for matita (GTK GUI) NULL = CMOS = \ buildTimeConf.cmo \ matitaLog.cmo \ matitaTypes.cmo \ matitaExcPp.cmo \ matitaMisc.cmo \ matitaDb.cmo \ matitaSync.cmo \ matitacleanLib.cmo \ matitaDisambiguator.cmo \ matitaEngine.cmo \ matitacLib.cmo \ matitamakeLib.cmo \ matitaScript.cmo \ matitaGeneratedGui.cmo \ matitaGtkMisc.cmo \ matitaMathView.cmo \ matitaGui.cmo \ $(NULL) # objects for matitac (batch compiler) CCMOS = \ buildTimeConf.cmo \ matitaLog.cmo \ matitaTypes.cmo \ matitaExcPp.cmo \ matitaMisc.cmo \ matitaDb.cmo \ matitaSync.cmo \ matitaDisambiguator.cmo \ matitacleanLib.cmo \ matitaEngine.cmo \ matitacLib.cmo \ $(NULL) CLEANCMOS = $(CCMOS) MAKECMOS = $(CCMOS) matitamakeLib.cmo all: matita.conf.xml matita matitac matitatop cicbrowser matitadep matitaclean matitamake matita.conf.xml: matita.conf.xml.sample @if diff matita.conf.xml.sample matita.conf.xml 1>/dev/null 2>/dev/null; then\ touch matita.conf.xml;\ else\ echo;\ echo "matita.conf.xml.sample is newer than matita.conf.xml";\ echo;\ echo "PLEASE update your configuration file!";\ echo "(copying matita.conf.xml.sample should work)";\ echo;\ false;\ fi matita.conf.xml.sample: matita.conf.xml.sample.in autoconf ./configure @echo @echo "WARNING: The configuration sample file has changed!" @echo ifeq ($(HAVE_OCAMLOPT),yes) CMXS = $(patsubst %.cmo,%.cmx,$(CMOS)) CCMXS = $(patsubst %.cmo,%.cmx,$(CCMOS)) CLEANCMXS = $(patsubst %.cmo,%.cmx,$(CLEANCMOS)) MAKECMXS = $(patsubst %.cmo,%.cmx,$(MAKECMOS)) LIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(REQUIRES)) LIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(REQUIRES)) CLIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(CREQUIRES)) CLIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(CREQUIRES)) DEPLIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(DEPREQUIRES)) DEPLIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(DEPREQUIRES)) CLEANLIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(CLEANREQUIRES)) CLEANLIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(CLEANREQUIRES)) MAKELIB_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "byte" -format "%d/%a" $(MAKEREQUIRES)) MAKELIBX_DEPS := $(shell $(OCAMLFIND) query -recursive -predicates "native" -format "%d/%a" $(MAKEREQUIRES)) opt: matita.opt matitac.opt cicbrowser.opt matitadep.opt matitaclean.opt matitamake.opt else opt: @echo "Native code compilation is disabled" endif matita: $(LIB_DEPS) $(CMOS) matita.ml $(OCAMLC) $(PKGS) -linkpkg -o $@ $(CMOS) matita.ml matita.opt: $(LIBX_DEPS) $(CMXS) matita.ml $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(CMXS) matita.ml matitac: $(CLIB_DEPS) $(CCMOS) matitac.ml $(OCAMLC) $(CPKGS) -linkpkg -o $@ $(CCMOS) matitac.ml matitac.opt: $(CLIBX_DEPS) $(CCMXS) matitac.ml $(OCAMLOPT) $(CPKGS) -linkpkg -o $@ $(CCMXS) matitac.ml matitatop: matitatop.ml $(CLIB_DEPS) $(CCMOS) $(OCAMLC) $(CPKGS) -linkpkg -o $@ toplevellib.cma $(CCMOS) $< matitadep: matitadep.ml $(DEPLIB_DEPS) $(CCMOS) $(OCAMLC) $(DEPPKGS) -linkpkg -o $@ $(CCMOS) $< matitadep.opt: matitadep.ml $(DEPLIB_DEPS) $(CCMXS) $(OCAMLOPT) $(DEPPKGS) -linkpkg -o $@ $(CCMXS) $< matitaclean: matitaclean.ml $(CLEANLIB_DEPS) $(CLEANCMOS) $(OCAMLC) $(CLEANPKGS) -linkpkg -o $@ $(CLEANCMOS) $< matitaclean.opt: matitaclean.ml $(CLEANLIB_DEPS) $(CLEANCMXS) $(OCAMLOPT) $(CLEANPKGS) -linkpkg -o $@ $(CLEANCMXS) $< matitamake: matitamake.ml $(MAKECMOS) $(OCAMLC) $(PKGS) -linkpkg -o $@ $(MAKECMOS) $< matitamake.opt: matitamake.ml $(MAKECMXS) $(OCAMLOPT) $(PKGS) -linkpkg -o $@ $(MAKECMXS) $< cicbrowser: matita @test -f $@ || ln -s $< $@ cicbrowser.opt: matita.opt @test -f $@ || ln -s $< $@ matitaGeneratedGui.ml matitaGeneratedGui.mli: matita.glade $(LABLGLADECC) -embed $< > matitaGeneratedGui.ml $(OCAMLC) $(PKGS) -i matitaGeneratedGui.ml > matitaGeneratedGui.mli %.cmi: %.mli $(OCAMLC) $(PKGS) -c $< %.cmo %.cmi: %.ml $(OCAMLC) $(PKGS) -c $< %.cmx: %.ml $(OCAMLOPT) $(PKGS) -c $< %.annot: %.ml $(OCAMLC) -dtypes $(PKGS) -c $< clean: rm -rf *.cma *.cmo *.cmi *.cmx *.cmxa *.a *.o \ matita matita.opt matitac matitac.opt \ cicbrowser cicbrowser.opt \ matitadep matitadep.opt \ matitaclean matitaclean.opt \ matitatop matitatop.opt distclean: clean rm -f matitaGeneratedGui.ml matitaGeneratedGui.mli rm -f config.log config.status Makefile buildTimeConf.ml rm -f matita.glade.bak matita.gladep.bak rm -rf autom4te.cache/ rm -f configure matita.conf.xml.sample tests: matitac matitadep matitaclean @(cd library && make MATITAC="- ../scripts/do_tests.sh $(DO_TESTS_OPTS) ../matitac ../matitaclean /dev/null" clean all) @(cd tests && make MATITAC="- ../scripts/do_tests.sh $(DO_TESTS_OPTS) ../matitac ../matitaclean /dev/null" clean all) tests.opt: matitac.opt matitadep.opt matitaclean.opt @(cd library && make MATITAC="- ../scripts/do_tests.sh $(DO_TESTS_OPTS) ../matitac.opt ../matitaclean.opt /dev/null" clean.opt opt) @(cd tests && make MATITAC="- ../scripts/do_tests.sh $(DO_TESTS_OPTS) ../matitac.opt ../matitaclean.opt /dev/null" clean.opt opt) cleantests: matitaclean @(cd library && make clean) @(cd tests && make clean) .PHONY: tests tests.opt cleantests tags: TAGS .PHONY: TAGS TAGS: cd ..; otags -vi -r ocaml/ matita/ #.depend: matitaGeneratedGui.ml matitaGeneratedGui.mli *.ml *.mli depend: $(OCAMLDEP) *.ml *.mli > .depend include .depend .PHONY: all opt clean distclean depend $(CMOS): $(LIB_DEPS) $(CMOS:%.cmo=%.cmx): $(LIBX_DEPS) ifeq ($(MAKECMDGOALS),all) $(CMOS:%.cmo=%.cmi): $(LIB_DEPS) endif ifeq ($(MAKECMDGOALS),) $(CMOS:%.cmo=%.cmi): $(LIB_DEPS) endif ifeq ($(MAKECMDGOALS),opt) $(CMOS:%.cmo=%.cmi): $(LIBX_DEPS) endif