aboutsummaryrefslogtreecommitdiff
path: root/mathcomp/ssreflect
diff options
context:
space:
mode:
Diffstat (limited to 'mathcomp/ssreflect')
-rw-r--r--mathcomp/ssreflect/Makefile25
-rw-r--r--mathcomp/ssreflect/Makefile.coq-makefile31
-rw-r--r--mathcomp/ssreflect/Makefile.detect-coq-version31
3 files changed, 22 insertions, 65 deletions
diff --git a/mathcomp/ssreflect/Makefile b/mathcomp/ssreflect/Makefile
index 817a89c..2c1fc01 100644
--- a/mathcomp/ssreflect/Makefile
+++ b/mathcomp/ssreflect/Makefile
@@ -1,22 +1,15 @@
# -*- Makefile -*-
-COQPROJECT="Make"
+# setting variables
+COQPROJECT?=Make
+COQMAKEOPTIONS=--no-print-directory
-# --------------------------------------------------------------------
-# this sets variable V
-include Makefile.detect-coq-version
-# this defines prepare_coqmakefile
-include Makefile.coq-makefile
+# Main Makefile
include ../Makefile.common
# --------------------------------------------------------------------
-COQMAKEOPTIONS=--no-print-directory \
- COQDEP='$(COQDEP) -exclude-dir plugin -c'
-COQMAKEFILEOPTIONS=$(MLLIB) $(EXTRA)
-
-# --------------------------------------------------------------------
-.PHONY: pre_makefile
-BEFOREMAKEFILE=pre_makefile
-
-pre_makefile:
- $(call prepare_coqmakefile,.)
+# this sets variable V (coq version) and MLLIBEXTRA
+# assuming SSR is set to the directory which contains the ssreflect package
+SSR=.
+include Makefile.detect-coq-version
+COQMAKEFILEOPTIONS=$(MLLIBEXTRA)
diff --git a/mathcomp/ssreflect/Makefile.coq-makefile b/mathcomp/ssreflect/Makefile.coq-makefile
deleted file mode 100644
index e904236..0000000
--- a/mathcomp/ssreflect/Makefile.coq-makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-define prepare_coqmakefile
- (echo "Generating Makefile.coq for Coq $(V) with COQBIN=$(COQBIN)";\
- if [ "$$OS" = "Windows_NT" ]; then LN=cp; else LN="ln -sfr"; fi;\
- MLLIB=;\
- EXTRA=;\
- case $(V) in\
- v8.5*|v8.4*)\
- $$LN $(1)/plugin/$(V)/ssrmatching_plugin.mllib .;\
- $$LN $(1)/plugin/$(V)/ssrmatching.mli .;\
- $$LN $(1)/plugin/$(V)/ssrmatching.ml4 .;\
- $$LN $(1)/plugin/$(V)/ssrmatching.v $(1)/;\
- $$LN $(1)/plugin/$(V)/ssreflect_plugin.mllib .;\
- $$LN $(1)/plugin/$(V)/ssreflect.ml4 .;\
- $$LN $(1)/plugin/$(V)/ssrbool.v $(1)/;\
- $$LN $(1)/plugin/$(V)/ssrfun.v $(1)/;\
- $$LN $(1)/plugin/$(V)/ssreflect.v $(1)/;\
- MLLIB="ssrmatching_plugin.mllib ssreflect_plugin.mllib";\
- EXTRA="ssrmatching.mli ssrmatching.ml4 ssreflect.ml4";\
- ;;\
- v8.6*)\
- $$LN $(1)/plugin/$(V)/ssreflect_plugin.mlpack .;\
- $$LN $(1)/plugin/$(V)/ssreflect.ml4 .;\
- $$LN $(1)/plugin/$(V)/ssrbool.v $(1)/;\
- $$LN $(1)/plugin/$(V)/ssrfun.v $(1)/;\
- $$LN $(1)/plugin/$(V)/ssreflect.v $(1)/;\
- MLLIB=ssreflect_plugin.mlpack;\
- EXTRA="ssreflect.ml4";\
- ;;\
- esac
-endef
-
diff --git a/mathcomp/ssreflect/Makefile.detect-coq-version b/mathcomp/ssreflect/Makefile.detect-coq-version
index 9c00aa3..385c078 100644
--- a/mathcomp/ssreflect/Makefile.detect-coq-version
+++ b/mathcomp/ssreflect/Makefile.detect-coq-version
@@ -1,25 +1,20 @@
-BRANCH_coq = $(shell $(COQBIN)coqtop -v | head -1 | grep -E '(trunk|master)' \
+BRANCH_coq:= $(shell $(COQBIN)coqtop -v | head -1 | grep -E '(trunk|master)' \
| wc -l | sed 's/ *//g')
ifneq "$(BRANCH_coq)" "0"
-BRANCH_coq = trunk
+BRANCH_coq:= master
else
-BRANCH_coq = $(shell $(COQBIN)coqtop -v | head -1 \
- | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')
+BRANCH_coq:= $(shell $(COQBIN)coqtop -v | head -1 \
+ | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/\1/')
endif
-HASH_coq = $(shell echo Quit. | $(COQBIN)coqtop 2>/dev/null | head -1 \
- | sed 's/^.*(\([a-f0-9]*\)).*/\1/' )
+V:=$(BRANCH_coq)
-HASH_coq_v85beta1 = eaa3d0b15adf4eb11ffb00ab087746a5b15c4d5d
-HASH_coq_v85beta2 = 94afd8996251c30d2188a75934487009538e1303
-
-V=$(BRANCH_coq)
-ifeq "$(HASH_coq)" "$(HASH_coq_v85beta1)"
-V=v8.5beta1
-$(error "$(V) not supported: From X Require Y does not find X.Z.Y, use 8.4 or 8.5 > beta2")
-endif
-ifeq "$(HASH_coq)" "$(HASH_coq_v85beta2)"
-V=v8.5beta2
-$(error "$(V) not supported: From X Require Y does not find X.Z.Y (in coqdep), use 8.4 or 8.5 > beta2")
-endif
+MLLIBEXTRA:=$(shell \
+ if [ $(V) = "8.6" ];\
+ then cp $(SSR)/plugin/v$(V)/ssreflect_plugin.mlpack .;\
+ cp $(SSR)/plugin/v$(V)/ssreflect.ml4 .;\
+ cp $(SSR)/plugin/v$(V)/ssrbool.v $(SSR)/;\
+ cp $(SSR)/plugin/v$(V)/ssrfun.v $(SSR)/;\
+ cp $(SSR)/plugin/v$(V)/ssreflect.v $(SSR)/;\
+ echo "ssreflect_plugin.mlpack ssreflect.ml4"; fi)