GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
O=/path, FOO=bar). The silent-mode check searches for "s" and can match
an override value, forcing silent output even without -s.
Use MFLAGS for short options and filter out any long options before
searching for "s". This preserves -s detection while avoiding false
positives from overrides.
Fixes: 4fdb4b71b152 ("xen/build: introduce if_changed and if_changed_rule")
Signed-off-by: Bertrand Marquis <[email protected]>
---
xen/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/xen/Makefile b/xen/Makefile
index 13e336ba5484..5fc725fb02db 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
Q := @
endif
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (short options only). MAKEFLAGS may include variable overrides
+# after ā--ā (GNU make greater than 4.4), which can contain an āsā and falsely
+# trigger silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
quiet := silent_
endif
--
2.52.0