aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe@linaro.org>2023-06-06 15:37:34 +0100
committerWill Deacon <will@kernel.org>2023-06-08 22:38:38 +0100
commit8f6cabb25d79c1a20e7fdf021339d200e9c901b7 (patch)
tree0e906261b0af812845fdb151543e3bdc49bc4234
parentb17552ee6c9728c20c9d0bd037ef134277daaa40 (diff)
downloadkvmtool-8f6cabb25d79c1a20e7fdf021339d200e9c901b7.tar.gz
Makefile: Refine -s handling in the make parameters
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> Link: https://lore.kernel.org/r/20230606143733.994679-2-jean-philippe@linaro.org Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ed2414bd..ec5f2b35 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 = @\#