####################################################################### # v # The Coq Proof Assistant / The Coq Development Team # # $@ echo "let kernel = \""$(KERNEL)"\"" >> $@ echo "let library = \""$(LIBRARY)"\"" >> $@ echo "let pretyping = \""$(PRETYPING)"\"" >> $@ echo "let parsing = \""$(PARSING)"\"" >> $@ echo "let proofs = \""$(PROOFS)"\"" >> $@ echo "let tactics = \""$(TACTICS)"\"" >> $@ echo "let toplevel = \""$(TOPLEVEL)"\"" >> $@ 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) parsing: $(PARSING) pretyping: $(PRETYPING) toplevel: $(TOPLEVEL) # special binaries for debugging bin/coq-interface$(EXE): $(COQMKTOP) $(CMO) $(USERTACCMO) $(INTERFACE) $(COQMKTOP) -top $(MLINCLUDES) $(CAMLDEBUG) -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 $(MLINCLUDES) -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: $(BESTCOQTOP) cd test-suite; ./check -$(BEST) ########################################################################### # theories and states ########################################################################### states: states/barestate.coq states/initial.coq SYNTAXPP=syntax/PPConstr.v syntax/PPCases.v syntax/PPTactic.v states/barestate.coq: $(SYNTAXPP) $(BESTCOQTOP) $(BESTCOQTOP) -boot -batch -silent -nois -I syntax -load-vernac-source syntax/MakeBare.v -outputstate states/barestate.coq INITVO=theories/Init/Datatypes.vo theories/Init/Peano.vo \ theories/Init/DatatypesSyntax.vo theories/Init/Prelude.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/%.vo: theories/Init/%.v states/barestate.coq $(COQC) $(COQTOP) -boot -$(BEST) -R theories Coq -is states/barestate.coq -compile $* init: $(INITVO) EXTRACTIONVO=contrib/extraction/Extraction.vo TACTICSVO=tactics/Equality.vo \ tactics/Tauto.vo tactics/Inv.vo \ tactics/EAuto.vo tactics/AutoRewrite.vo tactics/Refine.vo \ tactics/EqDecide.vo tactics/Setoid_replace.vo $(EXTRACTIONVO) tactics/%.vo: tactics/%.v states/barestate.coq $(COQC) $(COQTOP) -boot -$(BEST) $(COQINCLUDES) -is states/barestate.coq -compile $* contrib/extraction/%.vo: contrib/extraction/%.v states/barestate.coq $(COQC) $(COQTOP) -boot -$(BEST) $(COQINCLUDES) -is states/barestate.coq -compile $* states/initial.coq: states/barestate.coq states/MakeInitial.v $(INITVO) $(TACTICSVO) $(BESTCOQTOP) $(BESTCOQTOP) -boot -batch -silent -is states/barestate.coq $(COQINCLUDES) -load-vernac-source states/MakeInitial.v -outputstate states/initial.coq clean:: rm -f states/*.coq LOGICVO=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/Elimdep.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/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 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/Rsigma.vo \ theories/Reals/Rtrigo.vo theories/Reals/Ranalysis.vo \ theories/Reals/Rgeom.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) 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/ProgWf.vo contrib/correctness/Sorted.vo \ contrib/correctness/Tuples.vo # contrib/correctness/ProgramsExtraction.vo OMEGAVO = contrib/omega/Omega.vo contrib/omega/Zlogarithm.vo \ contrib/omega/OmegaSyntax.vo contrib/omega/Zpower.vo \ contrib/omega/Zcomplements.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 = contrib/xml/Xml.vo INTERFACEV0 = contrib/interface/Centaur.vo contrib/interface/vernacrc FOURIERVO = contrib/fourier/Fourier_util.vo contrib/fourier/Fourier.vo contrib/interface/Centaur.vo: contrib/interface/Centaur.v $(INTERFACE) $(COQTOP) -boot -byte $(COQINCLUDES) -compile $* contrib/interface/AddDad.vo: contrib/interface/AddDad.v $(INTERFACE) states/initial.coq $(COQTOP) -boot -byte $(COQINCLUDES) -compile $* CONTRIBVO = $(OMEGAVO) $(ROMEGAVO) $(RINGVO) $(FIELDVO) $(XMLVO) \ $(CORRECTNESSVO)\ $(INTERFACEV0) $(FOURIERVO) $(CONTRIBVO): states/initial.coq contrib: $(CONTRIBVO) $(CONTRIBCMO) 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) 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) $(CAMLDEBUG) $(MLINCLUDES) -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 $(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) LPPARSING =$(PARSING:.cmo=.mli) LPPROOFS = proofs/doc.tex $(PROOFS:.cmo=.mli) LPTACTICS = tactics/doc.tex $(TACTICS:.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 ########################################################################### tags: find . -name "*.ml*" | sort -r | xargs \ etags "--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_coqast.ml4 \ parsing/g_prim.ml4 parsing/pcoq.ml4 GRAMMARCMO=lib/pp_control.cmo lib/pp.cmo lib/util.cmo lib/dyn.cmo \ lib/hashcons.cmo lib/predicate.cmo kernel/names.cmo \ parsing/coqast.cmo parsing/lexer.cmo \ parsing/pcoq.cmo parsing/q_coqast.cmo parsing/g_prim.cmo 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_tactic.ml4 parsing/g_ltac.ml4 \ parsing/extend.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 #lib/pp.cmo: lib/pp.ml # $(OCAMLC) $(BYTEFLAGS) -c $< #lib/pp.cmx: lib/pp.ml # $(OCAMLOPT_P4O) -c $< #contrib/xml/xml.cmo: contrib/xml/xml.ml4 # $(OCAMLC_P4O) -c $< #contrib/xml/xml.cmx: contrib/xml/xml.ml4 # $(OCAMLOPT_P4O) -c $< #contrib/xml/xmlcommand.cmo: contrib/xml/xmlcommand.ml4 # $(OCAMLC_P4O) -c $< #contrib/xml/xmlcommand.cmx: contrib/xml/xmlcommand.ml4 # $(OCAMLOPT_P4O) -c $< #contrib/interface/dad.cmo: contrib/interface/dad.ml4 # $(OCAMLC_P4O) -c $< #contrib/interface/dad.cmx: contrib/interface/dad.ml4 # $(OCAMLOPT_P4O) -c $< #contrib/interface/line_parser.cmo: contrib/interface/line_parser.ml4 # $(OCAMLC_P4O) -c $< #contrib/interface/line_parser.cmx: contrib/interface/line_parser.ml4 # $(OCAMLOPT_P4O) -c $< #tools/coq_makefile.cmo: tools/coq_makefile.ml4 # $(OCAMLC_P4O) -c $< #tools/coq_makefile.cmx: tools/coq_makefile.ml4 # $(OCAMLOPT_P4O) -c $< #tools/coq-tex.cmo: tools/coq-tex.ml4 # $(OCAMLC_P4O) -c $< #tools/coq-tex.cmx: tools/coq-tex.ml4 # $(OCAMLOPT_P4O) -c $< ML4FILES += lib/pp.ml4 \ contrib/xml/xml.ml4 \ contrib/xml/xmlcommand.ml4 \ contrib/interface/dad.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: $(COQTOP) -boot -$(BEST) $(COQINCLUDES) -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 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 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 ########################################################################### # Dependencies ########################################################################### alldepend: depend dependcoq dependcoq: beforedepend $(COQDEP) $(COQINCLUDES) $(ALLVO:.vo=.v) > .depend.coq # Computing the dependencies in camlp4 files is tricky. # We proceed in several steps: ML4FILESML = $(ML4FILES:.ml4=.ml) ml4filesml: $(MAKE) -f Makefile.dep $(ML4FILESML) depend: beforedepend # 1. We express dependencies of the .ml files w.r.t their grammars 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 # 2. Then we are able to produce the .ml files using Makefile.dep $(MAKE) -f Makefile.dep $(ML4FILESML) # 3. We compute the dependencies inside the .ml files using ocamldep $(OCAMLDEP) $(DEPFLAGS) */*.mli */*/*.mli */*.ml */*/*.ml > .depend # 4. We express dependencies of .cmo files w.r.t their grammars for f in $(ML4FILES); do \ printf "%s" `dirname $$f`/`basename $$f .ml4`".cmo: " >> .depend; \ echo `$(CAMLP4DEPS) $$f` >> .depend; \ done # 5. Finally, we erase the generated .ml files rm -f $(ML4FILESML) clean:: rm -f $(ML4FILESML) include .depend include .depend.coq