diff options
Diffstat (limited to 'mathcomp')
| -rw-r--r-- | mathcomp/Makefile | 26 | ||||
| -rw-r--r-- | mathcomp/Makefile.common | 39 | ||||
| -rw-r--r-- | mathcomp/ssreflect/Makefile | 25 | ||||
| -rw-r--r-- | mathcomp/ssreflect/Makefile.coq-makefile | 31 | ||||
| -rw-r--r-- | mathcomp/ssreflect/Makefile.detect-coq-version | 31 |
5 files changed, 51 insertions, 101 deletions
diff --git a/mathcomp/Makefile b/mathcomp/Makefile index efc2ff8..2acfa83 100644 --- a/mathcomp/Makefile +++ b/mathcomp/Makefile @@ -1,23 +1,15 @@ # -*- Makefile -*- -COQPROJECT="Make" +# setting variables +COQPROJECT?=Make +COQMAKEOPTIONS=--no-print-directory -# -------------------------------------------------------------------- -# this sets variable V -include ssreflect/Makefile.detect-coq-version -# this defines prepare_coqmakefile -include ssreflect/Makefile.coq-makefile +# Main Makefile include Makefile.common # -------------------------------------------------------------------- -COQMAKEOPTIONS=--no-print-directory \ - COQDEP='$(COQDEP) -exclude-dir ssreflect/plugin -c' -COQMAKEFILEOPTIONS=$(MLLIB) $(EXTRA) - -# -------------------------------------------------------------------- -.PHONY: pre_makefile -BEFOREMAKEFILE=pre_makefile - -pre_makefile: - $(call prepare_coqmakefile,ssreflect) - +# this sets variable V (coq version) and MLLIBEXTRA +# assuming SSR is set to the directory which contains the ssreflect package +SSR=ssreflect +include ssreflect/Makefile.detect-coq-version +COQMAKEFILEOPTIONS=$(MLLIBEXTRA) diff --git a/mathcomp/Makefile.common b/mathcomp/Makefile.common index b07b78d..ea3d85c 100644 --- a/mathcomp/Makefile.common +++ b/mathcomp/Makefile.common @@ -1,33 +1,34 @@ # -*- Makefile -*- - -ifeq "$(COQBIN)" "" -COQBIN=$(dir $(shell which coqtop))/ -endif -ifeq "$(COQMAKEFILE)" "" -COQMAKEFILE=$(COQBIN)coq_makefile -endif -COQDEP=$(COQBIN)coqdep - -ifeq "$(COQPROJECT)" "" -COQPROJECT="_CoqProject" -endif +V?= +VERBOSE?=V +H:= $(if $(VERBOSE),,@) +# Options +COQBIN?=$(dir $(shell which coqtop)) +COQMAKEFILE?=$(COQBIN)coq_makefile +COQDEP?=$(COQBIN)coqdep +COQPROJECT?=_CoqProject +COQMAKEOPTIONS?= +COQMAKEFILEOPTIONS?= +BEFOREMAKEFILE?= # -------------------------------------------------------------------- .PHONY: all config build clean distclean __always__ .SUFFIXES: TOP = $(dir $(lastword $(MAKEFILE_LIST))) -COQMAKE = $(MAKE) -f Makefile.coq $(COQMAKEOPTIONS) +COQMAKE = $(MAKE) -f Makefile.this $(COQMAKEOPTIONS) # -------------------------------------------------------------------- all: config build # -------------------------------------------------------------------- -Makefile.coq: Makefile $(BEFOREMAKEFILE) +Makefile.coq: $(BEFOREMAKEFILE) Makefile $(COQMAKEFILE) $(COQMAKEFILEOPTIONS) -f $(COQPROJECT) -o Makefile.coq +Makefile.this: $(BEFOREMAKEFILES) Makefile.coq $(AFTERMAKEFILES) + cat $(BEFOREMAKEFILES) Makefile.coq $(AFTERMAKEFILES) > Makefile.this # -------------------------------------------------------------------- -config: sub-config this-config Makefile.coq +config: sub-config this-config Makefile.this build: sub-build this-build @@ -38,14 +39,14 @@ distclean: sub-distclean this-distclean # -------------------------------------------------------------------- .PHONY: this-config this-build this-distclean this-clean -this-build:: +this-build:: config +$(COQMAKE) -this-distclean:: this-clean - rm -f Makefile.coq Makefile.coq.conf +this-distclean:: this-clean $(OTHERCLEAN) + rm -f Makefile.coq Makefile.coq.conf Makefile.this this-clean:: - @if [ -f Makefile.coq ]; then $(COQMAKE) cleanall; fi + @if [ -f Makefile.this ]; then $(COQMAKE) cleanall; fi # -------------------------------------------------------------------- .PHONY: install 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) |
