Makefile: Align 'help' target output

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>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2020-03-05 01:48:54 +01:00 committed by Paolo Bonzini
parent 4df28c9352
commit c355de59ae

View File

@ -1235,50 +1235,52 @@ endif
include $(SRC_PATH)/tests/docker/Makefile.include include $(SRC_PATH)/tests/docker/Makefile.include
include $(SRC_PATH)/tests/vm/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 .PHONY: help
help: help:
@echo 'Generic targets:' @echo 'Generic targets:'
@echo ' all - Build all' $(call print-help,all,Build all)
ifdef CONFIG_MODULES ifdef CONFIG_MODULES
@echo ' modules - Build all modules' $(call print-help,modules,Build all modules)
endif endif
@echo ' dir/file.o - Build specified target only' $(call print-help,dir/file.o,Build specified target only)
@echo ' install - Install QEMU, documentation and tools' $(call print-help,install,Install QEMU, documentation and tools)
@echo ' ctags/TAGS - Generate tags file for editors' $(call print-help,ctags/TAGS,Generate tags file for editors)
@echo ' cscope - Generate cscope index' $(call print-help,cscope,Generate cscope index)
@echo '' @echo ''
@$(if $(TARGET_DIRS), \ @$(if $(TARGET_DIRS), \
echo 'Architecture specific targets:'; \ echo 'Architecture specific targets:'; \
$(foreach t, $(TARGET_DIRS), \ $(foreach t, $(TARGET_DIRS), \
printf " %-30s - Build for %s\\n" $(t)/all $(t);) \ $(call print-help-run,$(t)/all,Build for $(t));) \
echo '') echo '')
@echo 'Cleaning targets:' @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 ifdef CONFIG_GCOV
@echo ' clean-coverage - Remove coverage files' $(call print-help,clean-coverage,Remove coverage files)
endif endif
@echo ' distclean - Remove all generated files' $(call print-help,distclean,Remove all generated files)
@echo ' dist - Build a distributable tarball' $(call print-help,dist,Build a distributable tarball)
@echo '' @echo ''
@echo 'Test targets:' @echo 'Test targets:'
@echo ' check - Run all tests (check-help for details)' $(call print-help,check,Run all tests (check-help for details))
@echo ' docker - Help about targets running tests inside containers' $(call print-help,docker,Help about targets running tests inside containers)
@echo ' vm-help - Help about targets running tests inside VM' $(call print-help,vm-help,Help about targets running tests inside VM)
@echo '' @echo ''
@echo 'Documentation targets:' @echo 'Documentation targets:'
@echo ' html info pdf txt' $(call print-help,html info pdf txt,Build documentation in specified format)
@echo ' - Build documentation in specified format'
ifdef CONFIG_GCOV ifdef CONFIG_GCOV
@echo ' coverage-report - Create code coverage report' $(call print-help,coverage-report,Create code coverage report)
endif endif
@echo '' @echo ''
ifdef CONFIG_WIN32 ifdef CONFIG_WIN32
@echo 'Windows targets:' @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 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 endif
@echo '' @echo ''
endif endif
@echo ' $(MAKE) [targets] (quiet build, default)' $(call print-help,$(MAKE) [targets],(quiet build, default))
@echo ' $(MAKE) V=1 [targets] (verbose build)' $(call print-help,$(MAKE) V=1 [targets],(verbose build))