From d0243311634a8d6fa77fb2d0bb36eab96186a605 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Wed, 16 May 2018 20:36:34 +0200 Subject: Modify make system to include Makefile.common in the test suite --- Makefile.build | 1 + Makefile.common | 36 ------------------------------------ Makefile.vofiles | 40 ++++++++++++++++++++++++++++++++++++++++ test-suite/Makefile | 21 ++++++++------------- 4 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 Makefile.vofiles diff --git a/Makefile.build b/Makefile.build index ffe605757..179ca28b6 100644 --- a/Makefile.build +++ b/Makefile.build @@ -89,6 +89,7 @@ byte: coqbyte coqide-byte pluginsbyte printers MLFILES := $(MLSTATICFILES) $(GENMLFILES) $(ML4FILES:.ml4=.ml) include Makefile.common +include Makefile.vofiles include Makefile.doc ## provides the 'documentation' rule include Makefile.checker include Makefile.ide ## provides the 'coqide' rule diff --git a/Makefile.common b/Makefile.common index f3b39ff26..9493acd1f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -111,10 +111,6 @@ TOPLOOPCMA:=stm/proofworkertop.cma stm/tacworkertop.cma stm/queryworkertop.cma GRAMMARCMA:=grammar/grammar.cma -# modules known by the toplevel of Coq - -OBJSMOD:=$(shell cat $(CORECMA:.cma=.mllib)) - ########################################################################### # plugins object files ########################################################################### @@ -163,40 +159,8 @@ PLUGINSOPT:=$(PLUGINSCMO:.cmo=.cmxs) LINKCMO:=$(CORECMA) $(STATICPLUGINS) LINKCMX:=$(CORECMA:.cma=.cmxa) $(STATICPLUGINS:.cmo=.cmx) -########################################################################### -# vo files -########################################################################### - -THEORIESVO := $(patsubst %.v,%.vo,$(shell find theories -type f -name "*.v")) -PLUGINSVO := $(patsubst %.v,%.vo,$(shell find plugins -type f -name "*.v")) -ALLVO := $(THEORIESVO) $(PLUGINSVO) -VFILES := $(ALLVO:.vo=.v) - -## More specific targets - -THEORIESLIGHTVO:= \ - $(filter theories/Init/% theories/Logic/% theories/Unicode/% theories/Arith/%, $(THEORIESVO)) - ALLSTDLIB := test-suite/misc/universes/all_stdlib -# convert a (stdlib) filename into a module name: -# remove .vo, replace theories and plugins by Coq, and replace slashes by dots -vo_to_mod = $(subst /,.,$(patsubst theories/%,Coq.%,$(patsubst plugins/%,Coq.%,$(1:.vo=)))) - -ALLMODS:=$(call vo_to_mod,$(ALLVO)) - - -# Converting a stdlib filename into native compiler filenames -# Used for install targets -vo_to_cm = $(foreach vo,$(1),$(dir $(vo)).coq-native/$(subst /,_,$(patsubst theories/%,NCoq_%,$(patsubst plugins/%,NCoq_%,$(vo:.vo=.cm*))))) - -vo_to_obj = $(foreach vo,$(1),$(dir $(vo)).coq-native/$(subst /,_,$(patsubst theories/%,NCoq_%,$(patsubst plugins/%,NCoq_%,$(vo:.vo=.o))))) - -GLOBFILES:=$(ALLVO:.vo=.glob) -LIBFILES:=$(ALLVO) $(call vo_to_cm,$(ALLVO)) \ - $(call vo_to_obj,$(ALLVO)) \ - $(VFILES) $(GLOBFILES) - # For emacs: # Local Variables: # mode: makefile diff --git a/Makefile.vofiles b/Makefile.vofiles new file mode 100644 index 000000000..fc902c4a8 --- /dev/null +++ b/Makefile.vofiles @@ -0,0 +1,40 @@ + +# This file calls [find] and as such is not suitable for inclusion in +# the test suite Makefile, unlike Makefile.common. + +########################################################################### +# vo files +########################################################################### + +THEORIESVO := $(patsubst %.v,%.vo,$(shell find theories -type f -name "*.v")) +PLUGINSVO := $(patsubst %.v,%.vo,$(shell find plugins -type f -name "*.v")) +ALLVO := $(THEORIESVO) $(PLUGINSVO) +VFILES := $(ALLVO:.vo=.v) + +## More specific targets + +THEORIESLIGHTVO:= \ + $(filter theories/Init/% theories/Logic/% theories/Unicode/% theories/Arith/%, $(THEORIESVO)) + +# convert a (stdlib) filename into a module name: +# remove .vo, replace theories and plugins by Coq, and replace slashes by dots +vo_to_mod = $(subst /,.,$(patsubst theories/%,Coq.%,$(patsubst plugins/%,Coq.%,$(1:.vo=)))) + +ALLMODS:=$(call vo_to_mod,$(ALLVO)) + + +# Converting a stdlib filename into native compiler filenames +# Used for install targets +vo_to_cm = $(foreach vo,$(1),$(dir $(vo)).coq-native/$(subst /,_,$(patsubst theories/%,NCoq_%,$(patsubst plugins/%,NCoq_%,$(vo:.vo=.cm*))))) + +vo_to_obj = $(foreach vo,$(1),$(dir $(vo)).coq-native/$(subst /,_,$(patsubst theories/%,NCoq_%,$(patsubst plugins/%,NCoq_%,$(vo:.vo=.o))))) + +GLOBFILES:=$(ALLVO:.vo=.glob) +LIBFILES:=$(ALLVO) $(call vo_to_cm,$(ALLVO)) \ + $(call vo_to_obj,$(ALLVO)) \ + $(VFILES) $(GLOBFILES) + +# For emacs: +# Local Variables: +# mode: makefile +# End: diff --git a/test-suite/Makefile b/test-suite/Makefile index a6e6283bf..ce21ff41c 100644 --- a/test-suite/Makefile +++ b/test-suite/Makefile @@ -26,6 +26,7 @@ ########################################################################### include ../config/Makefile +include ../Makefile.common ####################################################################### # Variables @@ -258,31 +259,25 @@ $(addsuffix .log,$(wildcard bugs/closed/*.v)): %.v.log: %.v OCAMLOPT := $(OCAMLFIND) opt $(CAMLFLAGS) SYSMOD:=-package num,str,unix,dynlink,threads -COQSRCDIRS=-I $(LIB)/clib -I $(LIB)/lib -I $(LIB)/kernel -I $(LIB)/kernel/byterun \ --I $(LIB)/library -I $(LIB)/engine -I $(LIB)/pretyping -I $(LIB)/interp \ --I $(LIB)/proofs -I $(LIB)/parsing -I $(LIB)/printing -I $(LIB)/tactics -I $(LIB)/vernac \ --I $(LIB)/stm -I $(LIB)/toplevel +COQSRCDIRS:=$(addprefix -I $(LIB)/,$(CORESRCDIRS)) +COQCMXS:=$(addprefix $(LIB)/,$(LINKCMX)) # ML files from unit-test framework, not containing tests -UNIT_SRCFILES=$(shell find ./unit-tests/src -name *.ml) +UNIT_SRCFILES:=$(shell find ./unit-tests/src -name *.ml) UNIT_ALLMLFILES:=$(shell find ./unit-tests -name *.ml) UNIT_MLFILES:=$(filter-out $(UNIT_SRCFILES),$(UNIT_ALLMLFILES)) UNIT_LOGFILES:=$(patsubst %.ml,%.ml.log,$(UNIT_MLFILES)) UNIT_CMXS=utest.cmx -# this is same link order as CORECMA in Makefile.common in Coq root dir -COQCMXAS=clib.cmxa lib.cmxa kernel.cmxa library.cmxa engine.cmxa pretyping.cmxa \ - interp.cmxa proofs.cmxa parsing.cmxa printing.cmxa tactics.cmxa vernac.cmxa stm.cmxa toplevel.cmxa - -unit-tests/src/utest.cmx : unit-tests/src/utest.ml unit-tests/src/utest.cmi +unit-tests/src/utest.cmx: unit-tests/src/utest.ml unit-tests/src/utest.cmi $(SHOW) 'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) -c -I unit-tests/src -package oUnit $< -unit-tests/src/utest.cmi : unit-tests/src/utest.mli +unit-tests/src/utest.cmi: unit-tests/src/utest.mli $(SHOW) 'OCAMLOPT $<' $(HIDE)$(OCAMLOPT) -package oUnit $< -$(UNIT_LOGFILES) : unit-tests/src/utest.cmx +$(UNIT_LOGFILES): unit-tests/src/utest.cmx unit-tests: $(UNIT_LOGFILES) @@ -291,7 +286,7 @@ unit-tests/%.ml.log: unit-tests/%.ml $(SHOW) 'TEST $<' $(HIDE)$(OCAMLOPT) -linkall -linkpkg -cclib -lcoqrun \ $(SYSMOD) -package camlp5.gramlib,oUnit \ - -I unit-tests/src $(COQSRCDIRS) $(COQCMXAS) \ + -I unit-tests/src $(COQSRCDIRS) $(COQCMXS) \ $(UNIT_CMXS) $< -o $<.test; $(HIDE)./$<.test -- cgit v1.2.3