aboutsummaryrefslogtreecommitdiff
path: root/mathcomp/Makefile.common
diff options
context:
space:
mode:
authorEnrico2018-10-29 08:04:41 +0100
committerGitHub2018-10-29 08:04:41 +0100
commita284d596c6f8e4d95a08bf37b030ba492b68e162 (patch)
treeb6420bd76d23249c428dc3f40d501325730ddbbc /mathcomp/Makefile.common
parent91a4286ddc1a1f85b6719318be52bce88a3aff32 (diff)
parent94dd4260f6e281ddf3c8e3320fdc239a94f50b6d (diff)
Merge pull request #219 from CohenCyril/Makefile
fix some bugs in Makefile
Diffstat (limited to 'mathcomp/Makefile.common')
-rw-r--r--mathcomp/Makefile.common18
1 files changed, 15 insertions, 3 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 | \