diff options
| author | Enrico Tassi | 2015-07-28 11:16:38 +0200 |
|---|---|---|
| committer | Enrico Tassi | 2015-07-28 11:17:04 +0200 |
| commit | 2e6d512c29c72bb220dacabc79392334283d604e (patch) | |
| tree | 82c553a6b1b7bb09c48d909c72ad9529835870c6 | |
| parent | ab806317d7f364eaf74a3a23e25abd37882b2be5 (diff) | |
factor common Makefile stuff
| -rw-r--r-- | mathcomp/Makefile | 21 | ||||
| -rw-r--r-- | mathcomp/ssreflect/Makefile | 27 | ||||
| -rw-r--r-- | mathcomp/ssreflect/Makefile.coq-makefile | 9 | ||||
| -rw-r--r-- | mathcomp/ssreflect/Makefile.detect-coq-version | 16 |
4 files changed, 35 insertions, 38 deletions
diff --git a/mathcomp/Makefile b/mathcomp/Makefile index 880977c..120c127 100644 --- a/mathcomp/Makefile +++ b/mathcomp/Makefile @@ -4,17 +4,15 @@ ifeq "$(COQBIN)" "" COQBIN=$(dir $(shell which coqtop))/ endif -ifeq "$(shell $(COQBIN)/coqtop -v | head -1 | grep trunk | wc -l | sed 's/ *//g')" "1" -V=trunk -else -V=$(shell $(COQBIN)/coqtop -v | head -1 | \ - sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/') -endif +# this sets variable V +include ssreflect/Makefile.detect-coq-version +# this defined coqmakefile +include Makefile.coq-makefile ifeq "$V" "v8.4" COQDEP=../etc/utils/ssrcoqdep else -COQDEP=$(COQBIN)/coqdep +COQDEP=$(COQBIN)coqdep endif OLD_MAKEFLAGS:=$(MAKEFLAGS) @@ -29,15 +27,6 @@ MAKEFLAGS+=-B -f Makefile.coq $* \ COQDEP='$(COQDEP) -exclude-dir plugin -c' -define coqmakefile - (echo "Generating Makefile.coq for Coq $(V) with COQBIN=$(COQBIN)";\ - ln -sf ssreflect/plugin/$(V)/ssreflect.mllib .;\ - ln -sf ssreflect/plugin/$(V)/ssrmatching.mli .;\ - ln -sf ssreflect/plugin/$(V)/ssrmatching.ml4 .;\ - ln -sf ssreflect/plugin/$(V)/ssreflect.ml4 .;\ - $(COQBIN)/coq_makefile -f Make -o Makefile.coq) -endef - clean: $(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \ -f Makefile.coq clean diff --git a/mathcomp/ssreflect/Makefile b/mathcomp/ssreflect/Makefile index b97c47a..af5a204 100644 --- a/mathcomp/ssreflect/Makefile +++ b/mathcomp/ssreflect/Makefile @@ -4,23 +4,15 @@ ifeq "$(COQBIN)" "" COQBIN=$(dir $(shell which coqtop))/ endif -BRANCH_coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/') - -HASH_coq = $(shell echo Quit. | $(COQBIN)/coqtop 2>&1 | head -1 | sed 's/^.*(\([a-f0-9]*\)).*/\1/' ) - -HASH_coq_v85beta1 = eaa3d0b15adf4eb11ffb00ab087746a5b15c4d5d - - -ifeq "$(HASH_coq)" "$(HASH_coq_v85beta1)" -V=v8.5beta1 -else -V=$(BRANCH_coq) -endif +# this sets variable V +include Makefile.detect-coq-version +# this defined coqmakefile +include Makefile.coq-makefile ifeq "$V" "v8.4" COQDEP=../../etc/utils/ssrcoqdep else -COQDEP=$(COQBIN)/coqdep +COQDEP=$(COQBIN)coqdep endif OLD_MAKEFLAGS:=$(MAKEFLAGS) @@ -35,15 +27,6 @@ MAKEFLAGS+=-B -f Makefile.coq $* \ COQDEP='$(COQDEP) -exclude-dir plugin -c' -define coqmakefile - (echo "Generating Makefile.coq for Coq $(V) with COQBIN=$(COQBIN)";\ - ln -sf plugin/$(V)/ssreflect.mllib .;\ - ln -sf plugin/$(V)/ssrmatching.mli .;\ - ln -sf plugin/$(V)/ssrmatching.ml4 .;\ - ln -sf plugin/$(V)/ssreflect.ml4 .;\ - $(COQBIN)/coq_makefile -f Make -o Makefile.coq) -endef - clean: $(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \ -f Makefile.coq clean diff --git a/mathcomp/ssreflect/Makefile.coq-makefile b/mathcomp/ssreflect/Makefile.coq-makefile new file mode 100644 index 0000000..99f3d6b --- /dev/null +++ b/mathcomp/ssreflect/Makefile.coq-makefile @@ -0,0 +1,9 @@ +define coqmakefile + (echo "Generating Makefile.coq for Coq $(V) with COQBIN=$(COQBIN)";\ + ln -sf plugin/$(V)/ssreflect.mllib .;\ + ln -sf plugin/$(V)/ssrmatching.mli .;\ + ln -sf plugin/$(V)/ssrmatching.ml4 .;\ + ln -sf plugin/$(V)/ssreflect.ml4 .;\ + $(COQBIN)coq_makefile -f Make -o Makefile.coq) +endef + diff --git a/mathcomp/ssreflect/Makefile.detect-coq-version b/mathcomp/ssreflect/Makefile.detect-coq-version new file mode 100644 index 0000000..7f2202d --- /dev/null +++ b/mathcomp/ssreflect/Makefile.detect-coq-version @@ -0,0 +1,16 @@ +BRANCH_coq = $(shell $(COQBIN)coqtop -v | head -1 \ + | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/') + +HASH_coq = $(shell echo Quit. | $(COQBIN)coqtop 2>&1 | head -1 \ + | sed 's/^.*(\([a-f0-9]*\)).*/\1/' ) + +HASH_coq_v85beta1 = eaa3d0b15adf4eb11ffb00ab087746a5b15c4d5d +HASH_coq_v85beta2 = 94afd8996251c30d2188a75934487009538e1303 + +V=$(BRANCH_coq) +ifeq "$(HASH_coq)" "$(HASH_coq_v85beta1)" +V=v8.5beta1 +endif +ifeq "$(HASH_coq)" "$(HASH_coq_v85beta2)" +V=v8.5beta2 +endif |
