####################################################################### # v # The Coq Proof Assistant / The Coq Development Team # # \ kernel/byterun/coq_jumptbl.h \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) kernel/copcodes.ml: kernel/byterun/coq_instruct.h sed -n -e '/^enum/p' -e 's/,//g' -e '/^ /p' \ kernel/byterun/coq_instruct.h | \ awk -f kernel/make-opcodes > kernel/copcodes.ml \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) ########################################################################### # Main targets (coqmktop, coqtop.opt, coqtop.byte) ########################################################################### coqbinaries:: ${COQBINARIES} ${CSDPCERT} $(INITPLUGINSOPT) $(INITPLUGINS) coq: coqlib tools coqbinaries coqlib:: initplugins theories contrib coqlight: theories-light tools coqbinaries states:: states/initial.coq initplugins: $(INITPLUGINSOPT) $(INITPLUGINS) $(COQTOPOPT): $(COQMKTOP) $(LINKCMX) $(LIBCOQRUN) $(SHOW)'COQMKTOP -o $@' $(HIDE)$(COQMKTOP) -boot -opt $(OPTFLAGS) -o $@ $(STRIP) $@ $(COQTOPBYTE): $(COQMKTOP) $(LINKCMO) $(LIBCOQRUN) $(SHOW)'COQMKTOP -o $@' $(HIDE)$(COQMKTOP) -boot -top $(BYTEFLAGS) -o $@ $(COQTOPEXE): $(ORDER_ONLY_SEP) $(BESTCOQTOP) cd bin; ln -sf coqtop.$(BEST)$(EXE) coqtop$(EXE) LOCALCHKLIBS:=-I checker -I lib -I config -I kernel CHKLIBS:=$(LOCALCHKLIBS) -I $(MYCAMLP4LIB) CHKBYTEFLAGS:=$(CHKLIBS) $(CAMLDEBUG) $(USERFLAGS) CHKOPTFLAGS:=$(CHKLIBS) $(CAMLDEBUGOPT) $(CAMLTIMEPROF) $(USERFLAGS) $(CHICKENOPT): checker/check.cmxa checker/main.ml $(SHOW)'OCAMLOPT -o $@' $(HIDE)$(OCAMLOPT) $(CHKOPTFLAGS) -o $@ str.cmxa unix.cmxa gramlib.cmxa $^ $(STRIP) $@ $(CHICKENBYTE): checker/check.cma checker/main.ml $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(CHKBYTEFLAGS) -o $@ str.cma unix.cma gramlib.cma $^ $(CHICKEN): $(ORDER_ONLY_SEP) $(BESTCHICKEN) cd bin && ln -sf coqchk.$(BEST)$(EXE) coqchk$(EXE) # coqmktop $(COQMKTOPBYTE): $(COQMKTOPCMO) $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ str.cma unix.cma gramlib.cma\ $^ $(OSDEPLIBS) $(COQMKTOPOPT): $(COQMKTOPCMX) $(SHOW)'OCAMLOPT -o $@' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -o $@ str.cmxa unix.cmxa gramlib.cmxa\ $^ $(OSDEPLIBS) $(STRIP) $@ $(COQMKTOP): $(ORDER_ONLY_SEP) $(BESTCOQMKTOP) cd bin; ln -sf coqmktop.$(BEST)$(EXE) coqmktop$(EXE) scripts/tolink.ml: Makefile.build Makefile.common $(SHOW)"ECHO... >" $@ $(HIDE)echo "let copts = \"-cclib -lcoqrun\"" > $@ $(HIDE)echo "let core_libs = \""$(LINKCMO)"\"" >> $@ $(HIDE)echo "let core_objs = \""$(OBJSCMO)"\"" >> $@ $(HIDE)echo "let ide = \""$(COQIDECMO)"\"" >> $@ # coqc $(COQCBYTE): $(COQCCMO) $(COQTOPBYTE) $(BESTCOQTOP) $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ str.cma unix.cma gramlib.cma $(COQCCMO) $(OSDEPLIBS) $(COQCOPT): $(COQCCMX) $(COQTOPOPT) $(BESTCOQTOP) $(SHOW)'OCAMLOPT -o $@' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -o $@ str.cmxa unix.cmxa gramlib.cmxa $(COQCCMX) $(OSDEPLIBS) $(STRIP) $@ $(COQC): $(ORDER_ONLY_SEP) $(BESTCOQC) cd bin; ln -sf coqc.$(BEST)$(EXE) coqc$(EXE) # we provide targets for each subdirectory lib: $(LIBREP) kernel: $(KERNEL) byterun: $(BYTERUN) library: $(LIBRARY) proofs: $(PROOFS) tactics: $(TACTICS) interp: $(INTERP) parsing: $(PARSING) pretyping: $(PRETYPING) highparsing: $(HIGHPARSING) toplevel: $(TOPLEVEL) hightactics: $(HIGHTACTICS) # target for libraries lib/lib.cma: $(LIBREP) lib/lib.cmxa: $(LIBREP:.cmo=.cmx) kernel/kernel.cma: $(KERNEL) kernel/kernel.cmxa: $(KERNEL:.cmo=.cmx) library/library.cma: $(LIBRARY) library/library.cmxa: $(LIBRARY:.cmo=.cmx) pretyping/pretyping.cma: $(PRETYPING) pretyping/pretyping.cmxa: $(PRETYPING:.cmo=.cmx) interp/interp.cma: $(INTERP) interp/interp.cmxa: $(INTERP:.cmo=.cmx) parsing/parsing.cma: $(PARSING) parsing/parsing.cmxa: $(PARSING:.cmo=.cmx) proofs/proofs.cma: $(PROOFS) proofs/proofs.cmxa: $(PROOFS:.cmo=.cmx) tactics/tactics.cma: $(TACTICS) tactics/tactics.cmxa: $(TACTICS:.cmo=.cmx) toplevel/toplevel.cma: $(TOPLEVEL) toplevel/toplevel.cmxa: $(TOPLEVEL:.cmo=.cmx) parsing/highparsing.cma: $(HIGHPARSING) parsing/highparsing.cmxa: $(HIGHPARSING:.cmo=.cmx) tactics/hightactics.cma: $(HIGHTACTICS) tactics/hightactics.cmxa: $(HIGHTACTICS:.cmo=.cmx) contrib/contrib.cma: $(CONTRIBSTATIC) contrib/contrib.cmxa: $(CONTRIBSTATIC:.cmo=.cmx) $(OMEGACMA): $(OMEGACMO) $(OMEGACMA:.cma=.cmxa): $(OMEGACMO:.cmo=.cmx) $(ROMEGACMA): $(ROMEGACMO) $(ROMEGACMA:.cma=.cmxa): $(ROMEGACMO:.cmo=.cmx) $(MICROMEGACMA): $(MICROMEGACMO) $(MICROMEGACMA:.cma=.cmxa): $(MICROMEGACMO:.cmo=.cmx) $(QUOTECMA): $(QUOTECMO) $(QUOTECMA:.cma=.cmxa): $(QUOTECMO:.cmo=.cmx) $(RINGCMA): $(RINGCMO) $(RINGCMA:.cma=.cmxa): $(RINGCMO:.cmo=.cmx) $(NEWRINGCMA): $(NEWRINGCMO) $(NEWRINGCMA:.cma=.cmxa): $(NEWRINGCMO:.cmo=.cmx) $(FIELDCMA): $(FIELDCMO) $(FIELDCMA:.cma=.cmxa): $(FIELDCMO:.cmo=.cmx) $(XMLCMA): $(XMLCMO) $(XMLCMA:.cma=.cmxa): $(XMLCMO:.cmo=.cmx) $(FOURIERCMA): $(FOURIERCMO) $(FOURIERCMA:.cma=.cmxa): $(FOURIERCMO:.cmo=.cmx) $(EXTRACTIONCMA): $(EXTRACTIONCMO) $(EXTRACTIONCMA:.cma=.cmxa): $(EXTRACTIONCMO:.cmo=.cmx) $(RTAUTOCMA): $(RTAUTOCMO) $(RTAUTOCMA:.cma=.cmxa): $(RTAUTOCMO:.cmo=.cmx) $(FOCMA): $(FOCMO) $(FOCMA:.cma=.cmxa): $(FOCMO:.cmo=.cmx) $(CCCMA): $(CCCMO) $(CCCMA:.cma=.cmxa): $(CCCMO:.cmo=.cmx) $(DPCMA): $(DPCMO) $(DPCMA:.cma=.cmxa): $(DPCMO:.cmo=.cmx) $(FUNINDCMA): $(FUNINDCMO) $(FUNINDCMA:.cma=.cmxa): $(FUNINDCMO:.cmo=.cmx) $(SUBTACCMA): $(SUBTACCMO) $(SUBTACCMA:.cma=.cmxa): $(SUBTACCMO:.cmo=.cmx) %.cma: $(SHOW)'OCAMLC -a -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -a -o $@ $^ %.cmxa: $(SHOW)'OCAMLOPT -a -o $@' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -a -o $@ $^ # For the checker, different flags may be used checker/check.cma: $(MCHECKER) $(SHOW)'OCAMLC -a -o $@' $(HIDE)$(OCAMLC) $(CHKBYTEFLAGS) -a -o $@ $^ checker/check.cmxa: $(MCHECKER:.cmo=.cmx) $(SHOW)'OCAMLOPT -a -o $@' $(HIDE)$(OCAMLOPT) $(CHKOPTFLAGS) -a -o $@ $^ ########################################################################### # Csdp to micromega special targets ########################################################################### ifeq ($(BEST),opt) contrib/micromega/csdpcert$(EXE): $(CSDPCERTCMX) $(SHOW)'OCAMLOPT -o $@' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) nums.cmxa -o $@ $^ $(STRIP) $@ else contrib/micromega/csdpcert$(EXE): $(CSDPCERTCMO) $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) nums.cma -o $@ $^ endif ########################################################################### # CoqIde special targets ########################################################################### # target to build CoqIde coqide:: coqide-files coqide-binaries states COQIDEFLAGS=-thread $(COQIDEINCLUDES) .SUFFIXES:.vo IDEFILES=ide/coq.png ide/.coqide-gtk2rc coqide-binaries: coqide-$(HASCOQIDE) coqide-no: coqide-byte: $(COQIDEBYTE) $(COQIDE) coqide-opt: $(COQIDEBYTE) $(COQIDEOPT) $(COQIDE) coqide-files: $(IDEFILES) $(COQIDEOPT): $(COQMKTOP) $(LINKCMX) $(LIBCOQRUN) ide/ide.cmxa $(SHOW)'COQMKTOP -o $@' $(HIDE)$(COQMKTOP) -boot -ide -opt $(OPTFLAGS) -o $@ $(STRIP) $@ $(COQIDEBYTE): $(COQMKTOP) $(LINKCMO) $(LIBCOQRUN) ide/ide.cma $(SHOW)'COQMKTOP -o $@' $(HIDE)$(COQMKTOP) -boot -g -ide -top $(BYTEFLAGS) -o $@ $(COQIDE): cd bin; ln -sf coqide.$(HASCOQIDE)$(EXE) coqide$(EXE) ide/%.cmo: ide/%.ml | ide/%.ml.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) -g $(COQIDEFLAGS) $(BYTEFLAGS) -c $< ide/%.cmi: ide/%.mli | ide/%.mli.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) -g $(COQIDEFLAGS) $(BYTEFLAGS) -c $< ide/%.cmx: ide/%.ml | ide/%.ml.d $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) $(COQIDEFLAGS) $(OPTFLAGS) -c $< ide/ide.cma: $(COQIDECMO) $(SHOW)'OCAMLC -a -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -a -o $@ $^ ide/ide.cmxa: $(COQIDECMO:.cmo=.cmx) $(SHOW)'OCAMLOPT -a -o $@' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -a -o $@ $^ # install targets FULLIDELIB=$(FULLCOQLIB)/ide install-coqide:: install-ide-$(HASCOQIDE) install-ide-files install-ide-info install-ide-no: install-ide-byte: $(MKDIR) $(FULLBINDIR) $(INSTALLBIN) $(COQIDEBYTE) $(FULLBINDIR) cd $(FULLBINDIR); ln -sf coqide.byte$(EXE) coqide$(EXE) install-ide-opt: $(MKDIR) $(FULLBINDIR) $(INSTALLBIN) $(COQIDEBYTE) $(COQIDEOPT) $(FULLBINDIR) cd $(FULLBINDIR); ln -sf coqide.opt$(EXE) coqide$(EXE) install-ide-files: $(MKDIR) $(FULLIDELIB) $(INSTALLLIB) $(IDEFILES) $(FULLIDELIB) install-ide-info: $(MKDIR) $(FULLIDELIB) $(INSTALLLIB) ide/FAQ $(FULLIDELIB) ########################################################################### # Pcoq: special binaries for debugging (coq-interface, coq-parser) ########################################################################### # target to build Pcoq pcoq: pcoq-binaries pcoq-files pcoq-binaries:: $(COQINTERFACE) bin/coq-interface$(EXE): $(COQMKTOP) $(LINKCMO) $(LIBCOQRUN) $(INTERFACE) $(SHOW)'COQMKTOP -o $@' $(HIDE)$(COQMKTOP) -boot -top $(BYTEFLAGS) -o $@ $(INTERFACE) bin/coq-interface.opt$(EXE): $(COQMKTOP) $(LINKCMX) $(LIBCOQRUN) $(INTERFACECMX) $(SHOW)'COQMKTOP -o $@' $(HIDE)$(COQMKTOP) -boot -opt $(OPTFLAGS) -o $@ $(INTERFACECMX) bin/coq-parser$(EXE):$(LIBCOQRUN) $(PARSERCMO) $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(COQRUNBYTEFLAGS) -linkall $(BYTEFLAGS) -o $@ \ dynlink.cma str.cma nums.cma $(LIBCOQRUN) $(CMA) $(PARSERCMO) bin/coq-parser.opt$(EXE): $(LIBCOQRUN) $(PARSERCMX) $(SHOW)'OCAMLOPT -o $@' $(HIDE)$(OCAMLOPT) -linkall $(OPTFLAGS) -o $@ \ $(LIBCOQRUN) $(DYNLINKCMXA) str.cmxa nums.cmxa $(CMXA) $(PARSERCMX) pcoq-files:: $(INTERFACEVO) $(INTERFACERC) # install targets install-pcoq:: install-pcoq-binaries install-pcoq-files install-pcoq-manpages install-pcoq-binaries:: $(MKDIR) $(FULLBINDIR) $(INSTALLBIN) $(COQINTERFACE) $(FULLBINDIR) install-pcoq-files:: $(MKDIR) $(FULLCOQLIB)/contrib/interface $(INSTALLLIB) $(INTERFACERC) $(FULLCOQLIB)/contrib/interface install-pcoq-manpages: $(MKDIR) $(FULLMANDIR)/man1 $(INSTALLLIB) $(PCOQMANPAGES) $(FULLMANDIR)/man1 ########################################################################### # tests ########################################################################### validate:: $(BESTCHICKEN) $(ALLVO) $(SHOW)'COQCHK ' $(HIDE)$(BESTCHICKEN) -boot -o -m $(ALLMODS) check:: world cd test-suite; \ env COQBIN=../bin COQLIB=.. ./check -$(BEST) | tee check.log if grep -F 'Error!' test-suite/check.log ; then false; fi ########################################################################### # theories and contrib files ########################################################################### init: $(INITVO) theories: $(THEORIESVO) theories-light: $(THEORIESLIGHTVO) logic: $(LOGICVO) arith: $(ARITHVO) bool: $(BOOLVO) narith: $(NARITHVO) zarith: $(ZARITHVO) qarith: $(QARITHVO) lists: $(LISTSVO) strings: $(STRINGSVO) sets: $(SETSVO) fsets: $(FSETSVO) allfsets: $(ALLFSETS) relations: $(RELATIONSVO) wellfounded: $(WELLFOUNDEDVO) # reals reals: $(REALSVO) allreals: $(ALLREALS) setoids: $(SETOIDSVO) sorting: $(SORTINGVO) # numbers natural: $(NATURALVO) integer: $(INTEGERVO) rational: $(RATIONALVO) numbers: $(NUMBERSVO) noreal: logic arith bool zarith qarith lists sets fsets relations \ wellfounded setoids sorting ########################################################################### # contribs (interface not included) ########################################################################### contrib: $(CONTRIBVO) omega: $(OMEGAVO) $(OMEGACMO) $(ROMEGAVO) $(ROMEGACMO) micromega: $(MICROMEGAVO) $(MICROMEGACMO) $(CSDPCERT) ring: $(RINGVO) $(RINGCMO) setoid_ring: $(NEWRINGVO) $(NEWRINGCMO) dp: $(DPCMO) xml: $(XMLVO) $(XMLCMO) extraction: $(EXTRACTIONCMO) field: $(FIELDVO) $(FIELDCMO) fourier: $(FOURIERVO) $(FOURIERCMO) funind: $(FUNINDCMO) $(FUNINDVO) cc: $(CCVO) $(CCCMO) programs subtac: $(SUBTACVO) $(SUBTACCMO) rtauto: $(RTAUTOVO) $(RTAUTOCMO) ########################################################################### # rules to make theories, contrib and states ########################################################################### states/initial.coq: states/MakeInitial.v $(INITVO) $(VO_TOOLS_STRICT) | states/MakeInitial.v.d $(VO_TOOLS_ORDER_ONLY) $(SHOW)'BUILD $@' $(HIDE)$(BOOTCOQTOP) -batch -notop -silent -nois -load-vernac-source states/MakeInitial.v -outputstate states/initial.coq theories/Init/%.vo theories/Init/%.glob: theories/Init/%.v $(INITPLUGINSBEST) $(VO_TOOLS_STRICT) | theories/Init/%.v.d $(VO_TOOLS_ORDER_ONLY) $(SHOW)'COQC -nois $<' $(HIDE)rm -f theories/Init/$*.glob $(HIDE)$(BOOTCOQTOP) -nois -compile theories/Init/$* theories/Numbers/Natural/BigN/NMake.v: theories/Numbers/Natural/BigN/NMake_gen.ml $(OCAML) $< > $@ ########################################################################### # tools ########################################################################### printers: $(DEBUGPRINTERS) tools:: $(TOOLS) $(DEBUGPRINTERS) $(COQDEP): $(COQDEPCMO) $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ str.cma unix.cma gramlib.cma $^ $(OSDEPLIBS) $(GALLINA): $(GALLINACMO) $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ $^ $(COQMAKEFILE): config/coq_config.cmo tools/coq_makefile.cmo $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ str.cma $^ $(COQTEX): tools/coq-tex.cmo $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ str.cma $^ $(COQWC): tools/coqwc.cmo $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ $^ $(COQDOC): $(COQDOCCMO) $(SHOW)'OCAMLC -o $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -o $@ str.cma unix.cma $^ ########################################################################### # Installation ########################################################################### #These variables are intended to be set by the caller to make #COQINSTALLPREFIX= #OLDROOT= # Can be changed for a local installation (to make packages). # You must NOT put a "/" at the end (Cygnus for win32 does not like "//"). FULLBINDIR=$(BINDIR:"$(OLDROOT)%="$(COQINSTALLPREFIX)%) FULLCOQLIB=$(COQLIBINSTALL:"$(OLDROOT)%="$(COQINSTALLPREFIX)%) FULLMANDIR=$(MANDIR:"$(OLDROOT)%="$(COQINSTALLPREFIX)%) FULLEMACSLIB=$(EMACSLIB:"$(OLDROOT)%="$(COQINSTALLPREFIX)%) FULLCOQDOCDIR=$(COQDOCDIR:"$(OLDROOT)%="$(COQINSTALLPREFIX)%) FULLDOCDIR=$(DOCDIR:"$(OLDROOT)%="$(COQINSTALLPREFIX)%) install-coq: install-binaries install-library install-coq-info install-coqlight: install-binaries install-library-light install-binaries:: install-$(BEST) install-tools install-byte:: $(MKDIR) $(FULLBINDIR) $(INSTALLBIN) $(COQMKTOP) $(COQC) $(COQTOPBYTE) $(FULLBINDIR) cd $(FULLBINDIR); ln -sf coqtop.byte$(EXE) coqtop$(EXE) install-opt:: $(MKDIR) $(FULLBINDIR) $(INSTALLBIN) $(COQMKTOP) $(COQC) $(COQTOPBYTE) $(COQTOPOPT) $(FULLBINDIR) cd $(FULLBINDIR); ln -sf coqtop.opt$(EXE) coqtop$(EXE) install-tools:: $(MKDIR) $(FULLBINDIR) # recopie des fichiers de style pour coqide $(MKDIR) $(FULLCOQLIB)/tools/coqdoc touch $(FULLCOQLIB)/tools/coqdoc/coqdoc.sty $(FULLCOQLIB)/tools/coqdoc/coqdoc.css # to have the mode according to umask (bug #1715) $(INSTALLLIB) tools/coqdoc/coqdoc.css tools/coqdoc/coqdoc.sty $(FULLCOQLIB)/tools/coqdoc $(INSTALLBIN) $(TOOLS) $(FULLBINDIR) install-library: $(MKDIR) $(FULLCOQLIB) for f in $(LIBFILES); do \ $(MKDIR) $(FULLCOQLIB)/`dirname $$f`; \ $(INSTALLLIB) $$f $(FULLCOQLIB)/`dirname $$f`; \ done $(MKDIR) $(FULLCOQLIB)/states $(INSTALLLIB) states/*.coq $(FULLCOQLIB)/states $(MKDIR) $(FULLCOQLIB)/user-contrib $(INSTALLLIB) $(DLLCOQRUN) $(FULLCOQLIB) cp --parents $(CONFIG) $(LINKCMO) $(GRAMMARCMA) $(FULLCOQLIB) cp --parents $(OBJSCMO:.cmo=.cmi) $(FULLCOQLIB) ifeq ($(BEST),opt) $(INSTALLLIB) $(LIBCOQRUN) $(FULLCOQLIB) cp --parents $(CONFIG:.cmo=.cmx) $(CONFIG:.cmo=.o) $(LINKCMO:.cma=.cmxa) $(LINKCMO:.cma=.a) $(FULLCOQLIB) endif # csdpcert is not meant to be directly called by the user; we install # it with libraries -$(MKDIR) -p $(FULLCOQLIB)/contrib/micromega $(INSTALLBIN) $(CSDPCERT) $(FULLCOQLIB)/contrib/micromega install-library-light: $(MKDIR) $(FULLCOQLIB) for f in $(LIBFILESLIGHT); do \ $(MKDIR) $(FULLCOQLIB)/`dirname $$f`; \ $(INSTALLLIB) $$f $(FULLCOQLIB)/`dirname $$f`; \ done $(MKDIR) $(FULLCOQLIB)/states $(INSTALLLIB) states/*.coq $(FULLCOQLIB)/states install-allreals:: for f in $(ALLREALS); do \ $(MKDIR) $(FULLCOQLIB)/`dirname $$f`; \ $(INSTALLLIB) $$f $(FULLCOQLIB)/`dirname $$f`; \ done install-coq-info: install-coq-manpages install-emacs install-latex install-coq-manpages: $(MKDIR) $(FULLMANDIR)/man1 $(INSTALLLIB) $(MANPAGES) $(FULLMANDIR)/man1 install-emacs: $(MKDIR) $(FULLEMACSLIB) $(INSTALLLIB) tools/coq.el tools/coq-inferior.el $(FULLEMACSLIB) # command to update TeX' kpathsea database #UPDATETEX = $(MKTEXLSR) /usr/share/texmf /var/spool/texmf $(BASETEXDIR) > /dev/null install-latex: $(MKDIR) $(FULLCOQDOCDIR) $(INSTALLLIB) tools/coqdoc/coqdoc.sty $(FULLCOQDOCDIR) # -$(UPDATETEX) ########################################################################### # Documentation of the source code (using ocamldoc) ########################################################################### .PHONY: source-doc source-doc: if !(test -d $(SOURCEDOCDIR)); then mkdir $(SOURCEDOCDIR); fi $(OCAMLDOC) -html -rectypes $(LOCALINCLUDES) -d $(SOURCEDOCDIR) \ `find . $(FIND_VCS_CLAUSE) -name "*.ml"` ########################################################################### ### Special rules ########################################################################### dev/printers.cma: $(PRINTERSCMO) $(SHOW)'Testing $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) gramlib.cma $(PRINTERSCMO) -o test-printer @rm -f test-printer $(SHOW)'OCAMLC -a $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) $^ -linkall -a -o $@ parsing/grammar.cma: $(GRAMMARCMO) $(SHOW)'Testing $@' @touch test.ml4 $(HIDE)$(OCAMLC) $(BYTEFLAGS) -pp "$(CAMLP4O) $(CAMLP4EXTENDFLAGS) $(GRAMMARCMO) -impl" -impl test.ml4 -o test-grammar @rm -f test-grammar test.* $(SHOW)'OCAMLC -a $@' $(HIDE)$(OCAMLC) $(BYTEFLAGS) $(GRAMMARCMO) -linkall -a -o $@ # toplevel/mltop.ml4 (ifdef Byte) toplevel/mltop.cmo: toplevel/mltop.byteml | toplevel/mltop.ml4.ml.d toplevel/mltop.ml4.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -c -impl $< -o $@ toplevel/mltop.cmx: toplevel/mltop.optml | toplevel/mltop.ml4.ml.d toplevel/mltop.ml4.d $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -c -impl $< -o $@ ## This works dependency-wise because the dependencies of the ## .{opt,byte}ml files are those we deduce from the .ml4 file. ## In other words, the Byte-only code doesn't import a new module. toplevel/mltop.byteml: toplevel/mltop.ml4 config/Makefile # no camlp4deps here $(SHOW)'CAMLP4O $<' $(HIDE)$(CAMLP4O) $(CAMLP4EXTENDFLAGS) pr_o.cmo `$(CAMLP4USE) $<` \ -DByte -DHasDynlink -impl $< > $@ \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) toplevel/mltop.optml: toplevel/mltop.ml4 config/Makefile # no camlp4deps here $(SHOW)'CAMLP4O $<' $(HIDE)$(CAMLP4O) $(CAMLP4EXTENDFLAGS) pr_o.cmo `$(CAMLP4USE) $<` \ $(NATDYNLINKDEF) -impl $< > $@ \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) # files compiled with -rectypes define rectypes-rules-template $(1:.ml=.cmo): $(1) | $(1).d $(SHOW)'OCAMLC -rectypes $$<' $(HIDE)$(OCAMLC) -rectypes $(BYTEFLAGS) -c $$< $(1:.ml=.cmx): $(1) | $(1).d $(SHOW)'OCAMLOPT -rectypes $$<' $(HIDE)$(OCAMLOPT) -rectypes $(OPTFLAGS) -c $$< endef $(foreach f,$(RECTYPESML),$(eval $(call rectypes-rules-template,$(f)))) # pretty printing of the revision number when compiling a checked out # source tree .PHONY: revision revision config/revision.ml: $(SHOW)'CHECK revision' $(HIDE)rm -f revision.new ifeq ($(CHECKEDOUT),svn) $(HIDE)set -e; \ if test -x "`which svn`"; then \ export LC_ALL=C;\ svn info . | sed -ne '/URL/s/.*\/\([^\/]\{1,\}\)/let version = "\1"/p' > revision.new; \ svn info . | sed -ne '/Revision/s/Revision: \([0-9]\{1,\}\)/let revision = "\1"/p'>> revision.new; \ fi endif ifeq ($(CHECKEDOUT),gnuarch) $(HIDE)set -e; \ if test -x "`which tla`"; then \ LANG=C; export LANG; \ tla tree-version | sed -e 's/\(.*\)/let version = "\1"/' > revision.new ; \ tla tree-revision | sed -ne 's|.*--\(.*\)|let revision = \"\1\"|p' >> revision.new ; \ fi endif ifeq ($(CHECKEDOUT),git) $(HIDE)set -e; \ if test -x "`which git`"; then \ LANG=C; export LANG; \ GIT_BRANCH=$$(git branch -a | sed -ne 's/^\* //p'); \ GIT_HOST=$$(hostname --fqdn); \ GIT_PATH=$$(pwd); \ echo "let version = \"$${GIT_HOST}:$${GIT_PATH},$${GIT_BRANCH}\"" > revision.new; \ echo "let revision = \"$$(git show-ref $${GIT_BRANCH}|sed -ne 's/ .*//p')\"" >> revision.new; \ fi endif $(HIDE)set -e; \ if test ! -e revision.new; then \ echo 'let version = Coq_config.version' > revision.new; \ echo 'let revision = Coq_config.date' >> revision.new; \ fi; \ echo 'let date = "$(shell date +"%h %d %Y %H:%M:%S")"' >> revision.new ; \ if test -e config/revision.ml; then \ if test "`head -2 config/revision.ml`" = "`head -2 revision.new`" ; then \ rm -f revision.new; \ else \ mv -f revision.new config/revision.ml; \ fi; \ else \ mv -f revision.new config/revision.ml; \ fi ########################################################################### # Default rules ########################################################################### checker/%.cmo: checker/%.ml | checker/%.ml.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) -c $(CHKBYTEFLAGS) $< checker/%.cmx: checker/%.ml | checker/%.ml.d $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) -c $(CHKOPTFLAGS) $< checker/%.cmi: checker/%.mli | checker/%.mli.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) -c $(CHKBYTEFLAGS) $< %.o: %.c $(SHOW)'OCAMLC $<' $(HIDE)cd $(dir $<) && $(OCAMLC) -ccopt "$(CFLAGS)" -c $(notdir $<) ifdef KEEP_ML4_PREPROCESSED .PRECIOUS: %.ml4-preprocessed %.cmo: %.ml4-preprocessed | %.ml4.ml.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -c -impl $< %.cmx: %.ml4-preprocessed | %.ml4.ml.d $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -c -impl $< else %.cmo: %.ml4 | %.ml4.ml.d %.ml4.d $(SHOW)'OCAMLC4 $<' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -pp "$(CAMLP4O) $(CAMLP4EXTENDFLAGS) `$(CAMLP4USE) $<` `$(CAMLP4DEPS) $<` $(CAMLP4COMPAT) -impl" -c -impl $< %.cmx: %.ml4 | %.ml4.ml.d %.ml4.d $(SHOW)'OCAMLOPT4 $<' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -pp "$(CAMLP4O) $(CAMLP4EXTENDFLAGS) `$(CAMLP4USE) $<` `$(CAMLP4DEPS) $<` $(CAMLP4COMPAT) -impl" -c -impl $< endif %.cmo: %.ml | %.ml.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -c $< %.cmi: %.mli | %.mli.d $(SHOW)'OCAMLC $<' $(HIDE)$(OCAMLC) $(BYTEFLAGS) -c $< %.cmx: %.ml | %.ml.d $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) $(OPTFLAGS) -c $< %.cmxs: %.cmxa $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) -linkall -shared -o $@ $< %.cmxs: %.cmx $(SHOW)'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) -shared -o $@ $< %.ml: %.mll $(SHOW)'OCAMLLEX $<' $(HIDE)$(OCAMLLEX) -o $@ "$*.mll" %.ml %.mli: %.mly $(SHOW)'OCAMLYACC $<' $(HIDE)$(OCAMLYACC) $< %.ml4-preprocessed: %.ml4 | %.ml4.d $(SHOW)'CAMLP4O $<' $(HIDE)$(CAMLP4O) $(CAMLP4EXTENDFLAGS) pr_o.cmo `$(CAMLP4USE) $<` `$(CAMLP4DEPS) $<` $(CAMLP4COMPAT) -impl $< > $@ \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) %.vo %.glob: %.v states/initial.coq $(VO_TOOLS_STRICT) | %.v.d $(VO_TOOLS_ORDER_ONLY) $(SHOW)'COQC $<' $(HIDE)rm -f $*.glob $(HIDE)$(BOOTCOQTOP) -compile $* ifdef VALIDATE $(SHOW)'COQCHK $(call vo_to_mod,$@)' $(HIDE)$(BESTCHICKEN) -boot -silent -norec $(call vo_to_mod,$@) \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) endif ########################################################################### # Dependencies ########################################################################### # .ml4.d contains the dependencies to generate the .ml from the .ml4 # NOT to generate object code. ifdef NO_RECOMPILE_ML4 SEP:=$(ORDER_ONLY_SEP) else SEP:= endif %.ml4.d: $(D_DEPEND_BEFORE_SRC) %.ml4 $(SHOW)'CAMLP4DEPS $<' $(HIDE)( /bin/echo -n '$*.cmo $*.cmx $*.ml4.ml.d $*.ml4-preprocessed: $(SEP)' && $(CAMLP4DEPS) "$<" ) > "$@" \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) %.ml4.ml.d: $(D_DEPEND_BEFORE_SRC) %.ml4 $(D_DEPEND_AFTER_SRC) $(GENFILES) $(ML4FILES:.ml4=.ml) %.ml4.d #Critical section: # Nobody (in a make -j) should touch the .ml file here. $(SHOW)'OCAMLDEP4 $<' $(HIDE)$(CAMLP4O) $(CAMLP4EXTENDFLAGS) pr_o.cmo `$(CAMLP4USE) $<` `$(CAMLP4DEPS) $<` $(CAMLP4COMPAT) -impl $< -o $*.ml \ || ( RV=$$?; rm -f "$*.ml"; exit $${RV} ) $(HIDE)$(OCAMLDEP) $(DEPFLAGS) $*.ml | sed '' > "$@" || ( RV=$$?; rm -f "$@"; exit $${RV} ) $(HIDE)echo "let keep_ocamldep_happy Do_not_compile_me = assert false" > $*.ml #End critical section checker/%.ml.d: $(D_DEPEND_BEFORE_SRC) checker/%.ml $(D_DEPEND_AFTER_SRC) $(SHOW)'OCAMLDEP $<' $(HIDE)$(OCAMLDEP) -slash $(LOCALCHKLIBS) "$<" | sed '' > "$@" checker/%.mli.d: $(D_DEPEND_BEFORE_SRC) checker/%.mli $(D_DEPEND_AFTER_SRC) $(SHOW)'OCAMLDEP $<' $(HIDE)$(OCAMLDEP) -slash $(LOCALCHKLIBS) "$<" | sed '' > "$@" %.ml.d: $(D_DEPEND_BEFORE_SRC) %.ml $(D_DEPEND_AFTER_SRC) $(GENFILES) $(ML4FILES:.ml4=.ml) $(SHOW)'OCAMLDEP $<' $(HIDE)$(OCAMLDEP) $(DEPFLAGS) "$<" | sed '' > "$@" %.mli.d: $(D_DEPEND_BEFORE_SRC) %.mli $(D_DEPEND_AFTER_SRC) $(GENFILES) $(ML4FILES:.ml4=.ml) $(SHOW)'OCAMLDEP $<' $(HIDE)$(OCAMLDEP) $(DEPFLAGS) "$<" | sed '' > "$@" ## Veerry nasty hack to keep ocamldep happy %.ml: | %.ml4 $(SHOW)'TOUCH $@' $(HIDE)echo "let keep_ocamldep_happy Do_not_compile_me = assert false" > $@ \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) %.v.d: $(D_DEPEND_BEFORE_SRC) %.v $(D_DEPEND_AFTER_SRC) $(COQDEP) $(GENVFILES) $(SHOW)'COQDEP $<' $(HIDE)$(COQDEP) -glob -slash -boot $(COQINCLUDES) "$<" > "$@" \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) %.c.d: $(D_DEPEND_BEFORE_SRC) %.c $(D_DEPEND_AFTER_SRC) $(GENHFILES) $(SHOW)'CCDEP $<' $(HIDE)$(CC) -MM -MQ "$@" -MQ "$(<:.c=.o)" $(CFLAGS) -isystem $(CAMLHLIB) $< > $@ \ || ( RV=$$?; rm -f "$@"; exit $${RV} ) .SECONDARY: $(GENFILES) ########################################################################### # this sets up developper supporting stuff ########################################################################### .PHONY: devel devel: $(DEBUGPRINTERS) ########################################################################### %.dot: %.mli $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $< %.types.dot: %.mli $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -dot-types -o $@ $< %.dep.ps: %.dot $(DOT) $(DOTOPTS) -o $@ $< kernel/kernel.dot: $(KERNEL) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(KERNEL:.cmo=.ml)) interp/interp.dot: $(INTERP) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(INTERP:.cmo=.ml)) pretyping/pretyping.dot: $(PRETYPING) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(PRETYPING:.cmo=.ml)) library/library.dot: $(LIBRARY) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(LIBRARY:.cmo=.ml)) parsing/parsing.dot: $(PARSING) $(HIGHPARSING) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(PARSING:.cmo=.ml)) $(wildcard $(HIGHPARSING:.cmo=.ml)) tactics/tactics.dot: $(TACTICS) $(HIGHTACTICS) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(TACTICS:.cmo=.ml)) $(wildcard $(HIGHTACTICS:.cmo=.ml)) proofs/proofs.dot: $(PROOFS) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(PROOFS:.cmo=.ml)) toplevel/toplevel.dot: $(TOPLEVEL) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(TOPLEVEL:.cmo=.ml)) COQCMO:=$(LIBREP) $(KERNEL) $(INTERP) $(PRETYPING) $(LIBRARY) $(PARSING) $(HIGHPARSING) $(TACTICS) $(HIGHTACTICS) $(PROOFS) $(TOPLEVEL) coq.dot: $(COQCMO) $(OCAMLDOC) -rectypes $(MLINCLUDES) $(ODOCDOTOPTS) -o $@ $(wildcard $(COQCMO:.cmo=.ml)) # For emacs: # Local Variables: # mode: makefile # End: