qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target
Date: Thu, 18 Aug 2016 11:21:50 +0100

On 20 June 2016 at 16:19,  <address@hidden> wrote:
> From: Marc-André Lureau <address@hidden>
>
> 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 <address@hidden>
> ---
>  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 ?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]