diff mbox series

[RFC,11/11] kbuild: suppress echoing of commands in --dry-run mode

Message ID 20240819160309.2218114-12-vegard.nossum@oracle.com (mailing list archive)
State Handled Elsewhere
Headers show
Series output a valid shell script when running 'make -n' | expand

Commit Message

Vegard Nossum Aug. 19, 2024, 4:03 p.m. UTC
If the user ran 'make -n' then we will already print all commands.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
 Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index d08ade5791c2e..a1a3e96a10ea2 100644
--- a/Makefile
+++ b/Makefile
@@ -96,9 +96,10 @@  ifneq ($(findstring 1, $(KBUILD_VERBOSE)),)
   Q =
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-ifneq ($(findstring s,$(firstword -$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode) or -n (dry run mode),
+# suppress echoing of commands
+ifneq (,$(or $(findstring s,$(firstword -$(MAKEFLAGS))), \
+	$(findstring n,$(firstword -$(MAKEFLAGS)))))
 quiet=silent_
 override KBUILD_VERBOSE :=
 endif