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 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'mathcomp/ssreflect/Makefile') 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,.) -- cgit v1.2.3 From 7d7b0688c818c5dde68d2b2bfc8ba3aecfe017d6 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Tue, 31 Jul 2018 15:20:43 +0200 Subject: removing dead code + reshuffling stuff --- mathcomp/ssreflect/Makefile | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'mathcomp/ssreflect/Makefile') 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) -- cgit v1.2.3 From 5892b9b06ec9cd16584c4c56884949c23949cffe Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Tue, 31 Jul 2018 16:06:28 +0200 Subject: change coqdep --- mathcomp/ssreflect/Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mathcomp/ssreflect/Makefile') diff --git a/mathcomp/ssreflect/Makefile b/mathcomp/ssreflect/Makefile index 2c1fc01..8587073 100644 --- a/mathcomp/ssreflect/Makefile +++ b/mathcomp/ssreflect/Makefile @@ -2,6 +2,8 @@ # setting variables COQPROJECT?=Make +BEFOREMAKEFILES+=Makefile.coqdep +OTHERCLEAN+=Makefile.coqdep COQMAKEOPTIONS=--no-print-directory # Main Makefile @@ -13,3 +15,6 @@ include ../Makefile.common SSR=. include Makefile.detect-coq-version COQMAKEFILEOPTIONS=$(MLLIBEXTRA) + +Makefile.coqdep: + echo "COQDEP=$(COQDEP) -exclude-dir ssreflect/plugin -c" > Makefile.coqdep -- cgit v1.2.3 From 629a7a065146679f14f95abf1de63a7ff3a2eacc Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Tue, 31 Jul 2018 16:17:07 +0200 Subject: agressive fix for duplicated files! --- mathcomp/ssreflect/Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mathcomp/ssreflect/Makefile') diff --git a/mathcomp/ssreflect/Makefile b/mathcomp/ssreflect/Makefile index 8587073..c3092fc 100644 --- a/mathcomp/ssreflect/Makefile +++ b/mathcomp/ssreflect/Makefile @@ -2,8 +2,6 @@ # setting variables COQPROJECT?=Make -BEFOREMAKEFILES+=Makefile.coqdep -OTHERCLEAN+=Makefile.coqdep COQMAKEOPTIONS=--no-print-directory # Main Makefile @@ -11,10 +9,9 @@ include ../Makefile.common # -------------------------------------------------------------------- # this sets variable V (coq version) and MLLIBEXTRA -# assuming SSR is set to the directory which contains the ssreflect package +# assuming PLUGIN is set to the directory which contains the plugins +PLUGIN=../../plugin/ SSR=. include Makefile.detect-coq-version -COQMAKEFILEOPTIONS=$(MLLIBEXTRA) -Makefile.coqdep: - echo "COQDEP=$(COQDEP) -exclude-dir ssreflect/plugin -c" > Makefile.coqdep +COQMAKEFILEOPTIONS=$(MLLIBEXTRA) -- cgit v1.2.3