All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target
@ 2016-06-20 15:19 marcandre.lureau
  2016-07-21 15:58 ` Marc-André Lureau
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: marcandre.lureau @ 2016-06-20 15:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, mdroth, berrange, Marc-André Lureau

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'
+	@echo  ''
+	@echo  'Test targets:'
+	@echo  '  check           - Run all tests (check-help for details)'
+	@echo  '  docker          - Build QEMU and run tests inside Docker containers'
+	@echo  '  test/speed      - Run TCG tests'
+	@echo  ''
+	@echo  'Documentation targets:'
+	@echo  '  dvi/html/'
+	@echo  '  info/pdf        - Build documentation in specified format'
+	@echo  ''
+	@echo  'Other generic targets:'
+	@echo  '  all             - Build all'
+	@echo  '  install         - Install QEMU, documentation and tools'
+	@echo  '  ctags/TAGS      - Generate tags file for editors'
+	@echo  '  cscope          - Generate cscope index'
+ifdef CONFIG_WIN32
+	@echo  ''
+	@echo  'Windows targets:'
+	@echo  '  installer       - Build NSIS-based installer'
+ifdef QEMU_GA_MSI_ENABLED
+	@echo  '  msi             - Build MSI-based installer'
+endif
+endif
+	@echo  ''
+	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2016-07-21 15:58 UTC (permalink / raw)
  To: QEMU; +Cc: Paolo Bonzini, Michael Roth, Marc-André Lureau

ping

On Mon, Jun 20, 2016 at 7:19 PM,  <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'
> +       @echo  ''
> +       @echo  'Test targets:'
> +       @echo  '  check           - Run all tests (check-help for details)'
> +       @echo  '  docker          - Build QEMU and run tests inside Docker containers'
> +       @echo  '  test/speed      - Run TCG tests'
> +       @echo  ''
> +       @echo  'Documentation targets:'
> +       @echo  '  dvi/html/'
> +       @echo  '  info/pdf        - Build documentation in specified format'
> +       @echo  ''
> +       @echo  'Other generic targets:'
> +       @echo  '  all             - Build all'
> +       @echo  '  install         - Install QEMU, documentation and tools'
> +       @echo  '  ctags/TAGS      - Generate tags file for editors'
> +       @echo  '  cscope          - Generate cscope index'
> +ifdef CONFIG_WIN32
> +       @echo  ''
> +       @echo  'Windows targets:'
> +       @echo  '  installer       - Build NSIS-based installer'
> +ifdef QEMU_GA_MSI_ENABLED
> +       @echo  '  msi             - Build MSI-based installer'
> +endif
> +endif
> +       @echo  ''
> +       @echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
> --
> 2.7.4
>
>



-- 
Marc-André Lureau

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2016-08-18 10:11 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: mdroth, berrange



On 20/06/2016 17: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'
> +	@echo  ''
> +	@echo  'Test targets:'
> +	@echo  '  check           - Run all tests (check-help for details)'
> +	@echo  '  docker          - Build QEMU and run tests inside Docker containers'

"docker" is a help target.

> +	@echo  '  test/speed      - Run TCG tests'
> +	@echo  ''
> +	@echo  'Documentation targets:'
> +	@echo  '  dvi/html/'
> +	@echo  '  info/pdf        - Build documentation in specified format'
> +	@echo  ''
> +	@echo  'Other generic targets:'
> +	@echo  '  all             - Build all'

Shouldn't "all" come first?

> +	@echo  '  install         - Install QEMU, documentation and tools'
> +	@echo  '  ctags/TAGS      - Generate tags file for editors'
> +	@echo  '  cscope          - Generate cscope index'
> +ifdef CONFIG_WIN32
> +	@echo  ''
> +	@echo  'Windows targets:'
> +	@echo  '  installer       - Build NSIS-based installer'
> +ifdef QEMU_GA_MSI_ENABLED
> +	@echo  '  msi             - Build MSI-based installer'

Build MSI-based installer for qemu-ga.

Paolo

> +endif
> +endif
> +	@echo  ''
> +	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target
  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
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2016-08-18 10:21 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: QEMU Developers, Paolo Bonzini, Michael Roth

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 ?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [RFC PATCH] build-sys: add make 'help' target
  2016-08-18 10:21 ` Peter Maydell
@ 2016-08-18 10:36   ` Marc-André Lureau
  0 siblings, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2016-08-18 10:36 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Marc-André Lureau, QEMU Developers, Paolo Bonzini, Michael Roth

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-18 10:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.