From 94dd4260f6e281ddf3c8e3320fdc239a94f50b6d Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Wed, 8 Aug 2018 17:20:04 +0200 Subject: fix some bugs in Makefile --- mathcomp/Makefile.common | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'mathcomp/Makefile.common') 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 | \ -- cgit v1.2.3