Skip to contentSkip to conversation

buildsys: Restore listing binaries/tools/helpers in 'make help' target

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Jun 2, 2021 – Jun 3, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildsys: Restore listing binaries/tools/helpers in 'make help' target

When switching to Meson (commit 7fd51e68c34, 2020-08-21) we lost many targets listed in 'make help':
- target specific binaries
commit 5e6d1573b49 ("remove Makefile.target")
- tools and helpers
commit c3a0ee847a5 ("configure, Makefile; remove TOOLS and HELPERS-y variable")

Since 'ninja' is not officially supported, but 'make' still is, restore a similar list of make targets (extracted from ninja). The targets are not described as before, but it is still more useful to users rather than nothing listed at all.

Now we get:

  $ make help
    GIT     ui/keycodemapdb tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc capstone slirp
  Architecture specific targets:
    qemu-system-aarch64
    qemu-system-alpha
    qemu-system-arm
    qemu-system-avr
    ...
    qemu-x86_64
    qemu-xtensaeb
    qemu-xtensa

Generic targets:

    all                            - Build all
    dir/file.o                     - Build specified target only
    install                        - Install QEMU
    ctags/gtags/TAGS               - Generate tags file for editors
    cscope                         - Generate cscope index
    sparse                         - Run sparse on the QEMU source

Tools and helper targets:
contrib/elf2dmp/elf2dmp
contrib/ivshmem-client/ivshmem-client
contrib/ivshmem-server/ivshmem-server
contrib/vhost-user-blk/vhost-user-blk
contrib/vhost-user-gpu/vhost-user-gpu
contrib/vhost-user-input/vhost-user-input
contrib/vhost-user-scsi/vhost-user-scsi
fsdev/virtfs-proxy-helper
qemu-bridge-helper
qemu-edid
qemu-img
qemu-io
qemu-keymap
qemu-nbd
qemu-pr-helper
qga/qemu-ga
storage-daemon/qemu-storage-daemon
tools/virtiofsd/virtiofsd

Cleaning targets:

    clean                          - Remove most generated files but keep the config
    distclean                      - Remove all generated files
    dist                           - Build a distributable tarball

...

---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)
Makefile +7 -0
index 30f19d33bb3..f2c5ce2e5fe 100644
@@ -286,6 +286,9 @@ print-help = @$(call print-help-run,$1,$2)
 
 .PHONY: help
 help:
+	@echo  'Architecture specific targets:'
+	@ninja -t targets all | sed -ne 's/\(.*\): cpp_LINKER.*/  \1/p'
+	@echo  ''
 	@echo  'Generic targets:'
 	$(call print-help,all,Build all)
 	$(call print-help,dir/file.o,Build specified target only)
@@ -294,6 +297,10 @@ help:
 	$(call print-help,cscope,Generate cscope index)
 	$(call print-help,sparse,Run sparse on the QEMU source)
 	@echo  ''
+	@echo  'Tools and helper targets:'
+	@ninja -t targets all | sed -ne 's/\(.*\): c_LINKER.*/  \1/p' \
+		| sort | egrep -v '^  (subprojects|tests|target)'
+	@echo  ''
 ifeq ($(CONFIG_PLUGIN),y)
 	@echo  'Plugin targets:'
 	$(call print-help,plugins,Build the example TCG plugins)
Signature · 1 line
2.26.3
#1 lore raw

Makefile print-help = @$(call print-help-run,$1,$2) · line 291

Quoted 3 lines · Philippe Mathieu-Daudé
Makefile +3 -0
+	@echo  'Architecture specific targets:'
+	@ninja -t targets all | sed -ne 's/\(.*\): cpp_LINKER.*/  \1/p'
+	@echo  ''

This doesn't work in general, it depends on the link_language established by configure. The separation between qemu-* targets and other targets is not particularly useful in my opinion.

Quoted 2 lines

The targets are not described as before, but it is still more useful to users rather than nothing listed at all.

Maybe add "make targets" and add it to the help? The information in "make help" already includes what's generally useful; listing a few dozen targets overwhelms the user with output, whereas most people only care about "make all" and "make check".

Paolo