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