Skip to contentSkip to conversation

build-sys: add make 'help' target

PATCH In review Marc-André Lureau 3 participants 3 messages Sep 13, 2016 – Sep 14, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 build-sys: add make 'help' target

Add a make 'help', to print a summary of the main Makefile targets. The format is loosely inspired by Linux make 'help' output.

---
Makefile | 38 ++++++++++++++++++++++++++++++++++++++

 1 file changed, 38 insertions(+)

v2:
- add architectures targets
- move generic targets on top, 'all' first
- better describe 'docker' help target

Makefile +38 -0
index 50b4b3a..03dbec2 100644
@@ -669,3 +669,41 @@ endif
 -include $(wildcard *.d tests/*.d)
 
 include $(SRC_PATH)/tests/docker/Makefile.include
+
+.PHONY: help
+help:
+	@echo  'Generic targets:'
+	@echo  '  all             - Build all'
+	@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'
+	@echo  ''
+	@$(if $(TARGET_DIRS), \
+		echo 'Architecture specific targets:'; \
+		$(foreach t, $(TARGET_DIRS), \
+		printf "  %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \
+		echo '')
+	@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          - Help about targets running 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  ''
+ifdef CONFIG_WIN32
+	@echo  'Windows targets:'
+	@echo  '  installer       - Build NSIS-based installer for qemu-ga'
+ifdef QEMU_GA_MSI_ENABLED
+	@echo  '  msi             - Build MSI-based installer for qemu-ga'
+endif
+	@echo  ''
+endif
+	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
Signature · 1 line
2.10.0
#1 lore raw
Quoted 35 lines · Marc-André Lureau

Add a make 'help', to print a summary of the main Makefile targets. The format is loosely inspired by Linux make 'help' output.

---
Makefile | 38 ++++++++++++++++++++++++++++++++++++++

 1 file changed, 38 insertions(+)

v2:
- add architectures targets
- move generic targets on top, 'all' first
- better describe 'docker' help target

Makefile +14 -0
index 50b4b3a..03dbec2 100644
@@ -669,3 +669,41 @@ endif
 -include $(wildcard *.d tests/*.d)
 
 include $(SRC_PATH)/tests/docker/Makefile.include
+
+.PHONY: help
+help:
+	@echo  'Generic targets:'
+	@echo  '  all             - Build all'
+	@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'
+	@echo  ''
+	@$(if $(TARGET_DIRS), \
+		echo 'Architecture specific targets:'; \
+		$(foreach t, $(TARGET_DIRS), \
+		printf "  %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \

Makefile endif · line 695

Quoted 10 lines
Makefile +10 -0
+		echo '')
+	@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          - Help about targets running tests inside Docker containers'
+	@echo  '  test/speed      - Run TCG tests'

I wouldn't mention the TCG tests until we've actually fixed them up.

Quoted 4 lines
Makefile +4 -0
+	@echo  ''
+	@echo  'Documentation targets:'
+	@echo  '  dvi/html/'
+	@echo  '  info/pdf        - Build documentation in specified format'

Makefile endif · line 709

Quoted 10 lines
Makefile +10 -0
+	@echo  ''
+ifdef CONFIG_WIN32
+	@echo  'Windows targets:'
+	@echo  '  installer       - Build NSIS-based installer for qemu-ga'
+ifdef QEMU_GA_MSI_ENABLED
+	@echo  '  msi             - Build MSI-based installer for qemu-ga'
+endif
+	@echo  ''
+endif
+	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'

--
Alex Bennée

#2 lore raw
In reply to Marc-André Lureau
Quoted 35 lines · Marc-André Lureau

Add a make 'help', to print a summary of the main Makefile targets. The format is loosely inspired by Linux make 'help' output.

---
Makefile | 38 ++++++++++++++++++++++++++++++++++++++

 1 file changed, 38 insertions(+)

v2:
- add architectures targets
- move generic targets on top, 'all' first
- better describe 'docker' help target

Makefile +14 -0
index 50b4b3a..03dbec2 100644
@@ -669,3 +669,41 @@ endif
 -include $(wildcard *.d tests/*.d)
 
 include $(SRC_PATH)/tests/docker/Makefile.include
+
+.PHONY: help
+help:
+	@echo  'Generic targets:'
+	@echo  '  all             - Build all'
+	@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'
+	@echo  ''
+	@$(if $(TARGET_DIRS), \
+		echo 'Architecture specific targets:'; \
+		$(foreach t, $(TARGET_DIRS), \
+		printf "  %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \

Makefile endif · line 695

Quoted 10 lines
Makefile +10 -0
+		echo '')
+	@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          - Help about targets running tests inside Docker containers'
+	@echo  '  test/speed      - Run TCG tests'

Removed this according to Alex's suggestion and queued for 2.8.

Paolo

Quoted 15 lines
Makefile +14 -0
+	@echo  ''
+	@echo  'Documentation targets:'
+	@echo  '  dvi/html/'
+	@echo  '  info/pdf        - Build documentation in specified format'
+	@echo  ''
+ifdef CONFIG_WIN32
+	@echo  'Windows targets:'
+	@echo  '  installer       - Build NSIS-based installer for qemu-ga'
+ifdef QEMU_GA_MSI_ENABLED
+	@echo  '  msi             - Build MSI-based installer for qemu-ga'
+endif
+	@echo  ''
+endif
+	@echo  '  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'