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/Makefile | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'mathcomp/Makefile') diff --git a/mathcomp/Makefile b/mathcomp/Makefile index 07f1869..efc2ff8 100644 --- a/mathcomp/Makefile +++ b/mathcomp/Makefile @@ -1,30 +1,23 @@ -H=@ +# -*- Makefile -*- -ifeq "$(COQBIN)" "" -COQBIN=$(dir $(shell which coqtop))/ -endif +COQPROJECT="Make" +# -------------------------------------------------------------------- # this sets variable V include ssreflect/Makefile.detect-coq-version -# this defined coqmakefile +# this defines prepare_coqmakefile include ssreflect/Makefile.coq-makefile +include Makefile.common -COQDEP=$(COQBIN)coqdep +# -------------------------------------------------------------------- +COQMAKEOPTIONS=--no-print-directory \ + COQDEP='$(COQDEP) -exclude-dir ssreflect/plugin -c' +COQMAKEFILEOPTIONS=$(MLLIB) $(EXTRA) -OLD_MAKEFLAGS:=$(MAKEFLAGS) -MAKEFLAGS+=-B +# -------------------------------------------------------------------- +.PHONY: pre_makefile +BEFOREMAKEFILE=pre_makefile -.DEFAULT_GOAL := all +pre_makefile: + $(call prepare_coqmakefile,ssreflect) -%: - $(H)[ -e Makefile.coq ] || $(call coqmakefile,ssreflect) - # Override COQDEP to find only the "right" copy .ml files - $(H)MAKEFLAGS="$(OLD_MAKEFLAGS)" $(MAKE) --no-print-directory \ - -f Makefile.coq $* \ - COQDEP='$(COQDEP) -exclude-dir plugin -c' - -clean: - $(H)[ -e Makefile.coq ] || $(call coqmakefile,ssreflect) - $(H)MAKEFLAGS="$(OLD_MAKEFLAGS)" $(MAKE) --no-print-directory \ - -f Makefile.coq clean - $(H)rm -f Makefile.coq -- 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/Makefile | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'mathcomp/Makefile') 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) -- 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/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mathcomp/Makefile') diff --git a/mathcomp/Makefile b/mathcomp/Makefile index 2acfa83..9064020 100644 --- a/mathcomp/Makefile +++ b/mathcomp/Makefile @@ -9,7 +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 +# and SSR is set to the directory of the ssreflect package +PLUGIN=../plugin SSR=ssreflect include ssreflect/Makefile.detect-coq-version COQMAKEFILEOPTIONS=$(MLLIBEXTRA) -- cgit v1.2.3