lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081220192543.GA2162@uranus.ravnborg.org>
Date:	Sat, 20 Dec 2008 20:25:44 +0100
From:	Sam Ravnborg <sam@...nborg.org>
To:	Vegard Nossum <vegard.nossum@...il.com>
Cc:	kbuild <linux-kbuild@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>,
	Mike Frysinger <vapier@...too.org>
Subject: Re: [PATCH 04/26] kbuild: introduce $(kecho) convenience echo

On Sat, Dec 20, 2008 at 04:13:36PM +0100, Vegard Nossum wrote:
> Hi,
> 
> On Sat, Dec 20, 2008 at 3:31 PM, Sam Ravnborg <sam@...nborg.org> wrote:
> > From: Mike Frysinger <vapier@...too.org>
> >
> > There is a bunch of places in the build system where we do 'echo' to show
> > some nice status lines.  This means we still get output when running in
> > silent mode.  So declare a new KECHO variable that only does 'echo' when we
> > are in a suitable verbose build mode.
> >
> > Signed-off-by: Mike Frysinger <vapier@...too.org>
> > [sam: added Documentation]
> > Signed-off-by: Sam Ravnborg <sam@...nborg.org>
> > ---
> >  Documentation/kbuild/makefiles.txt |   14 ++++++++++++++
> >  scripts/Kbuild.include             |    7 +++++++
> >  2 files changed, 21 insertions(+), 0 deletions(-)
> >
> > diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
> > index 7a77533..51104f9 100644
> > --- a/Documentation/kbuild/makefiles.txt
> > +++ b/Documentation/kbuild/makefiles.txt
> > @@ -383,6 +383,20 @@ more details, with real examples.
> >        to prerequisites are referenced with $(src) (because they are not
> >        generated files).
> >
> > +    $(kecho)
> > +       echoing information to user in a rule is often a good practice
> > +       but when execution "make -s" one does not expect to see any output
> > +       except for warnings/errors.
> > +       To support this kbuild define $(kecho) which will echo out the
> > +       text following $(kecho) to stdout except if "make -s" is used.
> > +
> > +       Example:
> > +               #arch/blackfin/boot/Makefile
> > +               $(obj)/vmImage: $(obj)/vmlinux.gz
> > +                       $(call if_changed,uimage)
> > +                       @$(kecho) 'Kernel: $@ is ready'
> > +
> > +
> >  --- 3.11 $(CC) support functions
> >
> >        The kernel may be built with several different versions of
> > diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> > index 936940b..8cf87e8 100644
> > --- a/scripts/Kbuild.include
> > +++ b/scripts/Kbuild.include
> > @@ -25,6 +25,13 @@ basetarget = $(basename $(notdir $@))
> >  escsq = $(subst $(squote),'\$(squote)',$1)
> >
> >  ###
> > +# Easy method for doing a status message
> > +       kecho := :
> > + quiet_kecho := echo
> > +silent_kecho := :
> > +kecho := $($(quiet)kecho)
> 
> Hm, why don't we put
> 
>   +kecho := @$($(quiet)kecho)
> 
> instead, so each caller can omit the @? And the example would then be:
> 
> > +               $(obj)/vmImage: $(obj)/vmlinux.gz
> > +                       $(call if_changed,uimage)
> > +                       $(kecho) 'Kernel: $@ is ready'
> 
> It seems to work correctly over here.

kecho is used in scripts too where the '@' does not fly.
I considered adding another variant for scripts but that was too much
compared to the few users.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ