aboutsummaryrefslogtreecommitdiff
path: root/mathcomp
diff options
context:
space:
mode:
authorEnrico2018-10-29 08:04:41 +0100
committerGitHub2018-10-29 08:04:41 +0100
commita284d596c6f8e4d95a08bf37b030ba492b68e162 (patch)
treeb6420bd76d23249c428dc3f40d501325730ddbbc /mathcomp
parent91a4286ddc1a1f85b6719318be52bce88a3aff32 (diff)
parent94dd4260f6e281ddf3c8e3320fdc239a94f50b6d (diff)
Merge pull request #219 from CohenCyril/Makefile
fix some bugs in Makefile
Diffstat (limited to 'mathcomp')
-rw-r--r--mathcomp/Makefile.common18
-rw-r--r--mathcomp/ssreflect/Makefile.detect-coq-version24
2 files changed, 22 insertions, 20 deletions
diff --git a/mathcomp/Makefile.common b/mathcomp/Makefile.common
index 3f45682..c523410 100644
--- a/mathcomp/Makefile.common
+++ b/mathcomp/Makefile.common
@@ -23,6 +23,18 @@ VERBOSE?=V
H:= $(if $(VERBOSE),,@) # not used yet
TOP = $(dir $(lastword $(MAKEFILE_LIST)))
COQMAKE = $(MAKE) -f Makefile.coq $(COQMAKEOPTIONS)
+BRANCH_coq:= $(shell $(COQBIN)coqtop -v | head -1 | grep -E '(trunk|master)' \
+ | wc -l | sed 's/ *//g')
+
+# coq version:
+ifneq "$(BRANCH_coq)" "0"
+COQVVV:= dev
+else
+COQVVV:=$(shell $(COQBIN)coqtop --print-version | cut -d" " -f1)
+endif
+
+COQV:= $(shell echo $(COQVVV) | cut -d"." -f1)
+COQVV:= $(shell echo $(COQVVV) | cut -d"." -f1-2)
# all: ---------------------------------------------------------------
all: config build
@@ -30,7 +42,7 @@ all: config build
# Makefile.coq: ------------------------------------------------------
.PHONY: pre-makefile
-Makefile.coq: pre-makefile Makefile
+Makefile.coq: pre-makefile $(COQPROJECT) Makefile
$(COQMAKEFILE) $(COQMAKEFILEOPTIONS) -f $(COQPROJECT) -o Makefile.coq
# Global config, build, clean and distclean --------------------------
@@ -50,7 +62,7 @@ this-config:: __always__
this-build:: this-config Makefile.coq
+$(COQMAKE)
-this-distclean:: this-clean $(OTHERCLEAN)
+this-distclean:: this-clean
rm -f Makefile.coq Makefile.coq.conf Makefile.coq
this-clean:: __always__
@@ -64,7 +76,7 @@ install: __always__ Makefile.coq
# counting lines of Coq code -----------------------------------------
.PHONY: count
-COQFILES := $(shell grep '.v$$' Make)
+COQFILES = $(shell grep '.v$$' $(COQPROJECT))
count:
@coqwc $(COQFILES) | tail -1 | \
diff --git a/mathcomp/ssreflect/Makefile.detect-coq-version b/mathcomp/ssreflect/Makefile.detect-coq-version
index c6a981a..d2e8dce 100644
--- a/mathcomp/ssreflect/Makefile.detect-coq-version
+++ b/mathcomp/ssreflect/Makefile.detect-coq-version
@@ -1,18 +1,8 @@
-BRANCH_coq:= $(shell $(COQBIN)coqtop -v | head -1 | grep -E '(trunk|master)' \
- | wc -l | sed 's/ *//g')
-
-ifneq "$(BRANCH_coq)" "0"
-COQVERSION:= master
-else
-COQVERSION:= $(shell $(COQBIN)coqtop -v | head -1 \
- | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/\1/')
-endif
-
-MLLIBEXTRA:=$(shell \
- if [ $(COQVERSION) = "8.6" ];\
- then cp $(PLUGIN)/v$(COQVERSION)/ssreflect_plugin.mlpack .;\
- cp $(PLUGIN)/v$(COQVERSION)/ssreflect.ml4 .;\
- cp $(PLUGIN)/v$(COQVERSION)/ssrbool.v $(SSR)/;\
- cp $(PLUGIN)/v$(COQVERSION)/ssrfun.v $(SSR)/;\
- cp $(PLUGIN)/v$(COQVERSION)/ssreflect.v $(SSR)/;\
+MLLIBEXTRA=$(shell \
+ if [ $(COQVV) = "8.6" ];\
+ then cp $(PLUGIN)/v$(COQVV)/ssreflect_plugin.mlpack .;\
+ cp $(PLUGIN)/v$(COQVV)/ssreflect.ml4 .;\
+ cp $(PLUGIN)/v$(COQVV)/ssrbool.v $(SSR)/;\
+ cp $(PLUGIN)/v$(COQVV)/ssrfun.v $(SSR)/;\
+ cp $(PLUGIN)/v$(COQVV)/ssreflect.v $(SSR)/;\
echo "ssreflect_plugin.mlpack ssreflect.ml4"; fi)