fix tests

This commit is contained in:
Michael Zhang 2020-06-04 04:22:37 -05:00
parent 974ab5422b
commit 4623e58de2
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
3 changed files with 97 additions and 128 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
*.glob *.glob
.*.aux .*.aux
.Makefile.d .Makefile.d
.coqdeps.d

View file

@ -260,10 +260,7 @@ Qed.
Theorem evenb_S : forall n : nat, Theorem evenb_S : forall n : nat,
evenb (S n) = negb (evenb n). evenb (S n) = negb (evenb n).
Proof. Proof. Admitted.
induction n.
- reflexivity.
- simpl.
(** **** Exercise: 1 star, standard (destruct_induction) (** **** Exercise: 1 star, standard (destruct_induction)
@ -274,7 +271,7 @@ Proof.
*) *)
(* Do not modify the following line: *) (* Do not modify the following line: *)
Definition manual_grade_for_destruct_induction : option (nat*string) := None.. Definition manual_grade_for_destruct_induction : option (nat*string) := None.
(** [] *) (** [] *)
(* ################################################################# *) (* ################################################################# *)

217
Makefile
View file

@ -4,7 +4,7 @@
## \VV/ # ## ## \VV/ # ##
## // # ## ## // # ##
############################################################################### ###############################################################################
## GNUMakefile for Coq 8.11.1 ## GNUMakefile for Coq 8.8.1
# For debugging purposes (must stay here, don't move below) # For debugging purposes (must stay here, don't move below)
INITIAL_VARS := $(.VARIABLES) INITIAL_VARS := $(.VARIABLES)
@ -20,7 +20,7 @@ include Makefile.conf
VFILES := $(COQMF_VFILES) VFILES := $(COQMF_VFILES)
MLIFILES := $(COQMF_MLIFILES) MLIFILES := $(COQMF_MLIFILES)
MLFILES := $(COQMF_MLFILES) MLFILES := $(COQMF_MLFILES)
MLGFILES := $(COQMF_MLGFILES) ML4FILES := $(COQMF_ML4FILES)
MLPACKFILES := $(COQMF_MLPACKFILES) MLPACKFILES := $(COQMF_MLPACKFILES)
MLLIBFILES := $(COQMF_MLLIBFILES) MLLIBFILES := $(COQMF_MLLIBFILES)
CMDLINE_VFILES := $(COQMF_CMDLINE_VFILES) CMDLINE_VFILES := $(COQMF_CMDLINE_VFILES)
@ -36,9 +36,12 @@ LOCAL := $(COQMF_LOCAL)
COQLIB := $(COQMF_COQLIB) COQLIB := $(COQMF_COQLIB)
DOCDIR := $(COQMF_DOCDIR) DOCDIR := $(COQMF_DOCDIR)
OCAMLFIND := $(COQMF_OCAMLFIND) OCAMLFIND := $(COQMF_OCAMLFIND)
CAMLP5O := $(COQMF_CAMLP5O)
CAMLP5BIN := $(COQMF_CAMLP5BIN)
CAMLP5LIB := $(COQMF_CAMLP5LIB)
CAMLP5OPTIONS := $(COQMF_CAMLP5OPTIONS)
CAMLFLAGS := $(COQMF_CAMLFLAGS) CAMLFLAGS := $(COQMF_CAMLFLAGS)
HASNATDYNLINK := $(COQMF_HASNATDYNLINK) HASNATDYNLINK := $(COQMF_HASNATDYNLINK)
OCAMLWARN := $(COQMF_WARN)
Makefile.conf: Makefile.conf:
coq_makefile -Q . LF OTHERFLAGS = '-Q . LF ' COQLIBS = '' -install none Preface.v Basics.v Induction.v Lists.v Poly.v Tactics.v Logic.v IndProp.v Maps.v ProofObjects.v IndPrinciples.v Rel.v Imp.v ImpParser.v ImpCEvalFun.v Extraction.v Auto.v Postscript.v Bib.v PrefaceTest.v BasicsTest.v InductionTest.v ListsTest.v PolyTest.v TacticsTest.v LogicTest.v IndPropTest.v MapsTest.v ProofObjectsTest.v IndPrinciplesTest.v RelTest.v ImpTest.v ImpParserTest.v ImpCEvalFunTest.v ExtractionTest.v AutoTest.v PostscriptTest.v BibTest.v -o Makefile coq_makefile -Q . LF OTHERFLAGS = '-Q . LF ' COQLIBS = '' -install none Preface.v Basics.v Induction.v Lists.v Poly.v Tactics.v Logic.v IndProp.v Maps.v ProofObjects.v IndPrinciples.v Rel.v Imp.v ImpParser.v ImpCEvalFun.v Extraction.v Auto.v Postscript.v Bib.v PrefaceTest.v BasicsTest.v InductionTest.v ListsTest.v PolyTest.v TacticsTest.v LogicTest.v IndPropTest.v MapsTest.v ProofObjectsTest.v IndPrinciplesTest.v RelTest.v ImpTest.v ImpParserTest.v ImpCEvalFunTest.v ExtractionTest.v AutoTest.v PostscriptTest.v BibTest.v -o Makefile
@ -62,25 +65,20 @@ VERBOSE ?=
# Time the Coq process (set to non empty), and how (see default value) # Time the Coq process (set to non empty), and how (see default value)
TIMED?= TIMED?=
TIMECMD?= TIMECMD?=
# Use command time on linux, gtime on Mac OS # Use /usr/bin/env time on linux, gtime on Mac OS
TIMEFMT?="$* (real: %e, user: %U, sys: %S, mem: %M ko)" TIMEFMT?="$* (real: %e, user: %U, sys: %S, mem: %M ko)"
ifneq (,$(TIMED)) ifneq (,$(TIMED))
ifeq (0,$(shell command time -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?)) ifeq (0,$(shell /usr/bin/env time -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?))
STDTIME?=command time -f $(TIMEFMT) STDTIME?=/usr/bin/env time -f $(TIMEFMT)
else else
ifeq (0,$(shell gtime -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?)) ifeq (0,$(shell gtime -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?))
STDTIME?=gtime -f $(TIMEFMT) STDTIME?=gtime -f $(TIMEFMT)
else else
STDTIME?=command time STDTIME?=time
endif endif
endif endif
else else
STDTIME?=command time -f $(TIMEFMT) STDTIME?=/usr/bin/env time -f $(TIMEFMT)
endif
ifneq (,$(COQBIN))
# add an ending /
COQBIN:=$(COQBIN)/
endif endif
# Coq binaries # Coq binaries
@ -88,8 +86,8 @@ COQC ?= "$(COQBIN)coqc"
COQTOP ?= "$(COQBIN)coqtop" COQTOP ?= "$(COQBIN)coqtop"
COQCHK ?= "$(COQBIN)coqchk" COQCHK ?= "$(COQBIN)coqchk"
COQDEP ?= "$(COQBIN)coqdep" COQDEP ?= "$(COQBIN)coqdep"
GALLINA ?= "$(COQBIN)gallina"
COQDOC ?= "$(COQBIN)coqdoc" COQDOC ?= "$(COQBIN)coqdoc"
COQPP ?= "$(COQBIN)coqpp"
COQMKFILE ?= "$(COQBIN)coq_makefile" COQMKFILE ?= "$(COQBIN)coq_makefile"
# Timing scripts # Timing scripts
@ -100,7 +98,7 @@ BEFORE ?=
AFTER ?= AFTER ?=
# FIXME this should be generated by Coq (modules already linked by Coq) # FIXME this should be generated by Coq (modules already linked by Coq)
CAMLDONTLINK=unix,str CAMLDONTLINK=camlp5.gramlib,unix,str
# OCaml binaries # OCaml binaries
CAMLC ?= "$(OCAMLFIND)" ocamlc -c CAMLC ?= "$(OCAMLFIND)" ocamlc -c
@ -108,7 +106,7 @@ CAMLOPTC ?= "$(OCAMLFIND)" opt -c
CAMLLINK ?= "$(OCAMLFIND)" ocamlc -linkpkg -dontlink $(CAMLDONTLINK) CAMLLINK ?= "$(OCAMLFIND)" ocamlc -linkpkg -dontlink $(CAMLDONTLINK)
CAMLOPTLINK ?= "$(OCAMLFIND)" opt -linkpkg -dontlink $(CAMLDONTLINK) CAMLOPTLINK ?= "$(OCAMLFIND)" opt -linkpkg -dontlink $(CAMLDONTLINK)
CAMLDOC ?= "$(OCAMLFIND)" ocamldoc CAMLDOC ?= "$(OCAMLFIND)" ocamldoc
CAMLDEP ?= "$(OCAMLFIND)" ocamldep -slash -ml-synonym .mlpack CAMLDEP ?= "$(OCAMLFIND)" ocamldep -slash -ml-synonym .ml4 -ml-synonym .mlpack
# DESTDIR is prepended to all installation paths # DESTDIR is prepended to all installation paths
DESTDIR ?= DESTDIR ?=
@ -132,8 +130,6 @@ TIME_OF_PRETTY_BUILD_FILE ?= time-of-build-pretty.log
TIME_OF_PRETTY_BOTH_BUILD_FILE ?= time-of-build-both.log TIME_OF_PRETTY_BOTH_BUILD_FILE ?= time-of-build-both.log
TIME_OF_PRETTY_BUILD_EXTRA_FILES ?= - # also output to the command line TIME_OF_PRETTY_BUILD_EXTRA_FILES ?= - # also output to the command line
TGTS ?=
########## End of parameters ################################################## ########## End of parameters ##################################################
# What follows may be relevant to you only if you need to # What follows may be relevant to you only if you need to
# extend this Makefile. If so, look for 'Extension point' here and # extend this Makefile. If so, look for 'Extension point' here and
@ -152,11 +148,7 @@ TGTS ?=
# Flags ####################################################################### # Flags #######################################################################
# #
# We define a bunch of variables combining the parameters. # We define a bunch of variables combining the parameters
# To add additional flags to coq, coqchk or coqdoc, set the
# {COQ,COQCHK,COQDOC}EXTRAFLAGS variable to whatever you want to add.
# To overwrite the default choice and set your own flags entirely, set the
# {COQ,COQCHK,COQDOC}FLAGS variable.
SHOW := $(if $(VERBOSE),@true "",@echo "") SHOW := $(if $(VERBOSE),@true "",@echo "")
HIDE := $(if $(VERBOSE),,@) HIDE := $(if $(VERBOSE),,@)
@ -176,29 +168,33 @@ DYNOBJ:=.cmxs
DYNLIB:=.cmxs DYNLIB:=.cmxs
endif endif
# these variables are meant to be overridden if you want to add *extra* flags COQFLAGS?=-q $(OPT) $(COQLIBS) $(OTHERFLAGS)
COQEXTRAFLAGS?= COQCHKFLAGS?=-silent -o $(COQLIBS)
COQCHKEXTRAFLAGS?= COQDOCFLAGS?=-interpolate -utf8
COQDOCEXTRAFLAGS?=
# these flags do NOT contain the libraries, to make them easier to overwrite
COQFLAGS?=-q $(OTHERFLAGS) $(COQEXTRAFLAGS)
COQCHKFLAGS?=-silent -o $(COQCHKEXTRAFLAGS)
COQDOCFLAGS?=-interpolate -utf8 $(COQDOCEXTRAFLAGS)
COQDOCLIBS?=$(COQLIBS_NOML) COQDOCLIBS?=$(COQLIBS_NOML)
# The version of Coq being run and the version of coq_makefile that # The version of Coq being run and the version of coq_makefile that
# generated this makefile # generated this makefile
COQ_VERSION:=$(shell $(COQC) --print-version | cut -d " " -f 1) COQ_VERSION:=$(shell $(COQC) --print-version | cut -d " " -f 1)
COQMAKEFILE_VERSION:=8.11.1 COQMAKEFILE_VERSION:=8.8.1
COQSRCLIBS?= $(foreach d,$(COQ_SRC_SUBDIRS), -I "$(COQLIB)/$(d)") COQSRCLIBS?= $(foreach d,$(COQ_SRC_SUBDIRS), -I "$(COQLIB)$(d)")
CAMLFLAGS+=$(OCAMLLIBS) $(COQSRCLIBS) -I $(CAMLP5LIB)
CAMLFLAGS+=$(OCAMLLIBS) $(COQSRCLIBS)
# ocamldoc fails with unknown argument otherwise # ocamldoc fails with unknown argument otherwise
CAMLDOCFLAGS:=$(filter-out -annot, $(filter-out -bin-annot, $(CAMLFLAGS))) CAMLDOCFLAGS=$(filter-out -annot, $(filter-out -bin-annot, $(CAMLFLAGS)))
CAMLFLAGS+=$(OCAMLWARN)
# FIXME This should be generated by Coq
GRAMMARS:=grammar.cma
CAMLP5EXTEND=pa_extend.cmo q_MLast.cmo pa_macro.cmo
CAMLLIB:=$(shell "$(OCAMLFIND)" printconf stdlib 2> /dev/null)
ifeq (,$(CAMLLIB))
PP=$(error "Cannot find the 'ocamlfind' binary used to build Coq ($(OCAMLFIND)). Pre-compiled binary packages of Coq do not support compiling plugins this way. Please download the sources of Coq and run the Windows build script.")
else
PP:=-pp '$(CAMLP5O) -I $(CAMLLIB) -I "$(COQLIB)/grammar" $(CAMLP5EXTEND) $(GRAMMARS) $(CAMLP5OPTIONS) -impl'
endif
ifneq (,$(TIMING)) ifneq (,$(TIMING))
TIMING_ARG=-time TIMING_ARG=-time
@ -222,19 +218,19 @@ endif
concat_path = $(if $(1),$(1)/$(if $(COQMF_WINDRIVE),$(subst $(COQMF_WINDRIVE),/,$(2)),$(2)),$(2)) concat_path = $(if $(1),$(1)/$(if $(COQMF_WINDRIVE),$(subst $(COQMF_WINDRIVE),/,$(2)),$(2)),$(2))
COQLIBINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)/user-contrib) COQLIBINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)user-contrib)
COQDOCINSTALL = $(call concat_path,$(DESTDIR),$(DOCDIR)/user-contrib) COQDOCINSTALL = $(call concat_path,$(DESTDIR),$(DOCDIR)user-contrib)
COQTOPINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)/toploop) COQTOPINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)toploop)
# Files ####################################################################### # Files #######################################################################
# #
# We here define a bunch of variables about the files being part of the # We here define a bunch of variables about the files being part of the
# Coq project in order to ease the writing of build target and build rules # Coq project in order to ease the writing of build target and build rules
VDFILE := .Makefile.d VDFILE := .coqdeps
ALLSRCFILES := \ ALLSRCFILES := \
$(MLGFILES) \ $(ML4FILES) \
$(MLFILES) \ $(MLFILES) \
$(MLPACKFILES) \ $(MLPACKFILES) \
$(MLLIBFILES) \ $(MLLIBFILES) \
@ -245,23 +241,18 @@ vo_to_obj = $(addsuffix .o,\
$(filter-out Warning: Error:,\ $(filter-out Warning: Error:,\
$(shell $(COQTOP) -q -noinit -batch -quiet -print-mod-uid $(1)))) $(shell $(COQTOP) -q -noinit -batch -quiet -print-mod-uid $(1))))
strip_dotslash = $(patsubst ./%,%,$(1)) strip_dotslash = $(patsubst ./%,%,$(1))
# without this we get undefined variables in the expansion for the
# targets of the [deprecated,use-mllib-or-mlpack] rule
with_undef = $(if $(filter-out undefined, $(origin $(1))),$($(1)))
VO = vo VO = vo
VOS = vos
VOFILES = $(VFILES:.v=.$(VO)) VOFILES = $(VFILES:.v=.$(VO))
GLOBFILES = $(VFILES:.v=.glob) GLOBFILES = $(VFILES:.v=.glob)
GFILES = $(VFILES:.v=.g)
HTMLFILES = $(VFILES:.v=.html) HTMLFILES = $(VFILES:.v=.html)
GHTMLFILES = $(VFILES:.v=.g.html) GHTMLFILES = $(VFILES:.v=.g.html)
BEAUTYFILES = $(addsuffix .beautified,$(VFILES)) BEAUTYFILES = $(addsuffix .beautified,$(VFILES))
TEXFILES = $(VFILES:.v=.tex) TEXFILES = $(VFILES:.v=.tex)
GTEXFILES = $(VFILES:.v=.g.tex) GTEXFILES = $(VFILES:.v=.g.tex)
CMOFILES = \ CMOFILES = \
$(MLGFILES:.mlg=.cmo) \ $(ML4FILES:.ml4=.cmo) \
$(MLFILES:.ml=.cmo) \ $(MLFILES:.ml=.cmo) \
$(MLPACKFILES:.mlpack=.cmo) $(MLPACKFILES:.mlpack=.cmo)
CMXFILES = $(CMOFILES:.cmo=.cmx) CMXFILES = $(CMOFILES:.cmo=.cmx)
@ -272,25 +263,25 @@ CMIFILES = \
$(CMOFILES:.cmo=.cmi) \ $(CMOFILES:.cmo=.cmi) \
$(MLIFILES:.mli=.cmi) $(MLIFILES:.mli=.cmi)
# the /if/ is because old _CoqProject did not list a .ml(pack|lib) but just # the /if/ is because old _CoqProject did not list a .ml(pack|lib) but just
# a .mlg file # a .ml4 file
CMXSFILES = \ CMXSFILES = \
$(MLPACKFILES:.mlpack=.cmxs) \ $(MLPACKFILES:.mlpack=.cmxs) \
$(CMXAFILES:.cmxa=.cmxs) \ $(CMXAFILES:.cmxa=.cmxs) \
$(if $(MLPACKFILES)$(CMXAFILES),,\ $(if $(MLPACKFILES)$(CMXAFILES),,\
$(MLGFILES:.mlg=.cmxs) $(MLFILES:.ml=.cmxs)) $(ML4FILES:.ml4=.cmxs) $(MLFILES:.ml=.cmxs))
# files that are packed into a plugin (no extension) # files that are packed into a plugin (no extension)
PACKEDFILES = \ PACKEDFILES = \
$(call strip_dotslash, \ $(call strip_dotslash, \
$(foreach lib, \ $(foreach lib, \
$(call strip_dotslash, \ $(call strip_dotslash, \
$(MLPACKFILES:.mlpack=_MLPACK_DEPENDENCIES)),$(call with_undef,$(lib)))) $(MLPACKFILES:.mlpack=_MLPACK_DEPENDENCIES)),$($(lib))))
# files that are archived into a .cma (mllib) # files that are archived into a .cma (mllib)
LIBEDFILES = \ LIBEDFILES = \
$(call strip_dotslash, \ $(call strip_dotslash, \
$(foreach lib, \ $(foreach lib, \
$(call strip_dotslash, \ $(call strip_dotslash, \
$(MLLIBFILES:.mllib=_MLLIB_DEPENDENCIES)),$(call with_undef,$(lib)))) $(MLLIBFILES:.mllib=_MLLIB_DEPENDENCIES)),$($(lib))))
CMIFILESTOINSTALL = $(filter-out $(addsuffix .cmi,$(PACKEDFILES)),$(CMIFILES)) CMIFILESTOINSTALL = $(filter-out $(addsuffix .cmi,$(PACKEDFILES)),$(CMIFILES))
CMOFILESTOINSTALL = $(filter-out $(addsuffix .cmo,$(PACKEDFILES)),$(CMOFILES)) CMOFILESTOINSTALL = $(filter-out $(addsuffix .cmo,$(PACKEDFILES)),$(CMOFILES))
OBJFILES = $(call vo_to_obj,$(VOFILES)) OBJFILES = $(call vo_to_obj,$(VOFILES))
@ -318,7 +309,7 @@ else
DO_NATDYNLINK = DO_NATDYNLINK =
endif endif
ALLDFILES = $(addsuffix .d,$(ALLSRCFILES)) $(VDFILE) ALLDFILES = $(addsuffix .d,$(ALLSRCFILES) $(VDFILE))
# Compilation targets ######################################################### # Compilation targets #########################################################
@ -343,19 +334,19 @@ make-pretty-timed make-pretty-timed-before make-pretty-timed-after::
print-pretty-timed:: print-pretty-timed::
$(HIDE)$(COQMAKE_ONE_TIME_FILE) $(TIME_OF_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES) $(HIDE)$(COQMAKE_ONE_TIME_FILE) $(TIME_OF_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES)
print-pretty-timed-diff:: print-pretty-timed-diff::
$(HIDE)$(COQMAKE_BOTH_TIME_FILES) --sort-by=$(TIMING_SORT_BY) $(TIME_OF_BUILD_AFTER_FILE) $(TIME_OF_BUILD_BEFORE_FILE) $(TIME_OF_PRETTY_BOTH_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES) $(HIDE)$(COQMAKE_BOTH_TIME_FILES) --sort-by=$(TIMING_SORT_BY) $(TIME_OF_BUILD_BEFORE_FILE) $(TIME_OF_BUILD_AFTER_FILE) $(TIME_OF_PRETTY_BOTH_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES)
ifeq (,$(BEFORE)) ifeq (,$(BEFORE))
print-pretty-single-time-diff:: print-pretty-single-time-diff::
@echo 'Error: Usage: $(MAKE) print-pretty-single-time-diff AFTER=path/to/file.v.after-timing BEFORE=path/to/file.v.before-timing' @echo 'Error: Usage: $(MAKE) print-pretty-single-time-diff BEFORE=path/to/file.v.before-timing AFTER=path/to/file.v.after-timing'
$(HIDE)false $(HIDE)false
else else
ifeq (,$(AFTER)) ifeq (,$(AFTER))
print-pretty-single-time-diff:: print-pretty-single-time-diff::
@echo 'Error: Usage: $(MAKE) print-pretty-single-time-diff AFTER=path/to/file.v.after-timing BEFORE=path/to/file.v.before-timing' @echo 'Error: Usage: $(MAKE) print-pretty-single-time-diff BEFORE=path/to/file.v.before-timing AFTER=path/to/file.v.after-timing'
$(HIDE)false $(HIDE)false
else else
print-pretty-single-time-diff:: print-pretty-single-time-diff::
$(HIDE)$(COQMAKE_BOTH_SINGLE_TIMING_FILES) --sort-by=$(TIMING_SORT_BY) $(AFTER) $(BEFORE) $(TIME_OF_PRETTY_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES) $(HIDE)$(COQMAKE_BOTH_SINGLE_TIMING_FILES) --sort-by=$(TIMING_SORT_BY) $(BEFORE) $(AFTER) $(TIME_OF_PRETTY_BUILD_FILE) $(TIME_OF_PRETTY_BUILD_EXTRA_FILES)
endif endif
endif endif
pretty-timed: pretty-timed:
@ -389,44 +380,33 @@ optfiles: $(if $(DO_NATDYNLINK),$(CMXSFILES))
.PHONY: optfiles .PHONY: optfiles
# FIXME, see Ralf's bugreport # FIXME, see Ralf's bugreport
# quick is deprecated, now renamed vio quick: $(VOFILES:.vo=.vio)
vio: $(VOFILES:.vo=.vio)
.PHONY: vio
quick: vio
$(warning "'make quick' is deprecated, use 'make vio' or consider using 'vos' files")
.PHONY: quick .PHONY: quick
vio2vo: vio2vo:
$(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) $(COQLIBS) \ $(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) \
-schedule-vio2vo $(J) $(VOFILES:%.vo=%.vio) -schedule-vio2vo $(J) $(VOFILES:%.vo=%.vio)
.PHONY: vio2vo .PHONY: vio2vo
# quick2vo is undocumented
quick2vo: quick2vo:
$(HIDE)make -j $(J) vio $(HIDE)make -j $(J) quick
$(HIDE)VIOFILES=$$(for vofile in $(VOFILES); do \ $(HIDE)VIOFILES=$$(for vofile in $(VOFILES); do \
viofile="$$(echo "$$vofile" | sed "s/\.vo$$/.vio/")"; \ viofile="$$(echo "$$vofile" | sed "s/\.vo$$/.vio/")"; \
if [ "$$vofile" -ot "$$viofile" -o ! -e "$$vofile" ]; then printf "$$viofile "; fi; \ if [ "$$vofile" -ot "$$viofile" -o ! -e "$$vofile" ]; then printf "$$viofile "; fi; \
done); \ done); \
echo "VIO2VO: $$VIOFILES"; \ echo "VIO2VO: $$VIOFILES"; \
if [ -n "$$VIOFILES" ]; then \ if [ -n "$$VIOFILES" ]; then \
$(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) $(COQLIBS) -schedule-vio2vo $(J) $$VIOFILES; \ $(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) -schedule-vio2vo $(J) $$VIOFILES; \
fi fi
.PHONY: quick2vo .PHONY: quick2vo
checkproofs: checkproofs:
$(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) $(COQLIBS) \ $(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) \
-schedule-vio-checking $(J) $(VOFILES:%.vo=%.vio) -schedule-vio-checking $(J) $(VOFILES:%.vo=%.vio)
.PHONY: checkproofs .PHONY: checkproofs
vos: $(VOFILES:%.vo=%.vos)
.PHONY: vos
vok: $(VOFILES:%.vo=%.vok)
.PHONY: vok
validate: $(VOFILES) validate: $(VOFILES)
$(TIMER) $(COQCHK) $(COQCHKFLAGS) $(COQLIBS) $^ $(TIMER) $(COQCHK) $(COQCHKFLAGS) $^
.PHONY: validate .PHONY: validate
only: $(TGTS) only: $(TGTS)
@ -451,6 +431,8 @@ all-mli.tex: $(MLIFILES:.mli=.cmi)
$(HIDE)$(CAMLDOC) -latex \ $(HIDE)$(CAMLDOC) -latex \
-o $@ -m A $(CAMLDEBUG) $(CAMLDOCFLAGS) $(MLIFILES) -o $@ -m A $(CAMLDEBUG) $(CAMLDOCFLAGS) $(MLIFILES)
gallina: $(GFILES)
all.ps: $(VFILES) all.ps: $(VFILES)
$(SHOW)'COQDOC -ps $(GAL)' $(SHOW)'COQDOC -ps $(GAL)'
$(HIDE)$(COQDOC) \ $(HIDE)$(COQDOC) \
@ -486,9 +468,6 @@ beautify: $(BEAUTYFILES)
# Extensions can't assume when they run. # Extensions can't assume when they run.
install: install:
$(HIDE)code=0; for f in $(FILESTOINSTALL); do\
if ! [ -f "$$f" ]; then >&2 echo $$f does not exist; code=1; fi \
done; exit $$code
$(HIDE)for f in $(FILESTOINSTALL); do\ $(HIDE)for f in $(FILESTOINSTALL); do\
df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`";\ df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`";\
if [ "$$?" != "0" -o -z "$$df" ]; then\ if [ "$$?" != "0" -o -z "$$df" ]; then\
@ -569,14 +548,12 @@ clean::
$(HIDE)rm -f $(CMXSFILES) $(HIDE)rm -f $(CMXSFILES)
$(HIDE)rm -f $(CMOFILES:.cmo=.o) $(HIDE)rm -f $(CMOFILES:.cmo=.o)
$(HIDE)rm -f $(CMXAFILES:.cmxa=.a) $(HIDE)rm -f $(CMXAFILES:.cmxa=.a)
$(HIDE)rm -f $(MLGFILES:.mlg=.ml)
$(HIDE)rm -f $(ALLDFILES) $(HIDE)rm -f $(ALLDFILES)
$(HIDE)rm -f $(NATIVEFILES) $(HIDE)rm -f $(NATIVEFILES)
$(HIDE)find . -name .coq-native -type d -empty -delete $(HIDE)find . -name .coq-native -type d -empty -delete
$(HIDE)rm -f $(VOFILES) $(HIDE)rm -f $(VOFILES)
$(HIDE)rm -f $(VOFILES:.vo=.vio) $(HIDE)rm -f $(VOFILES:.vo=.vio)
$(HIDE)rm -f $(VOFILES:.vo=.vos) $(HIDE)rm -f $(GFILES)
$(HIDE)rm -f $(VOFILES:.vo=.vok)
$(HIDE)rm -f $(BEAUTYFILES) $(VFILES:=.old) $(HIDE)rm -f $(BEAUTYFILES) $(VFILES:=.old)
$(HIDE)rm -f all.ps all-gal.ps all.pdf all-gal.pdf all.glob all-mli.tex $(HIDE)rm -f all.ps all-gal.ps all.pdf all-gal.pdf all.glob all-mli.tex
$(HIDE)rm -f $(VFILES:.v=.glob) $(HIDE)rm -f $(VFILES:.v=.glob)
@ -611,17 +588,19 @@ $(MLIFILES:.mli=.cmi): %.cmi: %.mli
$(SHOW)'CAMLC -c $<' $(SHOW)'CAMLC -c $<'
$(HIDE)$(CAMLC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $< $(HIDE)$(CAMLC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $<
$(MLGFILES:.mlg=.ml): %.ml: %.mlg $(ML4FILES:.ml4=.cmo): %.cmo: %.ml4
$(SHOW)'COQPP $<' $(SHOW)'CAMLC -pp -c $<'
$(HIDE)$(COQPP) $< $(HIDE)$(CAMLC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $(PP) -impl $<
# Stupid hack around a deficient syntax: we cannot concatenate two expansions $(ML4FILES:.ml4=.cmx): %.cmx: %.ml4
$(filter %.cmo, $(MLFILES:.ml=.cmo) $(MLGFILES:.mlg=.cmo)): %.cmo: %.ml $(SHOW)'CAMLOPT -pp -c $(FOR_PACK) $<'
$(HIDE)$(CAMLOPTC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $(PP) $(FOR_PACK) -impl $<
$(MLFILES:.ml=.cmo): %.cmo: %.ml
$(SHOW)'CAMLC -c $<' $(SHOW)'CAMLC -c $<'
$(HIDE)$(CAMLC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $< $(HIDE)$(CAMLC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $<
# Same hack $(MLFILES:.ml=.cmx): %.cmx: %.ml
$(filter %.cmx, $(MLFILES:.ml=.cmx) $(MLGFILES:.mlg=.cmx)): %.cmx: %.ml
$(SHOW)'CAMLOPT -c $(FOR_PACK) $<' $(SHOW)'CAMLOPT -c $(FOR_PACK) $<'
$(HIDE)$(CAMLOPTC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $(FOR_PACK) $< $(HIDE)$(CAMLOPTC) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) $(FOR_PACK) $<
@ -637,7 +616,7 @@ $(MLLIBFILES:.mllib=.cma): %.cma: | %.mllib
$(MLLIBFILES:.mllib=.cmxa): %.cmxa: | %.mllib $(MLLIBFILES:.mllib=.cmxa): %.cmxa: | %.mllib
$(SHOW)'CAMLOPT -a -o $@' $(SHOW)'CAMLOPT -a -o $@'
$(HIDE)$(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) -a -o $@ $^ $(HIDE)$(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) -a -o $@ $^
$(MLPACKFILES:.mlpack=.cmxs): %.cmxs: %.cmxa $(MLPACKFILES:.mlpack=.cmxs): %.cmxs: %.cmxa
@ -662,7 +641,7 @@ $(MLPACKFILES:.mlpack=.cmx): %.cmx: | %.mlpack
$(HIDE)$(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) -pack -o $@ $^ $(HIDE)$(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) -pack -o $@ $^
# This rule is for _CoqProject with no .mllib nor .mlpack # This rule is for _CoqProject with no .mllib nor .mlpack
$(filter-out $(MLLIBFILES:.mllib=.cmxs) $(MLPACKFILES:.mlpack=.cmxs) $(addsuffix .cmxs,$(PACKEDFILES)) $(addsuffix .cmxs,$(LIBEDFILES)),$(MLFILES:.ml=.cmxs) $(MLGFILES:.mlg=.cmxs)): %.cmxs: %.cmx $(filter-out $(MLLIBFILES:.mllib=.cmxs) $(MLPACKFILES:.mlpack=.cmxs) $(addsuffix .cmxs,$(PACKEDFILES)) $(addsuffix .cmxs,$(LIBEDFILES)),$(MLFILES:.ml=.cmxs) $(ML4FILES:.ml4=.cmxs)): %.cmxs: %.cmx
$(SHOW)'[deprecated,use-mllib-or-mlpack] CAMLOPT -shared -o $@' $(SHOW)'[deprecated,use-mllib-or-mlpack] CAMLOPT -shared -o $@'
$(HIDE)$(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) \ $(HIDE)$(CAMLOPTLINK) $(CAMLDEBUG) $(CAMLFLAGS) $(CAMLPKGS) \
-shared -o $@ $< -shared -o $@ $<
@ -675,23 +654,15 @@ endif
$(VOFILES): %.vo: %.v $(VOFILES): %.vo: %.v
$(SHOW)COQC $< $(SHOW)COQC $<
$(HIDE)$(TIMER) $(COQC) $(COQDEBUG) $(TIMING_ARG) $(COQFLAGS) $(COQLIBS) $< $(TIMING_EXTRA) $(HIDE)$(TIMER) $(COQC) $(COQDEBUG) $(TIMING_ARG) $(COQFLAGS) $< $(TIMING_EXTRA)
# FIXME ?merge with .vo / .vio ? # FIXME ?merge with .vo / .vio ?
$(GLOBFILES): %.glob: %.v $(GLOBFILES): %.glob: %.v
$(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) $(COQLIBS) $< $(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) $<
$(VFILES:.v=.vio): %.vio: %.v $(VFILES:.v=.vio): %.vio: %.v
$(SHOW)COQC -vio $< $(SHOW)COQC -quick $<
$(HIDE)$(TIMER) $(COQC) -vio $(COQDEBUG) $(COQFLAGS) $(COQLIBS) $< $(HIDE)$(TIMER) $(COQC) -quick $(COQDEBUG) $(COQFLAGS) $<
$(VFILES:.v=.vos): %.vos: %.v
$(SHOW)COQC -vos $<
$(HIDE)$(TIMER) $(COQC) -vos $(COQDEBUG) $(COQFLAGS) $(COQLIBS) $<
$(VFILES:.v=.vok): %.vok: %.v
$(SHOW)COQC -vok $<
$(HIDE)$(TIMER) $(COQC) -vok $(COQDEBUG) $(COQFLAGS) $(COQLIBS) $<
$(addsuffix .timing.diff,$(VFILES)): %.timing.diff : %.before-timing %.after-timing $(addsuffix .timing.diff,$(VFILES)): %.timing.diff : %.before-timing %.after-timing
$(SHOW)PYTHON TIMING-DIFF $< $(SHOW)PYTHON TIMING-DIFF $<
@ -699,7 +670,11 @@ $(addsuffix .timing.diff,$(VFILES)): %.timing.diff : %.before-timing %.after-tim
$(BEAUTYFILES): %.v.beautified: %.v $(BEAUTYFILES): %.v.beautified: %.v
$(SHOW)'BEAUTIFY $<' $(SHOW)'BEAUTIFY $<'
$(HIDE)$(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) $(COQLIBS) -beautify $< $(HIDE)$(TIMER) $(COQC) $(COQDEBUG) $(COQFLAGS) -beautify $<
$(GFILES): %.g: %.v
$(SHOW)'GALLINA $<'
$(HIDE)$(GALLINA) $<
$(TEXFILES): %.tex: %.v $(TEXFILES): %.tex: %.v
$(SHOW)'COQDOC -latex $<' $(SHOW)'COQDOC -latex $<'
@ -719,11 +694,11 @@ $(GHTMLFILES): %.g.html: %.v %.glob
# Dependency files ############################################################ # Dependency files ############################################################
ifndef MAKECMDGOALS ifneq ($(filter-out archclean clean cleanall printenv make-pretty-timed make-pretty-timed-before make-pretty-timed-after print-pretty-timed print-pretty-timed-diff print-pretty-single-time-diff,$(MAKECMDGOALS)),)
-include $(ALLDFILES) -include $(ALLDFILES)
else else
ifneq ($(filter-out archclean clean cleanall printenv make-pretty-timed make-pretty-timed-before make-pretty-timed-after print-pretty-timed print-pretty-timed-diff print-pretty-single-time-diff,$(MAKECMDGOALS)),) ifeq ($(MAKECMDGOALS),)
-include $(ALLDFILES) -include $(ALLDFILES)
endif endif
endif endif
@ -731,16 +706,13 @@ endif
redir_if_ok = > "$@" || ( RV=$$?; rm -f "$@"; exit $$RV ) redir_if_ok = > "$@" || ( RV=$$?; rm -f "$@"; exit $$RV )
GENMLFILES:=$(MLGFILES:.mlg=.ml)
$(addsuffix .d,$(ALLSRCFILES)): $(GENMLFILES)
$(addsuffix .d,$(MLIFILES)): %.mli.d: %.mli $(addsuffix .d,$(MLIFILES)): %.mli.d: %.mli
$(SHOW)'CAMLDEP $<' $(SHOW)'CAMLDEP $<'
$(HIDE)$(CAMLDEP) $(OCAMLLIBS) "$<" $(redir_if_ok) $(HIDE)$(CAMLDEP) $(OCAMLLIBS) "$<" $(redir_if_ok)
$(addsuffix .d,$(MLGFILES)): %.mlg.d: %.ml $(addsuffix .d,$(ML4FILES)): %.ml4.d: %.ml4
$(SHOW)'CAMLDEP $<' $(SHOW)'CAMLDEP -pp $<'
$(HIDE)$(CAMLDEP) $(OCAMLLIBS) "$<" $(redir_if_ok) $(HIDE)$(CAMLDEP) $(OCAMLLIBS) $(PP) -impl "$<" $(redir_if_ok)
$(addsuffix .d,$(MLFILES)): %.ml.d: %.ml $(addsuffix .d,$(MLFILES)): %.ml.d: %.ml
$(SHOW)'CAMLDEP $<' $(SHOW)'CAMLDEP $<'
@ -759,9 +731,9 @@ $(addsuffix .d,$(MLPACKFILES)): %.mlpack.d: %.mlpack
# projects. Note that extra options might be on the command line. # projects. Note that extra options might be on the command line.
VDFILE_FLAGS:=$(if ,-f ,) $(CMDLINE_COQLIBS) $(CMDLINE_VFILES) VDFILE_FLAGS:=$(if ,-f ,) $(CMDLINE_COQLIBS) $(CMDLINE_VFILES)
$(VDFILE): $(VFILES) $(VDFILE).d: $(VFILES)
$(SHOW)'COQDEP VFILES' $(SHOW)'COQDEP VFILES'
$(HIDE)$(COQDEP) -vos -dyndep var $(VDFILE_FLAGS) $(redir_if_ok) $(HIDE)$(COQDEP) -dyndep var $(VDFILE_FLAGS) $(redir_if_ok)
# Misc ######################################################################## # Misc ########################################################################
@ -782,13 +754,16 @@ printenv::
@echo 'COQLIB = $(COQLIB)' @echo 'COQLIB = $(COQLIB)'
@echo 'DOCDIR = $(DOCDIR)' @echo 'DOCDIR = $(DOCDIR)'
@echo 'OCAMLFIND = $(OCAMLFIND)' @echo 'OCAMLFIND = $(OCAMLFIND)'
@echo 'CAMLP5O = $(CAMLP5O)'
@echo 'CAMLP5BIN = $(CAMLP5BIN)'
@echo 'CAMLP5LIB = $(CAMLP5LIB)'
@echo 'CAMLP5OPTIONS = $(CAMLP5OPTIONS)'
@echo 'HASNATDYNLINK = $(HASNATDYNLINK)' @echo 'HASNATDYNLINK = $(HASNATDYNLINK)'
@echo 'SRC_SUBDIRS = $(SRC_SUBDIRS)' @echo 'SRC_SUBDIRS = $(SRC_SUBDIRS)'
@echo 'COQ_SRC_SUBDIRS = $(COQ_SRC_SUBDIRS)' @echo 'COQ_SRC_SUBDIRS = $(COQ_SRC_SUBDIRS)'
@echo 'OCAMLFIND = $(OCAMLFIND)' @echo 'OCAMLFIND = $(OCAMLFIND)'
@echo 'PP = $(PP)' @echo 'PP = $(PP)'
@echo 'COQFLAGS = $(COQFLAGS)' @echo 'COQFLAGS = $(COQFLAGS)'
@echo 'COQLIB = $(COQLIBS)'
@echo 'COQLIBINSTALL = $(COQLIBINSTALL)' @echo 'COQLIBINSTALL = $(COQLIBINSTALL)'
@echo 'COQDOCINSTALL = $(COQDOCINSTALL)' @echo 'COQDOCINSTALL = $(COQDOCINSTALL)'
.PHONY: printenv .PHONY: printenv
@ -822,7 +797,3 @@ debug:
.PHONY: debug .PHONY: debug
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
# Local Variables:
# mode: makefile-gmake
# End: