diff options
author | Jiri Olsa <jolsa@kernel.org> | 2023-10-08 23:22:51 +0200 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2023-10-19 00:29:47 +0200 |
commit | b5c532e90478e134b66b067c2b0487526ac4161e (patch) | |
tree | 35aec88f528685a6d724023cf3a550ac512a6ca0 /tools/scripts | |
parent | tools/build: Fix -s detection code in tools/build/Makefile.build (diff) | |
download | linux-b5c532e90478e134b66b067c2b0487526ac4161e.tar.xz linux-b5c532e90478e134b66b067c2b0487526ac4161e.zip |
tools/build: Fix -s detection code in tools/scripts/Makefile.include
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 <dgoncharov@users.sf.net>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: KP Singh <kpsingh@chromium.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Stanislav Fomichev <sdf@google.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Quentin Monnet <quentin@isovalent.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: bpf@vger.kernel.org
Cc: linux-perf-users@vger.kernel.org
Link: https://lore.kernel.org/r/20231008212251.236023-3-jolsa@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/scripts')
-rw-r--r-- | tools/scripts/Makefile.include | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index ff527ac065cf..6fba29f3222d 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -136,7 +136,15 @@ else NO_SUBDIR = : 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)),) silent=1 endif |