Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] Makefile: identify silent make via firstword findstring
@ 2022-10-14 23:09 James Hilliard
  2022-10-30 20:26 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: James Hilliard @ 2022-10-14 23:09 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard

Make recommends using this technique for identifying short options.

From make NEWS for upcoming version 4.4:

Previously only simple (one-letter) options were added to the MAKEFLAGS
variable that was visible while parsing makefiles.  Now, all options are
available in MAKEFLAGS.  If you want to check MAKEFLAGS for a one-letter
option, expanding "$(firstword -$(MAKEFLAGS))" is a reliable way to return
the set of one-letter options which can be examined via findstring, etc.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index ec7c034ac1..2d31fd45fa 100644
--- a/Makefile
+++ b/Makefile
@@ -434,7 +434,7 @@ PACKAGES :=
 PACKAGES_ALL :=
 
 # silent mode requested?
-QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
+QUIET := $(if $(findstring s,$(firstword -$(MAKEFLAGS))),-q)
 
 # Strip off the annoying quoting
 ARCH := $(call qstrip,$(BR2_ARCH))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-10 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-14 23:09 [Buildroot] [PATCH 1/1] Makefile: identify silent make via firstword findstring James Hilliard
2022-10-30 20:26 ` Thomas Petazzoni via buildroot
2022-10-30 20:35   ` James Hilliard
2023-04-10 19:44     ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox