From 4199c23da311e612cb1ae45cf5519b5f3947c3b3 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Tue, 31 Jul 2018 10:37:25 +0200 Subject: Rework the whole Makefile architecture - Cleanup, refactoring and generalize the makefile architecture - Reuses @strub math-comp/analysis Makefile / Makefile.common organization - As #174, this fixes #88, but looks more stable than trying to fix the use of the MAKEFLAGS internal variable --- mathcomp/ssreflect/Makefile | 34 +++++++++++++------------------- mathcomp/ssreflect/Makefile.coq-makefile | 5 ++--- 2 files changed, 16 insertions(+), 23 deletions(-) (limited to 'mathcomp/ssreflect') diff --git a/mathcomp/ssreflect/Makefile b/mathcomp/ssreflect/Makefile index e4474c2..817a89c 100644 --- a/mathcomp/ssreflect/Makefile +++ b/mathcomp/ssreflect/Makefile @@ -1,28 +1,22 @@ -H=@ +# -*- Makefile -*- -ifeq "$(COQBIN)" "" -COQBIN=$(dir $(shell which coqtop))/ -endif +COQPROJECT="Make" +# -------------------------------------------------------------------- # this sets variable V include Makefile.detect-coq-version -# this defined coqmakefile +# this defines prepare_coqmakefile include Makefile.coq-makefile +include ../Makefile.common -COQDEP=$(COQBIN)coqdep +# -------------------------------------------------------------------- +COQMAKEOPTIONS=--no-print-directory \ + COQDEP='$(COQDEP) -exclude-dir plugin -c' +COQMAKEFILEOPTIONS=$(MLLIB) $(EXTRA) -OLD_MAKEFLAGS:=$(MAKEFLAGS) -MAKEFLAGS+=-B +# -------------------------------------------------------------------- +.PHONY: pre_makefile +BEFOREMAKEFILE=pre_makefile -.DEFAULT_GOAL := all - -%: - $(H)[ -e Makefile.coq ] || $(call coqmakefile,.) - $(H)MAKEFLAGS="$(OLD_MAKEFLAGS)" $(MAKE) --no-print-directory \ - -f Makefile.coq $* \ - COQDEP='$(COQDEP) -exclude-dir plugin -c' - -clean: - $(H)MAKEFLAGS="$(OLD_MAKEFLAGS)" $(MAKE) --no-print-directory \ - -f Makefile.coq clean - $(H)rm -f Makefile.coq +pre_makefile: + $(call prepare_coqmakefile,.) diff --git a/mathcomp/ssreflect/Makefile.coq-makefile b/mathcomp/ssreflect/Makefile.coq-makefile index ba0e5d7..e904236 100644 --- a/mathcomp/ssreflect/Makefile.coq-makefile +++ b/mathcomp/ssreflect/Makefile.coq-makefile @@ -1,4 +1,4 @@ -define coqmakefile +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=;\ @@ -26,7 +26,6 @@ define coqmakefile MLLIB=ssreflect_plugin.mlpack;\ EXTRA="ssreflect.ml4";\ ;;\ - esac;\ - $(COQBIN)coq_makefile -f Make $$MLLIB $$EXTRA -o Makefile.coq) + esac endef -- cgit v1.2.3