From: "Marc-André Lureau" <mlureau@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Michael Roth" <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target
Date: Thu, 18 Aug 2016 06:36:59 -0400 (EDT) [thread overview]
Message-ID: <649636507.669341.1471516619832.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAFEAcA9ZviCQZpRLUJLGtBKW5gAvL57P5YBEFfHgw1DqL7JXFQ@mail.gmail.com>
Hi
----- Original Message -----
> On 20 June 2016 at 16:19, <marcandre.lureau@redhat.com> wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Add a make 'help', to print a summary of the main Makefile targets.
> > The format is loosely inspired by Linux make 'help' output.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> > Makefile | 33 +++++++++++++++++++++++++++++++++
> > 1 file changed, 33 insertions(+)
> >
> > diff --git a/Makefile b/Makefile
> > index 53e4119..c6bf3d6 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -666,3 +666,36 @@ endif
> > -include $(wildcard *.d tests/*.d)
> >
> > include $(SRC_PATH)/tests/docker/Makefile.include
> > +
> > +.PHONY: help
> > +help:
> > +
> > + @echo 'Cleaning targets:'
> > + @echo ' clean - Remove most generated files but keep
> > the config'
> > + @echo ' distclean - Remove all generated files'
> > + @echo ' dist - Build a distributable tarball'
>
> There's a cute trick which will let us put these help strings
> next to the actual makefile targets, which might make it easier
> for us to remember to update and add them: you have a rune
> something like
> help: ## Show this help.
> @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'
> |
> sed -e 's/##//'
>
> and then you can annotate all your targets with their doc strings:
>
> check: ## Run all tests
>
> Idea from https://gist.github.com/prwhite/8168133
>
> We'd need to elaborate it somewhat to add categories, but you get the
> general idea.
>
> Does this seem useful, or like overkill ?
Interesting, in fact I use a similar trick in some of my shell scripts:
https://github.com/elmarco/virgl-ci/blob/master/virgl-test.sh#L258
But tbh, I don't think it's so great, it's a bit overkill indeed.
prev parent reply other threads:[~2016-08-18 10:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 15:19 [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target marcandre.lureau
2016-07-21 15:58 ` Marc-André Lureau
2016-08-18 10:11 ` Paolo Bonzini
2016-08-18 10:21 ` Peter Maydell
2016-08-18 10:36 ` Marc-André Lureau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=649636507.669341.1471516619832.JavaMail.zimbra@redhat.com \
--to=mlureau@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.