[PATCH] selftests: lib.mk: Do not print the build steps with make -s

From: Sasha Levin

Date: Tue Dec 01 2026 - 13:09:08 EST


lib.mk prints a line for each program it builds, also when make runs
with -s:

$ make -s -C tools/testing/selftests/acct
CC acct_syscall
CC taskstats_fill_stats_tgid
CC cgroupstats

Leave msg empty with -s, so that only warnings and errors are printed.

Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
tools/testing/selftests/lib.mk | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 506cb26510e4d..8034da31fbc15 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -70,7 +70,9 @@ Q =
msg =
else
Q = @
+ifeq ($(findstring s,$(firstword -$(MAKEFLAGS))),)
msg = @printf ' %-8s%s %s%s\n' "$(1)" "$(if $(2), [$(2)])" "$(notdir $(3))" "$(if $(4), $(4))";
+endif
MAKEFLAGS += --no-print-directory
endif

--
2.53.0