####################################################################### # v # The Coq Proof Assistant / The Coq Development Team # # $@ echo "let kernel = \""$(KERNEL)"\"" >> $@ echo "let library = \""$(LIBRARY)"\"" >> $@ echo "let pretyping = \""$(PRETYPING)"\"" >> $@ echo "let proofs = \""$(PROOFS)"\"" >> $@ echo "let tactics = \""$(TACTICS)"\"" >> $@ echo "let interp = \""$(INTERP)"\"" >> $@ echo "let parsing = \""$(PARSING)"\"" >> $@ echo "let toplevel = \""$(TOPLEVEL)"\"" >> $@ echo "let highparsing = \""$(HIGHPARSING)"\"" >> $@ echo "let hightactics = \""$(HIGHTACTICS)" "$(USERTACCMO)"\"" >> $@ echo "let contrib = \""$(CONTRIB)"\"" >> $@ beforedepend:: scripts/tolink.ml # coqc COQCCMO=$(CONFIG) toplevel/usage.cmo scripts/coqc.cmo $(COQC): $(COQCCMO) $(COQTOPBYTE) $(BESTCOQTOP) $(OCAMLC) $(BYTEFLAGS) -o $@ -custom unix.cma $(COQCCMO) $(OSDEPLIBS) clean:: rm -f scripts/tolink.ml archclean:: rm -f $(COQTOPBYTE) $(COQTOPOPT) $(BESTCOQTOP) $(COQC) $(COQMKTOP) rm -f $(COQTOP) # we provide targets for each subdirectory lib: $(LIBREP) kernel: $(KERNEL) library: $(LIBRARY) proofs: $(PROOFS) tactics: $(TACTICS) interp: $(INTERP) parsing: $(PARSING) pretyping: $(PRETYPING) highparsing: $(HIGHPARSING) toplevel: $(TOPLEVEL) hightactics: $(HIGHTACTICS) # special binaries for debugging bin/coq-interface$(EXE): $(COQMKTOP) $(CMO) $(USERTACCMO) $(INTERFACE) $(COQMKTOP) -top $(BYTEFLAGS) -o $@ $(INTERFACE) bin/parser$(EXE): contrib/interface/ctast.cmo contrib/interface/parse.cmo contrib/interface/line_parser.cmo $(PARSERREQUIRES) contrib/interface/xlate.cmo contrib/interface/vtp.cmo $(OCAMLC) -cclib -lunix -custom $(BYTEFLAGS) -o $@ $(CMA) \ $(PARSERREQUIRES) \ ctast.cmo line_parser.cmo vtp.cmo xlate.cmo parse.cmo clean:: rm -f bin/parser$(EXE) bin/coq-interface$(EXE) ########################################################################### # tests ########################################################################### check:: world cd test-suite; ./check -$(BEST) | tee check.log if grep -F 'Error!' test-suite/check.log ; then false; fi ########################################################################### # theories and states ########################################################################### states:: states/barestate.coq states/initial.coq SYNTAXPP=syntax/PPConstr.v syntax/PPCases.v states/barestate.coq: $(SYNTAXPP) $(BESTCOQTOP) $(BESTCOQTOP) -boot -batch -silent -nois -I syntax -load-vernac-source syntax/MakeBare.v -outputstate states/barestate.coq # theories/Init/DatatypesHints.vo theories/Init/PeanoHints.vo \ # theories/Init/LogicHints.vo theories/Init/SpecifHints.vo \ # theories/Init/Logic_TypeHints.vo \ INITVO=theories/Init/Datatypes.vo theories/Init/DatatypesSyntax.vo \ theories/Init/Peano.vo theories/Init/PeanoSyntax.vo \ theories/Init/Logic.vo theories/Init/Specif.vo \ theories/Init/LogicSyntax.vo theories/Init/SpecifSyntax.vo \ theories/Init/Logic_Type.vo theories/Init/Wf.vo \ theories/Init/Logic_TypeSyntax.vo theories/Init/Prelude.vo theories/Init/%.vo: theories/Init/%.v states/barestate.coq $(COQC) $(BOOTCOQTOP) -is states/barestate.coq -compile $* init: $(INITVO) EXTRACTIONVO= TACTICSVO=$(EXTRACTIONVO) tactics/%.vo: tactics/%.v states/barestate.coq $(COQC) $(BOOTCOQTOP) -is states/barestate.coq -compile $* contrib/extraction/%.vo: contrib/extraction/%.v states/barestate.coq $(COQC) $(BOOTCOQTOP) -is states/barestate.coq -compile $* states/initial.coq: states/barestate.coq states/MakeInitial.v $(INITVO) $(TACTICSVO) $(BESTCOQTOP) $(BOOTCOQTOP) -batch -silent -is states/barestate.coq -load-vernac-source states/MakeInitial.v -outputstate states/initial.coq clean:: rm -f states/*.coq LOGICVO=theories/Logic/Hurkens.vo theories/Logic/ProofIrrelevance.vo\ theories/Logic/Classical.vo theories/Logic/Classical_Type.vo \ theories/Logic/Classical_Pred_Set.vo theories/Logic/Eqdep.vo \ theories/Logic/Classical_Pred_Type.vo theories/Logic/Classical_Prop.vo \ theories/Logic/ClassicalFacts.vo \ theories/Logic/Berardi.vo theories/Logic/Eqdep_dec.vo \ theories/Logic/Decidable.vo theories/Logic/JMeq.vo ARITHVO=theories/Arith/Arith.vo theories/Arith/Gt.vo \ theories/Arith/Between.vo theories/Arith/Le.vo \ theories/Arith/Compare.vo theories/Arith/Lt.vo \ theories/Arith/Compare_dec.vo theories/Arith/Min.vo \ theories/Arith/Div2.vo theories/Arith/Minus.vo \ theories/Arith/Mult.vo theories/Arith/Even.vo \ theories/Arith/EqNat.vo theories/Arith/Peano_dec.vo \ theories/Arith/Euclid.vo theories/Arith/Plus.vo \ theories/Arith/Wf_nat.vo theories/Arith/Max.vo \ theories/Arith/Bool_nat.vo # theories/Arith/Div.vo SORTINGVO=theories/Sorting/Heap.vo \ theories/Sorting/Permutation.vo \ theories/Sorting/Sorting.vo BOOLVO=theories/Bool/Bool.vo theories/Bool/IfProp.vo \ theories/Bool/Zerob.vo theories/Bool/DecBool.vo \ theories/Bool/Sumbool.vo theories/Bool/BoolEq.vo ZARITHVO=theories/ZArith/Wf_Z.vo theories/ZArith/Zsyntax.vo \ theories/ZArith/ZArith.vo theories/ZArith/auxiliary.vo \ theories/ZArith/ZArith_dec.vo theories/ZArith/fast_integer.vo \ theories/ZArith/Zmisc.vo theories/ZArith/zarith_aux.vo \ theories/ZArith/Zhints.vo theories/ZArith/Zlogarithm.vo \ theories/ZArith/Zpower.vo theories/ZArith/Zcomplements.vo \ theories/ZArith/Zdiv.vo theories/ZArith/Zsqrt.vo \ theories/ZArith/Zwf.vo theories/ZArith/ZArith_base.vo \ theories/ZArith/Zbool.vo LISTSVO=theories/Lists/List.vo theories/Lists/PolyListSyntax.vo \ theories/Lists/ListSet.vo theories/Lists/Streams.vo \ theories/Lists/PolyList.vo theories/Lists/TheoryList.vo SETSVO=theories/Sets/Classical_sets.vo theories/Sets/Permut.vo \ theories/Sets/Constructive_sets.vo theories/Sets/Powerset.vo \ theories/Sets/Cpo.vo theories/Sets/Powerset_Classical_facts.vo \ theories/Sets/Ensembles.vo theories/Sets/Powerset_facts.vo \ theories/Sets/Finite_sets.vo theories/Sets/Relations_1.vo \ theories/Sets/Finite_sets_facts.vo theories/Sets/Relations_1_facts.vo \ theories/Sets/Image.vo theories/Sets/Relations_2.vo \ theories/Sets/Infinite_sets.vo theories/Sets/Relations_2_facts.vo \ theories/Sets/Integers.vo theories/Sets/Relations_3.vo \ theories/Sets/Multiset.vo theories/Sets/Relations_3_facts.vo \ theories/Sets/Partial_Order.vo theories/Sets/Uniset.vo INTMAPVO=theories/IntMap/Adalloc.vo theories/IntMap/Mapcanon.vo \ theories/IntMap/Addec.vo theories/IntMap/Mapcard.vo \ theories/IntMap/Addr.vo theories/IntMap/Mapc.vo \ theories/IntMap/Adist.vo theories/IntMap/Mapfold.vo \ theories/IntMap/Allmaps.vo theories/IntMap/Mapiter.vo \ theories/IntMap/Fset.vo theories/IntMap/Maplists.vo \ theories/IntMap/Lsort.vo theories/IntMap/Mapsubset.vo \ theories/IntMap/Mapaxioms.vo theories/IntMap/Map.vo \ RELATIONSVO=theories/Relations/Newman.vo \ theories/Relations/Operators_Properties.vo \ theories/Relations/Relation_Definitions.vo \ theories/Relations/Relation_Operators.vo \ theories/Relations/Relations.vo \ theories/Relations/Rstar.vo WELLFOUNDEDVO=theories/Wellfounded/Disjoint_Union.vo \ theories/Wellfounded/Inclusion.vo \ theories/Wellfounded/Inverse_Image.vo \ theories/Wellfounded/Lexicographic_Exponentiation.vo \ theories/Wellfounded/Transitive_Closure.vo \ theories/Wellfounded/Union.vo \ theories/Wellfounded/Wellfounded.vo \ theories/Wellfounded/Well_Ordering.vo \ theories/Wellfounded/Lexicographic_Product.vo REALSVO=theories/Reals/TypeSyntax.vo \ theories/Reals/Rdefinitions.vo theories/Reals/Rsyntax.vo \ theories/Reals/Raxioms.vo theories/Reals/Rbase.vo \ theories/Reals/DiscrR.vo theories/Reals/R_Ifp.vo \ theories/Reals/Rbasic_fun.vo theories/Reals/R_sqr.vo \ theories/Reals/SplitAbsolu.vo theories/Reals/SplitRmult.vo \ theories/Reals/Rfunctions.vo theories/Reals/Rlimit.vo \ theories/Reals/Rderiv.vo theories/Reals/Rseries.vo \ theories/Reals/Rtrigo_fun.vo theories/Reals/Alembert.vo \ theories/Reals/Binome.vo theories/Reals/Rsigma.vo \ theories/Reals/Rcomplet.vo theories/Reals/Alembert_compl.vo \ theories/Reals/AltSeries.vo theories/Reals/Rtrigo_def.vo \ theories/Reals/Rtrigo_alt.vo theories/Reals/Rprod.vo \ theories/Reals/Cauchy_prod.vo theories/Reals/Cv_prop.vo \ theories/Reals/Cos_rel.vo theories/Reals/Cos_plus.vo \ theories/Reals/Rtrigo.vo theories/Reals/Ranalysis1.vo \ theories/Reals/Rtopology.vo theories/Reals/TAF.vo \ theories/Reals/PSeries_reg.vo theories/Reals/Exp_prop.vo \ theories/Reals/Rtrigo_reg.vo theories/Reals/Rsqrt_def.vo \ theories/Reals/R_sqrt.vo theories/Reals/Rtrigo_calc.vo \ theories/Reals/Ranalysis2.vo theories/Reals/Ranalysis3.vo \ theories/Reals/Sqrt_reg.vo theories/Reals/Ranalysis4.vo \ theories/Reals/Ranalysis.vo theories/Reals/Rgeom.vo \ theories/Reals/NewtonInt.vo \ theories/Reals/Rpower.vo theories/Reals/Reals.vo SETOIDSVO=theories/Setoids/Setoid.vo THEORIESVO = $(LOGICVO) $(ARITHVO) $(BOOLVO) $(ZARITHVO) $(LISTSVO) \ $(SETSVO) $(INTMAPVO) $(RELATIONSVO) $(WELLFOUNDEDVO) \ $(REALSVO) $(SETOIDSVO) $(SORTINGVO) $(THEORIESVO): states/initial.coq theories: $(THEORIESVO) logic: $(LOGICVO) arith: $(ARITHVO) bool: $(BOOLVO) zarith: $(ZARITHVO) lists: $(LISTSVO) sets: $(SETSVO) intmap: $(INTMAPVO) relations: $(RELATIONSVO) wellfounded: $(WELLFOUNDEDVO) reals: $(REALSVO) sorting: $(SORTINGVO) noreal: logic arith bool zarith lists sets intmap relations wellfounded sorting # globalizations (for coqdoc) glob.dump:: rm -f glob.dump rm -f theories/*/*.vo make GLOB="-dump-glob glob.dump" world clean:: rm -f theories/*/*.vo rm -f tactics/*.vo ########################################################################### # contribs ########################################################################### CORRECTNESSVO=contrib/correctness/Arrays.vo \ contrib/correctness/Correctness.vo \ contrib/correctness/Exchange.vo \ contrib/correctness/ArrayPermut.vo \ contrib/correctness/ProgBool.vo contrib/correctness/ProgInt.vo \ contrib/correctness/Sorted.vo contrib/correctness/Tuples.vo # contrib/correctness/ProgramsExtraction.vo OMEGAVO = contrib/omega/Omega.vo ROMEGAVO = contrib/romega/ReflOmegaCore.vo contrib/romega/ROmega.vo RINGVO = contrib/ring/ArithRing.vo contrib/ring/Ring_normalize.vo \ contrib/ring/Ring_theory.vo contrib/ring/Ring.vo \ contrib/ring/ZArithRing.vo contrib/ring/Ring_abstract.vo \ contrib/ring/Quote.vo contrib/ring/Setoid_ring_normalize.vo \ contrib/ring/Setoid_ring.vo contrib/ring/Setoid_ring_theory.vo FIELDVO = contrib/field/Field_Compl.vo contrib/field/Field_Theory.vo \ contrib/field/Field_Tactic.vo contrib/field/Field.vo XMLVO = Xml.vo INTERFACEV0 = contrib/interface/Centaur.vo INTERFACERC = contrib/interface/vernacrc FOURIERVO = contrib/fourier/Fourier_util.vo contrib/fourier/Fourier.vo JPROVERVO = CCVO = contrib/cc/CC.vo contrib/interface/Centaur.vo: contrib/interface/Centaur.v $(INTERFACE) $(BESTCOQTOP) -boot -byte $(COQINCLUDES) -compile $* contrib/interface/AddDad.vo: contrib/interface/AddDad.v $(INTERFACE) states/initial.coq $(BESTCOQTOP) -boot -byte $(COQINCLUDES) -compile $* CONTRIBVO = $(OMEGAVO) $(ROMEGAVO) $(RINGVO) $(FIELDVO) $(XMLVO) \ $(CORRECTNESSVO) $(FOURIERVO) \ $(JPROVERVO) $(INTERFACEV0) $(CCVO) $(CONTRIBVO): states/initial.coq contrib: $(CONTRIBVO) $(CONTRIBCMO) $(INTERFACERC) omega: $(OMEGAVO) $(OMEGACMO) $(ROMEGAVO) $(ROMEGACMO) ring: $(RINGVO) $(RINGCMO) # xml_ instead of xml to avoid conflict with "make xml" xml_: $(XMLVO) $(XMLCMO) extraction: $(EXTRACTIONCMO) $(EXTRACTIONVO) correctness: $(CORRECTNESSCMO) $(CORRECTNESSVO) field: $(FIELDVO) $(FIELDCMO) fourier: $(FOURIERVO) $(FOURIERCMO) jprover: $(JPROVERVO) $(JPROVERCMO) cc: $(CCVO) $(CCCMO) ALLVO = $(INITVO) $(THEORIESVO) $(CONTRIBVO) $(EXTRACTIONVO) clean:: rm -f contrib/*/*.cm[io] contrib/*/*.vo archclean:: rm -f contrib/*/*.cmx contrib/*/*.[so] ########################################################################### # tools ########################################################################### COQDEP=bin/coqdep$(EXE) COQMAKEFILE=bin/coq_makefile$(EXE) GALLINA=bin/gallina$(EXE) COQTEX=bin/coq-tex$(EXE) COQVO2XML=bin/coq_vo2xml$(EXE) RUNCOQVO2XML=coq_vo2xml$(EXE) # Uses the one in PATH and not the one in bin tools:: $(COQDEP) $(COQMAKEFILE) $(GALLINA) $(COQTEX) $(COQVO2XML) dev/top_printers.cmo COQDEPCMO=config/coq_config.cmo tools/coqdep_lexer.cmo tools/coqdep.cmo $(COQDEP): $(COQDEPCMO) $(OCAMLC) $(BYTEFLAGS) -custom -o $@ unix.cma $(COQDEPCMO) $(OSDEPLIBS) beforedepend:: tools/coqdep_lexer.ml $(COQDEP) GALLINACMO=tools/gallina_lexer.cmo tools/gallina.cmo $(GALLINA): $(GALLINACMO) $(OCAMLC) $(BYTEFLAGS) -custom -o $@ $(GALLINACMO) beforedepend:: tools/gallina_lexer.ml $(COQMAKEFILE): tools/coq_makefile.cmo $(OCAMLC) $(BYTEFLAGS) -custom -o $@ tools/coq_makefile.cmo $(COQTEX): tools/coq-tex.cmo $(OCAMLC) $(BYTEFLAGS) -custom -o $@ str.cma tools/coq-tex.cmo COQVO2XMLCMO=$(CONFIG) toplevel/usage.cmo tools/coq_vo2xml.cmo $(COQVO2XML): $(COQVO2XMLCMO) $(OCAMLC) $(BYTEFLAGS) -custom -o $@ unix.cma $(COQVO2XMLCMO) clean:: rm -f tools/coqdep_lexer.ml tools/gallina_lexer.ml archclean:: rm -f $(COQDEP) $(GALLINA) $(COQTEX) $(COQMAKEFILE) $(COQVO2XML) ########################################################################### # minicoq ########################################################################### MINICOQCMO=$(CONFIG) $(LIBREP) $(KERNEL) \ parsing/lexer.cmo parsing/g_minicoq.cmo \ toplevel/fhimsg.cmo toplevel/minicoq.cmo MINICOQ=bin/minicoq$(EXE) $(MINICOQ): $(MINICOQCMO) $(OCAMLC) $(BYTEFLAGS) -o $@ -custom $(CMA) $(MINICOQCMO) $(OSDEPLIBS) archclean:: rm -f $(MINICOQ) ########################################################################### # XML ########################################################################### # Warning: coq_vo2xml in PATH and not the one in bin is used .PHONY: xml xml: .xml_time_stamp .xml_time_stamp: $(INITVO) $(TACTICSVO) $(THEORIESVO) $(CONTRIBVO) $(RUNCOQVO2XML) -boot -byte $(COQINCLUDES) $(?:%.o=%) touch .xml_time_stamp ########################################################################### # Installation ########################################################################### COQINSTALLPREFIX= # Can be changed for a local installation (to make packages). # You must put a "/" at the end (Cygnus for win32 does not like "//"). FULLBINDIR=$(COQINSTALLPREFIX)$(BINDIR) FULLCOQLIB=$(COQINSTALLPREFIX)$(COQLIB) FULLMANDIR=$(COQINSTALLPREFIX)$(MANDIR) FULLEMACSLIB=$(COQINSTALLPREFIX)$(EMACSLIB) install: install-$(BEST) install-binaries install-library install-manpages install-byte: $(MKDIR) $(FULLBINDIR) cp $(COQMKTOP) $(COQC) $(COQTOPBYTE) $(FULLBINDIR) cd $(FULLBINDIR); ln -sf coqtop.byte$(EXE) coqtop$(EXE) install-opt: $(MKDIR) $(FULLBINDIR) cp $(COQMKTOP) $(COQC) $(COQTOPBYTE) $(COQTOPOPT) $(FULLBINDIR) cd $(FULLBINDIR); ln -sf coqtop.opt$(EXE) coqtop$(EXE) install-binaries: $(MKDIR) $(FULLBINDIR) cp $(COQDEP) $(GALLINA) $(COQMAKEFILE) $(COQTEX) $(COQINTERFACE) $(COQVO2XML) $(FULLBINDIR) LIBFILES=$(INITVO) $(TACTICSVO) $(THEORIESVO) $(CONTRIBVO) install-library: $(MKDIR) $(FULLCOQLIB) for f in $(LIBFILES); do \ $(MKDIR) $(FULLCOQLIB)/`dirname $$f`; \ cp $$f $(FULLCOQLIB)/`dirname $$f`; \ done $(MKDIR) $(FULLCOQLIB)/states cp states/*.coq $(FULLCOQLIB)/states $(MKDIR) $(FULLEMACSLIB) cp tools/coq.el tools/coq-inferior.el $(FULLEMACSLIB) MANPAGES=man/coq-tex.1 man/coqdep.1 man/gallina.1 \ man/coqc.1 man/coqtop.1 man/coqtop.byte.1 man/coqtop.opt.1 \ man/coq_makefile.1 man/coqmktop.1 \ man/coq-interface.1 man/parser.1 man/coq_vo2xml.1 install-manpages: $(MKDIR) $(FULLMANDIR)/man1 cp $(MANPAGES) $(FULLMANDIR)/man1 ########################################################################### # Documentation # Literate programming (with ocamlweb) ########################################################################### .PHONY: doc doc: doc/coq.tex $(MAKE) -C doc coq.ps minicoq.dvi LPLIB = lib/doc.tex $(LIBREP:.cmo=.mli) LPKERNEL = kernel/doc.tex $(KERNEL:.cmo=.mli) LPLIBRARY = library/doc.tex $(LIBRARY:.cmo=.mli) LPPRETYPING = pretyping/doc.tex pretyping/rawterm.mli $(PRETYPING:.cmo=.mli) LPINTERP = $(INTERP:.cmo=.mli) LPPARSING = $(PARSING:.cmo=.mli) $(HIGHPARSING:.cmo=.mli) LPPROOFS = proofs/doc.tex $(PROOFS:.cmo=.mli) LPTACTICS = tactics/doc.tex $(TACTICS:.cmo=.mli) $(HIGHTACTICS:.cmo=.mli) LPTOPLEVEL = toplevel/doc.tex $(TOPLEVEL:.cmo=.mli) LPFILES = doc/macros.tex doc/intro.tex $(LPLIB) $(LPKERNEL) $(LPLIBRARY) \ $(LPPRETYPING) $(LPPROOFS) $(LPTACTICS) $(LPTOPLEVEL) doc/coq.tex: $(LPFILES) ocamlweb -p "\usepackage{epsfig}" $(LPFILES) -o doc/coq.tex # ocamlweb $(LPFILES) -o doc/coq.tex clean:: rm -f doc/coq.tex ########################################################################### # Emacs tags ########################################################################### # NB: the -maxdepth 3 is for excluding files from contrib/extraction/test tags: find . -maxdepth 3 -regex ".*\.ml[i4]?" | sort -r | xargs \ etags --language=none\ "--regex=/let[ \t]+\([^ \t]+\)/\1/" \ "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \ "--regex=/and[ \t]+\([^ \t]+\)/\1/" \ "--regex=/type[ \t]+\([^ \t]+\)/\1/" \ "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \ "--regex=/val[ \t]+\([^ \t]+\)/\1/" \ "--regex=/module[ \t]+\([^ \t]+\)/\1/" otags: find . -maxdepth 3 -name "*.ml" -o -name "*.mli" \ | sort -r | xargs otags find . -maxdepth 3 -name "*.ml4" | sort -r | xargs \ etags --append --language=none\ "--regex=/let[ \t]+\([^ \t]+\)/\1/" \ "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \ "--regex=/and[ \t]+\([^ \t]+\)/\1/" \ "--regex=/type[ \t]+\([^ \t]+\)/\1/" \ "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \ "--regex=/val[ \t]+\([^ \t]+\)/\1/" \ "--regex=/module[ \t]+\([^ \t]+\)/\1/" ########################################################################### ### Special rules ########################################################################### # grammar modules with camlp4 ML4FILES += parsing/lexer.ml4 parsing/q_util.ml4 parsing/q_coqast.ml4 \ parsing/g_prim.ml4 parsing/pcoq.ml4 GRAMMARNEEDEDCMO=\ lib/pp_control.cmo lib/pp.cmo lib/util.cmo lib/bignat.cmo \ lib/dyn.cmo lib/options.cmo \ lib/hashcons.cmo lib/predicate.cmo lib/rtree.cmo \ kernel/names.cmo kernel/univ.cmo kernel/esubst.cmo kernel/term.cmo \ kernel/sign.cmo kernel/declarations.cmo kernel/environ.cmo\ library/nameops.cmo library/libnames.cmo library/summary.cmo \ library/nametab.cmo library/libobject.cmo library/lib.cmo \ library/goptions.cmo library/decl_kinds.cmo \ pretyping/rawterm.cmo pretyping/evd.cmo \ interp/topconstr.cmo interp/genarg.cmo \ interp/ppextend.cmo parsing/coqast.cmo parsing/ast.cmo \ proofs/tacexpr.cmo parsing/ast.cmo \ parsing/lexer.cmo parsing/q_util.cmo parsing/extend.cmo \ toplevel/vernacexpr.cmo parsing/pcoq.cmo parsing/q_coqast.cmo \ parsing/egrammar.cmo CAMLP4EXTENSIONSCMO=\ parsing/argextend.cmo parsing/tacextend.cmo parsing/vernacextend.cmo GRAMMARSCMO=\ parsing/g_prim.cmo parsing/g_tactic.cmo \ parsing/g_ltac.cmo parsing/g_constr.cmo GRAMMARCMO=$(GRAMMARNEEDEDCMO) $(CAMLP4EXTENSIONSCMO) $(GRAMMARSCMO) parsing/grammar.cma: $(GRAMMARCMO) $(OCAMLC) $(BYTEFLAGS) $(GRAMMARCMO) -linkall -a -o $@ clean:: rm -f parsing/grammar.cma ML4FILES +=parsing/g_basevernac.ml4 parsing/g_minicoq.ml4 \ parsing/g_vernac.ml4 parsing/g_proofs.ml4 \ parsing/g_cases.ml4 \ parsing/g_constr.ml4 parsing/g_module.ml4 \ parsing/g_tactic.ml4 parsing/g_ltac.ml4 \ parsing/argextend.ml4 parsing/tacextend.ml4 \ parsing/vernacextend.ml4 # beforedepend:: $(GRAMMARCMO) # beforedepend:: parsing/pcoq.ml parsing/extend.ml # toplevel/mltop.ml4 (ifdef Byte) toplevel/mltop.cmo: toplevel/mltop.byteml $(OCAMLC) $(BYTEFLAGS) -c -impl toplevel/mltop.byteml -o $@ toplevel/mltop.cmx: toplevel/mltop.optml $(OCAMLOPT) $(OPTFLAGS) -c -impl toplevel/mltop.optml -o $@ toplevel/mltop.byteml: toplevel/mltop.ml4 $(CAMLP4O) $(CAMLP4EXTENDFLAGS) pr_o.cmo pa_ifdef.cmo -DByte -impl toplevel/mltop.ml4 > $@ || rm -f $@ toplevel/mltop.optml: toplevel/mltop.ml4 $(CAMLP4O) $(CAMLP4EXTENDFLAGS) pr_o.cmo pa_ifdef.cmo -impl toplevel/mltop.ml4 > $@ || rm -f $@ toplevel/mltop.ml: toplevel/mltop.ml4 $(CAMLP4O) $(CAMLP4EXTENDFLAGS) pr_o.cmo pa_ifdef.cmo -DByte -impl toplevel/mltop.ml4 > $@ || rm -f $@ ML4FILES += toplevel/mltop.ml4 clean:: rm -f toplevel/mltop.byteml toplevel/mltop.optml # files compiled with -rectypes kernel/term.cmo: kernel/term.ml $(OCAMLC) -rectypes $(BYTEFLAGS) -c $< kernel/term.cmx: kernel/term.ml $(OCAMLOPT) -rectypes $(OPTFLAGS) -c $< library/nametab.cmo: library/nametab.ml $(OCAMLC) -rectypes $(BYTEFLAGS) -c $< library/nametab.cmx: library/nametab.ml $(OCAMLOPT) -rectypes $(OPTFLAGS) -c $< # files compiled with camlp4 because of streams syntax ML4FILES += lib/pp.ml4 \ contrib/xml/xml.ml4 \ contrib/xml/acic2Xml.ml4 \ contrib/xml/proofTree2Xml.ml4 \ contrib/interface/line_parser.ml4 \ tools/coq_makefile.ml4 \ tools/coq-tex.ml4 ########################################################################### # Default rules ########################################################################### .SUFFIXES: .ml .mli .cmo .cmi .cmx .mll .ml4 .v .vo .el .elc .ml.cmo: $(OCAMLC) $(BYTEFLAGS) -c $< .mli.cmi: $(OCAMLC) $(BYTEFLAGS) -c $< .ml.cmx: $(OCAMLOPT) $(OPTFLAGS) -c $< .mll.ml: ocamllex $< .ml4.cmx: $(OCAMLOPT) $(OPTFLAGS) -pp "$(CAMLP4O) $(CAMLP4EXTENDFLAGS) `$(CAMLP4DEPS) $<` -impl" -c -impl $< .ml4.cmo: $(OCAMLC) $(BYTEFLAGS) -pp "$(CAMLP4O) $(CAMLP4EXTENDFLAGS) `$(CAMLP4DEPS) $<` -impl" -c -impl $< .v.vo: $(BOOTCOQTOP) -compile $* .el.elc: echo "(setq load-path (cons \".\" load-path))" > $*.compile echo "(byte-compile-file \"$<\")" >> $*.compile - $(EMACS) -batch -l $*.compile rm -f $*.compile ########################################################################### # Cleaning ########################################################################### archclean:: rm -f config/*.cmx config/*.[so] rm -f lib/*.cmx lib/*.[so] rm -f kernel/*.cmx kernel/*.[so] rm -f library/*.cmx library/*.[so] rm -f proofs/*.cmx proofs/*.[so] rm -f tactics/*.cmx tactics/*.[so] rm -f interp/*.cmx interp/*.[so] rm -f parsing/*.cmx parsing/*.[so] rm -f pretyping/*.cmx pretyping/*.[so] rm -f toplevel/*.cmx toplevel/*.[so] rm -f tools/*.cmx tools/*.[so] rm -f scripts/*.cmx scripts/*.[so] rm -f dev/*.cmx dev/*.[so] clean:: archclean rm -f *~ */*~ */*/*~ rm -f gmon.out core rm -f config/*.cm[io] rm -f lib/*.cm[io] rm -f kernel/*.cm[io] rm -f library/*.cm[io] rm -f proofs/*.cm[io] rm -f tactics/*.cm[io] rm -f interp/*.cm[io] rm -f parsing/*.cm[io] parsing/*.ppo rm -f pretyping/*.cm[io] rm -f toplevel/*.cm[io] rm -f tools/*.cm[io] rm -f scripts/*.cm[io] rm -f dev/*.cm[io] rm -f */*.pp[iox] contrib/*/*.pp[iox] cleanconfig:: rm -f config/Makefile config/coq_config.ml dev/ocamldebug-v7 ########################################################################### # Dependencies ########################################################################### alldepend: depend dependcoq dependcoq:: beforedepend $(COQDEP) -R theories Coq -R contrib Coq $(COQINCLUDES) $(ALLVO:.vo=.v) > .depend.coq # Build dependencies ignoring failures in building ml files from ml4 files # This is useful to rebuild dependencies when they are strongly corrupted: # by making scratchdependml, one gets dependencies OK for .ml files and # .ml4 files not using fancy parsers. This is sufficient to get beforedepend # and depend targets successfully built scratchdepend:: dependp4 -$(MAKE) -k -f Makefile.dep $(ML4FILESML) $(OCAMLDEP) $(DEPFLAGS) */*.mli */*/*.mli */*.ml */*/*.ml > .depend $(MAKE) depend # Computing the dependencies in camlp4 files is tricky. # We proceed in several steps: ML4FILESML = $(ML4FILES:.ml4=.ml) # Expresses dependencies of the .ml4 files w.r.t their grammars dependp4:: rm -f .depend.camlp4 for f in $(ML4FILES); do \ printf "%s" `dirname $$f`/`basename $$f .ml4`".ml: " >> .depend.camlp4; \ echo `$(CAMLP4DEPS) $$f` >> .depend.camlp4; \ done # Produce the .ml files using Makefile.dep ml4filesml:: .depend.camlp4 $(MAKE) -f Makefile.dep $(ML4FILESML) depend: beforedepend dependp4 ml4filesml # 1. We express dependencies of the .ml files w.r.t their grammars # 2. Then we are able to produce the .ml files using Makefile.dep # 3. We compute the dependencies inside the .ml files using ocamldep $(OCAMLDEP) $(DEPFLAGS) */*.mli */*/*.mli */*.ml */*/*.ml > .depend # 4. We express dependencies of .cmo and .cmx files w.r.t their grammars for f in $(ML4FILES); do \ printf "%s" `dirname $$f`/`basename $$f .ml4`".cmo: " >> .depend; \ echo `$(CAMLP4DEPS) $$f` >> .depend; \ printf "%s" `dirname $$f`/`basename $$f .ml4`".cmx: " >> .depend; \ echo `$(CAMLP4DEPS) $$f` >> .depend; \ done # 5. Finally, we erase the generated .ml files rm -f $(ML4FILESML) # 6. Since .depend contains correct dependencies .depend.devel can be deleted # (see dev/Makefile.dir for details about this file) if [ -e makefile ]; then >.depend.devel; else rm -f .depend.devel; fi ml4clean:: rm -f $(ML4FILESML) clean:: rm -f $(ML4FILESML) include .depend include .depend.coq # this sets up developper supporting stuff devel: touch .depend.devel $(MAKE) -f dev/Makefile.devel setup-devel $(MAKE) dev/top_printers.cmo