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 |
On Mon, Aug 19, 2024 at 06:03:08PM +0200, Vegard Nossum wrote: > 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 --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 > -- > 2.34.1 > I think it makes sense to apply this patch earlier. Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
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
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(-)