diff mbox series

[kvmtool,1/3] Makefile: Refine -s handling in the make parameters

Message ID 20230606143733.994679-2-jean-philippe@linaro.org (mailing list archive)
State New, archived
Headers show
Series Build fixes | expand

Commit Message

Jean-Philippe Brucker June 6, 2023, 2:37 p.m. UTC
When looking for the silent flag 's' in MAKEFLAGS we accidentally catch
variable definitions like "ARCH=mips" or "CROSS_COMPILE=/cross/...",
causing several test builds to be silent.

MAKEFLAGS contains the single-letter make flags (without the dash),
followed by flags that don't have a single-letter equivalent such as
"--warn-undefined-variables" (with the dashes), followed by "--" and
command-line variables. For example `make ARCH=mips -k' results in
MAKEFLAGS "k -- ARCH=mips". Running $(filter-out --%) on this does not
discard ARCH=mips, only "--". However adding $(firstword) ensures that
we run the filter either on the single-letter flags or on something
beginning with "--", and avoids silent builds.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 6b742369..e711670d 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ 
 #
 
 ifeq ($(strip $(V)),)
-	ifeq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+	ifeq ($(findstring s,$(filter-out --%,$(firstword $(MAKEFLAGS)))),)
 		E = @echo
 	else
 		E = @\#