* [PATCH] Correctly deal with make that has an argument which contains an "s" @ 2010-04-26 20:56 Jason Wessel 2010-04-27 5:54 ` Américo Wang 2010-04-27 11:47 ` Michal Marek 0 siblings, 2 replies; 5+ messages in thread From: Jason Wessel @ 2010-04-26 20:56 UTC (permalink / raw) To: Michal Marek Cc: linux-kernel, Jason Wessel, Michal Marek, Andrew Morton, linux-kbuild When using remake, which is based on gnumake, if you invoke an example build as shown below, the build will become silent due to the top level make file incorrectly guessing that the end user wants a silent build because an argument that contained an "s" was used. remake --no-extended-errors Fix up the top level Makefile to use filter with a list of options that mean silent with the various revisions of gnumake, instead of findstring. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> CC: Michal Marek <mmarek@suse.cz> CC: Andrew Morton <akpm@linux-foundation.org> CC: linux-kbuild@vger.kernel.org --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index fa1db90..91ae299 100644 --- a/Makefile +++ b/Makefile @@ -294,7 +294,7 @@ endif # If the user is running make -s (silent mode), suppress echoing of # commands -ifneq ($(findstring s,$(MAKEFLAGS)),) +ifneq ($(filter s% -s% --silent --quiet,$(MAKEFLAGS)),) quiet=silent_ endif -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Correctly deal with make that has an argument which contains an "s" 2010-04-26 20:56 [PATCH] Correctly deal with make that has an argument which contains an "s" Jason Wessel @ 2010-04-27 5:54 ` Américo Wang 2010-04-27 11:47 ` Michal Marek 1 sibling, 0 replies; 5+ messages in thread From: Américo Wang @ 2010-04-27 5:54 UTC (permalink / raw) To: Jason Wessel; +Cc: Michal Marek, linux-kernel, Andrew Morton, linux-kbuild On Tue, Apr 27, 2010 at 4:56 AM, Jason Wessel <jason.wessel@windriver.com> wrote: > When using remake, which is based on gnumake, if you invoke > an example build as shown below, the build will become silent > due to the top level make file incorrectly guessing that > the end user wants a silent build because an argument that > contained an "s" was used. > > remake --no-extended-errors > > Fix up the top level Makefile to use filter with a list of > options that mean silent with the various revisions of gnumake, > instead of findstring. > > Signed-off-by: Jason Wessel <jason.wessel@windriver.com> > CC: Michal Marek <mmarek@suse.cz> > CC: Andrew Morton <akpm@linux-foundation.org> > CC: linux-kbuild@vger.kernel.org Acked-by: WANG Cong <xiyou.wangcong@gmail.com> Thanks. > --- > Makefile | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/Makefile b/Makefile > index fa1db90..91ae299 100644 > --- a/Makefile > +++ b/Makefile > @@ -294,7 +294,7 @@ endif > # If the user is running make -s (silent mode), suppress echoing of > # commands > > -ifneq ($(findstring s,$(MAKEFLAGS)),) > +ifneq ($(filter s% -s% --silent --quiet,$(MAKEFLAGS)),) > quiet=silent_ > endif > > -- > 1.6.3.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Correctly deal with make that has an argument which contains an "s" 2010-04-26 20:56 [PATCH] Correctly deal with make that has an argument which contains an "s" Jason Wessel 2010-04-27 5:54 ` Américo Wang @ 2010-04-27 11:47 ` Michal Marek 2012-01-05 22:46 ` Jason Wessel 1 sibling, 1 reply; 5+ messages in thread From: Michal Marek @ 2010-04-27 11:47 UTC (permalink / raw) To: Jason Wessel; +Cc: lkml, Andrew Morton, linux-kbuild, Américo Wang On 26.4.2010 22:56, Jason Wessel wrote: > When using remake, which is based on gnumake, if you invoke > an example build as shown below, the build will become silent > due to the top level make file incorrectly guessing that > the end user wants a silent build because an argument that > contained an "s" was used. > > remake --no-extended-errors BTW, make --warn-undefined-variables also triggers this (although no one will use this option on the kernel makefiles). > Fix up the top level Makefile to use filter with a list of > options that mean silent with the various revisions of gnumake, > instead of findstring. > > Signed-off-by: Jason Wessel <jason.wessel@windriver.com> > CC: Michal Marek <mmarek@suse.cz> > CC: Andrew Morton <akpm@linux-foundation.org> > CC: linux-kbuild@vger.kernel.org > --- > Makefile | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/Makefile b/Makefile > index fa1db90..91ae299 100644 > --- a/Makefile > +++ b/Makefile > @@ -294,7 +294,7 @@ endif > # If the user is running make -s (silent mode), suppress echoing of > # commands > > -ifneq ($(findstring s,$(MAKEFLAGS)),) > +ifneq ($(filter s% -s% --silent --quiet,$(MAKEFLAGS)),) I played a bit with GNU make 3.81. Checking for --silent and --quiet is not necessary, because make always stores the short option if available. Now I was wondering if the 's' option is always at the beginning, looking at make-3.81/main.c, it turns out that the order in which the options appear in $(MAKEFLAGS) is the reverse order of the switches array, where 's' is near the end of the array: { 's', flag, (char *) &silent_flag, 1, 1, 0, 0, 0, "silent" }, ^ store in $(MAKEFLAGS)? { 'S', flag_off, (char *) &keep_going_flag, 1, 1, 0, 0, (char *) &default_keep_going_flag, "no-keep-going" }, { 't', flag, (char *) &touch_flag, 1, 1, 1, 0, 0, "touch" }, { 'v', flag, (char *) &print_version_flag, 1, 1, 0, 0, 0, "version" }, { 'w', flag, (char *) &print_directory_flag, 1, 1, 0, 0, 0, "print-directory" }, { CHAR_MAX+3, flag, (char *) &inhibit_print_directory_flag, 1, 1, 0, 0, 0, "no-print-directory" }, { 'W', string, (char *) &new_files, 0, 0, 0, 0, 0, "what-if" }, { CHAR_MAX+4, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0, "warn-undefined-variables" }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 } The only other single-letter options that come after 's' (before 's' in the $(MAKEFLAGS) variable) are 't', which doesn't work with the kernel, and 'w', which doesn't work either (the Makefile adds --no-print-directory). So we can indeed get away with s% and -s% (until the next make version changes the sort order, that is ;)). Michal ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Correctly deal with make that has an argument which contains an "s" 2010-04-27 11:47 ` Michal Marek @ 2012-01-05 22:46 ` Jason Wessel 2012-01-08 13:24 ` Michal Marek 0 siblings, 1 reply; 5+ messages in thread From: Jason Wessel @ 2012-01-05 22:46 UTC (permalink / raw) To: Michal Marek; +Cc: lkml, Andrew Morton, linux-kbuild, Américo Wang [-- Attachment #1: Type: text/plain, Size: 1700 bytes --] On 04/27/2010 06:47 AM, Michal Marek wrote: > On 26.4.2010 22:56, Jason Wessel wrote: >> When using remake, which is based on gnumake, if you invoke >> an example build as shown below, the build will become silent >> due to the top level make file incorrectly guessing that >> the end user wants a silent build because an argument that >> contained an "s" was used. >> >> remake --no-extended-errors > > BTW, make --warn-undefined-variables also triggers this (although no one > will use this option on the kernel makefiles). > Might as well add it to the commit header for clarity. >> >> -ifneq ($(findstring s,$(MAKEFLAGS)),) >> +ifneq ($(filter s% -s% --silent --quiet,$(MAKEFLAGS)),) > > I played a bit with GNU make 3.81. Checking for --silent and --quiet is > not necessary, because make always stores the short option if available. > Now I was wondering if the 's' option is always at the beginning, > looking at make-3.81/main.c, it turns out that the order in which the > options appear in $(MAKEFLAGS) is the reverse order of the switches > array, where 's' is near the end of the array: > [clip] > > The only other single-letter options that come after 's' (before 's' in > the $(MAKEFLAGS) variable) are 't', which doesn't work with the kernel, > and 'w', which doesn't work either (the Makefile adds > --no-print-directory). So we can indeed get away with s% and -s% (until > the next make version changes the sort order, that is ;)). > This might be nearly a whole year later, but the problem is still there so perhaps we can reach some closure and get it fixed since it is fairly minor in the first place. :-) Version 2 of the original patch is attached. Thanks, Jason. [-- Attachment #2: 0001-Correctly-deal-with-make-that-has-an-argument-which-.patch --] [-- Type: text/x-diff, Size: 1290 bytes --] From: Jason Wessel <jason.wessel@windriver.com> Date: Thu, 5 Jan 2012 16:43:09 -0600 Subject: [PATCH] Correctly deal with make that has an argument which contains an "s" When using remake, which is based on gnumake, if you invoke an example build as shown below, the build will become silent due to the top level make file incorrectly guessing that the end user wants a silent build because an argument that contained an "s" was used. Here are two examples one with remake and one with straight gnumake. remake --no-extended-errors make --warn-undefined-variables Fix up the top level Makefile to use filter to parse the options that mean silent instead of findstring catching other random arguments containing an "s". Signed-off-by: Jason Wessel <jason.wessel@windriver.com> CC: Michal Marek <mmarek@suse.cz> CC: Andrew Morton <akpm@linux-foundation.org> CC: linux-kbuild@vger.kernel.org --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index adddd11..4b8ae04 100644 --- a/Makefile +++ b/Makefile @@ -312,7 +312,7 @@ endif # If the user is running make -s (silent mode), suppress echoing of # commands -ifneq ($(findstring s,$(MAKEFLAGS)),) +ifneq ($(filter s% -s%,$(MAKEFLAGS)),) quiet=silent_ endif -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Correctly deal with make that has an argument which contains an "s" 2012-01-05 22:46 ` Jason Wessel @ 2012-01-08 13:24 ` Michal Marek 0 siblings, 0 replies; 5+ messages in thread From: Michal Marek @ 2012-01-08 13:24 UTC (permalink / raw) To: Jason Wessel; +Cc: lkml, Andrew Morton, linux-kbuild, Américo Wang On Thu, Jan 05, 2012 at 04:46:30PM -0600, Jason Wessel wrote: > On 04/27/2010 06:47 AM, Michal Marek wrote: > > On 26.4.2010 22:56, Jason Wessel wrote: > >> When using remake, which is based on gnumake, if you invoke > >> an example build as shown below, the build will become silent > >> due to the top level make file incorrectly guessing that > >> the end user wants a silent build because an argument that > >> contained an "s" was used. > >> > >> remake --no-extended-errors > > [...] > This might be nearly a whole year later, but the problem is still > there so perhaps we can reach some closure and get it fixed since it > is fairly minor in the first place. :-) :-) > Version 2 of the original patch is attached. Thanks, applied. Michal ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-08 13:24 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-04-26 20:56 [PATCH] Correctly deal with make that has an argument which contains an "s" Jason Wessel 2010-04-27 5:54 ` Américo Wang 2010-04-27 11:47 ` Michal Marek 2012-01-05 22:46 ` Jason Wessel 2012-01-08 13:24 ` Michal Marek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox