aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2023-10-08 23:22:50 +0200
committerNamhyung Kim <[email protected]>2023-10-18 15:29:35 -0700
commitd9997f7ffb137447aa2f820c26cb1e6f5890d978 (patch)
treee398c50eb44f433bcdcb920d61c034e71777d8d2
parent9a13ee457a6e7a850ac1d145b0731b1d729b8f42 (diff)
tools/build: Fix -s detection code in tools/build/Makefile.build
As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make. Changing the tools/build -s option detection the same way as it was fixed for root Makefile in [1]. [1] 4bf73588165b ("kbuild: Port silent mode detection to future gnu make.") Cc: Dmitry Goncharov <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: KP Singh <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Song Liu <[email protected]> Cc: Yonghong Song <[email protected]> Cc: John Fastabend <[email protected]> Cc: Hao Luo <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Stanislav Fomichev <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Quentin Monnet <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
-rw-r--r--tools/build/Makefile.build10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index fac42486a8cf..5fb3fb3d97e0 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -20,7 +20,15 @@ else
Q=@
endif
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands
+# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
+ifeq ($(filter 3.%,$(MAKE_VERSION)),)
+short-opts := $(firstword -$(MAKEFLAGS))
+else
+short-opts := $(filter-out --%,$(MAKEFLAGS))
+endif
+
+ifneq ($(findstring s,$(short-opts)),)
quiet=silent_
endif