From 39cc36a979ce7606235709800bcb177cb2739920 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 9 Jan 2019 21:19:15 +0100 Subject: [PATCH 1/2] Makefile: run CMake with CMAKE_ARGS defined This ensures to re-run CMake when using something like: > CMAKE_ARGS="-DSTRICT_TESTS=true -DDO_COVERAGE=1 make check-unit --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index e2bfcef4..66a7feea 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,11 @@ all: $(TARGETS) ; $(TARGETS): cmake-build +# Run CMake always with CMAKE_ARGS defined. +ifdef CMAKE_ARGS +.PHONY: $(BUILDDIR)/Makefile +endif + $(BUILDDIR)/Makefile: $(ECHO) "Creating build directory and running cmake in it. You can also run CMake directly, if you want." $(ECHO) From 415c92a08a32e0deb8facccba3db197c89be56fd Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 12 Jan 2019 15:41:02 +0100 Subject: [PATCH 2/2] squash! Makefile: run CMake with CMAKE_ARGS defined Only if specified on command line. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1b9b232d..cc1476d4 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ cmake-build: $(BUILDDIR)/Makefile $(ECHO) "Building…" $(MAKE) -C $(BUILDDIR) -# Run CMake always with CMAKE_ARGS defined. -ifdef CMAKE_ARGS +# Run CMake with CMAKE_ARGS defined on command line ("make CMAKE_ARGS=…"). +ifeq ($(origin CMAKE_ARGS),command line) .PHONY: $(BUILDDIR)/Makefile endif