summaryrefslogtreecommitdiff
path: root/tests/coq/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/coq/Makefile')
-rw-r--r--tests/coq/Makefile22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/coq/Makefile b/tests/coq/Makefile
index a9c170f7..8dee394b 100644
--- a/tests/coq/Makefile
+++ b/tests/coq/Makefile
@@ -1,11 +1,15 @@
-ALL_DIRS ?= $(filter-out Makefile%, $(wildcard *))
+ALL_DIRS ?= $(filter-out %.template, $(filter-out Makefile%, $(wildcard *)))
VERIFY_DIRS = $(addprefix verif-,$(ALL_DIRS))
CLEAN_DIRS = $(addprefix clean-,$(ALL_DIRS))
+COPY_MAKEFILES = $(addprefix copy-makefile-,$(ALL_DIRS))
+
+GEN_COQ_PROJECT = $(addprefix gen-coq-project-,$(ALL_DIRS))
+
.PHONY: all
-all: $(VERIFY_DIRS)
+all: $(COPY_MAKEFILES) $(GEN_COQ_PROJECT) $(VERIFY_DIRS)
.PHONY: clean
clean: $(CLEAN_DIRS)
@@ -14,6 +18,20 @@ clean: $(CLEAN_DIRS)
verif-%:
cd $* && make all
+.PHONY: copy-makefile-%
+copy-makefile-%:
+ rm -f $*/Makefile
+ echo "# This file was automatically generated - modify ../Makefile.template instead" >> $*/Makefile
+ cat Makefile.template >> $*/Makefile
+
+.PHONY: gen-coq-project-%
+gen-coq-project-%:
+ rm -f $*/_CoqProject
+ echo "# This file was automatically generated - see ../Makefile" >> $*/_CoqProject
+ cat _CoqProject.template >> $*/_CoqProject
+ echo $(patsubst $*/%,"\n"%,$(wildcard $*/*.v)) >> $*/_CoqProject
+ sed -i -z "s/ \n/\n/g" $*/_CoqProject
+
.PHONY: clean-%
clean-%:
cd $* && make clean