* [PATCH 0/2] Makefile: Re-indent 'help' target and list tools
@ 2020-03-05 0:48 Philippe Mathieu-Daudé
2020-03-05 0:48 ` [PATCH 1/2] Makefile: Align 'help' target output Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-05 0:48 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Paolo Bonzini, Alex Bennée,
Philippe Mathieu-Daudé
This series improves the 'make help' output:
- re-indent current output
- list tools targets:
$ make help
[...]
Architecture specific targets:
x86_64-softmmu/all - Build for x86_64-softmmu
Tools targets:
qemu-ga - Build qemu-ga tool
qemu-keymap - Build qemu-keymap tool
elf2dmp - Build elf2dmp tool
ivshmem-client - Build ivshmem-client tool
ivshmem-server - Build ivshmem-server tool
qemu-nbd - Build qemu-nbd tool
qemu-img - Build qemu-img tool
qemu-io - Build qemu-io tool
qemu-edid - Build qemu-edid tool
fsdev/virtfs-proxy-helper - Build virtfs-proxy-helper tool
scsi/qemu-pr-helper - Build qemu-pr-helper tool
Cleaning targets:
clean - Remove most generated files but keep t=
he config
distclean - Remove all generated files
dist - Build a distributable tarball
Philippe Mathieu-Daud=C3=A9 (2):
Makefile: Align 'help' target output
Makefile: Let the 'help' target list the tools targets
Makefile | 49 ++++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 21 deletions(-)
--=20
2.21.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] Makefile: Align 'help' target output
2020-03-05 0:48 [PATCH 0/2] Makefile: Re-indent 'help' target and list tools Philippe Mathieu-Daudé
@ 2020-03-05 0:48 ` Philippe Mathieu-Daudé
2020-03-05 0:48 ` [PATCH 2/2] Makefile: Let the 'help' target list the tools targets Philippe Mathieu-Daudé
2020-03-06 9:23 ` [PATCH 0/2] Makefile: Re-indent 'help' target and list tools Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-05 0:48 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Paolo Bonzini, Alex Bennée,
Philippe Mathieu-Daudé
The 'help' target is displayed unaligned. Add a print-help
function and use it. Now if someone want to change the
indentation, there is a single place to modify.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Makefile | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/Makefile b/Makefile
index aa9cc0b584..a9ede4f428 100644
--- a/Makefile
+++ b/Makefile
@@ -1220,50 +1220,52 @@ endif
include $(SRC_PATH)/tests/docker/Makefile.include
include $(SRC_PATH)/tests/vm/Makefile.include
+print-help-run = printf " %-30s - %s\\n" "$1" "$2"
+print-help = $(quiet-@)$(call print-help-run,$1,$2)
+
.PHONY: help
help:
@echo 'Generic targets:'
- @echo ' all - Build all'
+ $(call print-help,all,Build all)
ifdef CONFIG_MODULES
- @echo ' modules - Build all modules'
+ $(call print-help,modules,Build all modules)
endif
- @echo ' dir/file.o - Build specified target only'
- @echo ' install - Install QEMU, documentation and tools'
- @echo ' ctags/TAGS - Generate tags file for editors'
- @echo ' cscope - Generate cscope index'
+ $(call print-help,dir/file.o,Build specified target only)
+ $(call print-help,install,Install QEMU, documentation and tools)
+ $(call print-help,ctags/TAGS,Generate tags file for editors)
+ $(call print-help,cscope,Generate cscope index)
@echo ''
@$(if $(TARGET_DIRS), \
echo 'Architecture specific targets:'; \
$(foreach t, $(TARGET_DIRS), \
- printf " %-30s - Build for %s\\n" $(t)/all $(t);) \
+ $(call print-help-run,$(t)/all,Build for $(t));) \
echo '')
@echo 'Cleaning targets:'
- @echo ' clean - Remove most generated files but keep the config'
+ $(call print-help,clean,Remove most generated files but keep the config)
ifdef CONFIG_GCOV
- @echo ' clean-coverage - Remove coverage files'
+ $(call print-help,clean-coverage,Remove coverage files)
endif
- @echo ' distclean - Remove all generated files'
- @echo ' dist - Build a distributable tarball'
+ $(call print-help,distclean,Remove all generated files)
+ $(call print-help,dist,Build a distributable tarball)
@echo ''
@echo 'Test targets:'
- @echo ' check - Run all tests (check-help for details)'
- @echo ' docker - Help about targets running tests inside containers'
- @echo ' vm-help - Help about targets running tests inside VM'
+ $(call print-help,check,Run all tests (check-help for details))
+ $(call print-help,docker,Help about targets running tests inside containers)
+ $(call print-help,vm-help,Help about targets running tests inside VM)
@echo ''
@echo 'Documentation targets:'
- @echo ' html info pdf txt'
- @echo ' - Build documentation in specified format'
+ $(call print-help,html info pdf txt,Build documentation in specified format)
ifdef CONFIG_GCOV
- @echo ' coverage-report - Create code coverage report'
+ $(call print-help,coverage-report,Create code coverage report)
endif
@echo ''
ifdef CONFIG_WIN32
@echo 'Windows targets:'
- @echo ' installer - Build NSIS-based installer for QEMU'
+ $(call print-help,installer,Build NSIS-based installer for QEMU)
ifdef QEMU_GA_MSI_ENABLED
- @echo ' msi - Build MSI-based installer for qemu-ga'
+ $(call print-help,msi,Build MSI-based installer for qemu-ga)
endif
@echo ''
endif
- @echo ' $(MAKE) [targets] (quiet build, default)'
- @echo ' $(MAKE) V=1 [targets] (verbose build)'
+ $(call print-help,$(MAKE) [targets],(quiet build, default))
+ $(call print-help,$(MAKE) V=1 [targets],(verbose build))
--
2.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] Makefile: Let the 'help' target list the tools targets
2020-03-05 0:48 [PATCH 0/2] Makefile: Re-indent 'help' target and list tools Philippe Mathieu-Daudé
2020-03-05 0:48 ` [PATCH 1/2] Makefile: Align 'help' target output Philippe Mathieu-Daudé
@ 2020-03-05 0:48 ` Philippe Mathieu-Daudé
2020-03-06 9:23 ` [PATCH 0/2] Makefile: Re-indent 'help' target and list tools Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-05 0:48 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Paolo Bonzini, Alex Bennée,
Philippe Mathieu-Daudé
List the name of the tool targets when calling 'make help':
$ make help
[...]
Tools targets:
qemu-ga - Build qemu-ga tool
qemu-keymap - Build qemu-keymap tool
elf2dmp - Build elf2dmp tool
ivshmem-client - Build ivshmem-client tool
ivshmem-server - Build ivshmem-server tool
qemu-nbd - Build qemu-nbd tool
qemu-img - Build qemu-img tool
qemu-io - Build qemu-io tool
qemu-edid - Build qemu-edid tool
fsdev/virtfs-proxy-helper - Build virtfs-proxy-helper tool
scsi/qemu-pr-helper - Build qemu-pr-helper tool
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Makefile b/Makefile
index a9ede4f428..4a1d3e2a79 100644
--- a/Makefile
+++ b/Makefile
@@ -1240,6 +1240,11 @@ endif
$(foreach t, $(TARGET_DIRS), \
$(call print-help-run,$(t)/all,Build for $(t));) \
echo '')
+ @$(if $(TOOLS), \
+ echo 'Tools targets:'; \
+ $(foreach t, $(TOOLS), \
+ $(call print-help-run,$(t),Build $(shell basename $(t)) tool);) \
+ echo '')
@echo 'Cleaning targets:'
$(call print-help,clean,Remove most generated files but keep the config)
ifdef CONFIG_GCOV
--
2.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Makefile: Re-indent 'help' target and list tools
2020-03-05 0:48 [PATCH 0/2] Makefile: Re-indent 'help' target and list tools Philippe Mathieu-Daudé
2020-03-05 0:48 ` [PATCH 1/2] Makefile: Align 'help' target output Philippe Mathieu-Daudé
2020-03-05 0:48 ` [PATCH 2/2] Makefile: Let the 'help' target list the tools targets Philippe Mathieu-Daudé
@ 2020-03-06 9:23 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2020-03-06 9:23 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel; +Cc: qemu-trivial, Alex Bennée
On 05/03/20 01:48, Philippe Mathieu-Daudé wrote:
> This series improves the 'make help' output:
> - re-indent current output
> - list tools targets:
>
> $ make help
> [...]
>
> Architecture specific targets:
> x86_64-softmmu/all - Build for x86_64-softmmu
>
> Tools targets:
> qemu-ga - Build qemu-ga tool
> qemu-keymap - Build qemu-keymap tool
> elf2dmp - Build elf2dmp tool
> ivshmem-client - Build ivshmem-client tool
> ivshmem-server - Build ivshmem-server tool
> qemu-nbd - Build qemu-nbd tool
> qemu-img - Build qemu-img tool
> qemu-io - Build qemu-io tool
> qemu-edid - Build qemu-edid tool
> fsdev/virtfs-proxy-helper - Build virtfs-proxy-helper tool
> scsi/qemu-pr-helper - Build qemu-pr-helper tool
>
> Cleaning targets:
> clean - Remove most generated files but keep t=
> he config
> distclean - Remove all generated files
> dist - Build a distributable tarball
>
> Philippe Mathieu-Daud=C3=A9 (2):
> Makefile: Align 'help' target output
> Makefile: Let the 'help' target list the tools targets
>
> Makefile | 49 ++++++++++++++++++++++++++++---------------------
> 1 file changed, 28 insertions(+), 21 deletions(-)
>
> --=20
> 2.21.1
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-06 9:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-05 0:48 [PATCH 0/2] Makefile: Re-indent 'help' target and list tools Philippe Mathieu-Daudé
2020-03-05 0:48 ` [PATCH 1/2] Makefile: Align 'help' target output Philippe Mathieu-Daudé
2020-03-05 0:48 ` [PATCH 2/2] Makefile: Let the 'help' target list the tools targets Philippe Mathieu-Daudé
2020-03-06 9:23 ` [PATCH 0/2] Makefile: Re-indent 'help' target and list tools Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).