blob: 917c9a34d1c58877d6ab409ff2d5a621110e6fe2 [file] [log] [blame]
pbrook0cb3fb12006-05-14 12:07:53 +00001# Makefile for QEMU.
2
Antonio Ospite4ace32e2019-05-26 16:47:47 +02003ifneq ($(words $(subst :, ,$(CURDIR))), 1)
4 $(error main directory cannot contain spaces nor colons)
5endif
6
Stefan Weil519e1692011-09-16 21:50:43 +02007# Always point to the root of the build tree (needs GNU make).
8BUILD_DIR=$(CURDIR)
Lluís Vilanova388d4752011-09-15 22:45:35 +02009
Fam Zhengeaa2ddb2015-05-22 13:35:07 +080010# Before including a proper config-host.mak, assume we are in the source tree
11SRC_PATH=.
12
Paolo Bonzini660f7932020-09-01 12:10:05 -040013# Don't use implicit rules or variables
14# we have explicit rules for everything
15MAKEFLAGS += -rR
16
Thomas Huthbc054392021-07-05 10:25:42 +020017SHELL = bash -o pipefail
Paolo Bonzini3bf45832020-10-14 07:35:13 -040018
Paolo Bonzini660f7932020-09-01 12:10:05 -040019# Usage: $(call quiet-command,command and args,"NAME","args to print")
20# This will run "command and args", and either:
21# if V=1 just print the whole command and args
22# otherwise print the 'quiet' output in the format " NAME args to print"
23# NAME should be a short name of the command, 7 letters or fewer.
24# If called with only a single argument, will print nothing in quiet mode.
25quiet-command-run = $(if $(V),,$(if $2,printf " %-7s %s\n" $2 $3 && ))$1
26quiet-@ = $(if $(V),,@)
27quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
28
Steve Sistare6fd87e72023-04-19 06:08:20 -070029UNCHECKED_GOALS := TAGS gtags cscope ctags dist \
Marc-André Lureaude1da442018-01-04 17:05:08 +010030 help check-help print-% \
Alex Bennée369dbbe2023-06-30 19:03:55 +010031 docker docker-% lcitool-refresh vm-help vm-test vm-build-%
Fam Zhengeaa2ddb2015-05-22 13:35:07 +080032
Paolo Bonzini2b8575b2020-10-15 12:20:02 -040033all:
34.PHONY: all clean distclean recurse-all dist msi FORCE
35
36# Don't try to regenerate Makefile or configure
37# We don't generate any of them
38Makefile: ;
39configure: ;
40
Lluís Vilanova250b0862012-03-06 19:50:38 +010041# All following code might depend on configuration variables
aurel3255d7e8f2009-04-15 14:42:57 +000042ifneq ($(wildcard config-host.mak),)
pbrookad064842006-04-16 12:41:07 +000043include config-host.mak
Peter Maydelld1bd2422012-10-19 14:54:23 +010044
Paolo Bonzinib898bf22022-09-29 12:42:05 +010045include Makefile.prereqs
46Makefile.prereqs: config-host.mak
47
Paolo Bonzini09e93322020-08-13 09:28:11 -040048# 0. ensure the build tree is okay
Paolo Bonzinia5665052019-06-10 12:05:14 +020049
Peter Maydelld1bd2422012-10-19 14:54:23 +010050# Check that we're not trying to do an out-of-tree build from
51# a tree that's been used for an in-tree build.
52ifneq ($(realpath $(SRC_PATH)),$(realpath .))
53ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
54$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
55seems to have been used for an in-tree build. You can fix this by running \
Philippe Mathieu-Daudéb98a3ba2017-11-21 06:55:10 -030056"$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
Peter Maydelld1bd2422012-10-19 14:54:23 +010057endif
58endif
59
Paolo Bonzini2b8575b2020-10-15 12:20:02 -040060# force a rerun of configure if config-host.mak is too old or corrupted
61ifeq ($(MESON),)
62.PHONY: config-host.mak
63x := $(shell rm -rf meson-private meson-info meson-logs)
64endif
65ifeq ($(NINJA),)
66.PHONY: config-host.mak
67x := $(shell rm -rf meson-private meson-info meson-logs)
Paolo Bonzini5914ef72020-10-23 08:34:54 -040068else
69export NINJA
Paolo Bonzini2b8575b2020-10-15 12:20:02 -040070endif
71ifeq ($(wildcard build.ninja),)
72.PHONY: config-host.mak
73x := $(shell rm -rf meson-private meson-info meson-logs)
74endif
Paolo Bonzini16bf7a32020-10-16 03:19:14 -040075ifeq ($(origin prefix),file)
76.PHONY: config-host.mak
77x := $(shell rm -rf meson-private meson-info meson-logs)
78endif
Paolo Bonzini2b8575b2020-10-15 12:20:02 -040079
Paolo Bonzini09e93322020-08-13 09:28:11 -040080# 1. ensure config-host.mak is up-to-date
Alex Bennée6fe12bc2024-08-13 21:23:10 +010081config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh \
82 $(SRC_PATH)/pythondeps.toml $(SRC_PATH)/VERSION
Paolo Bonzini5914ef72020-10-23 08:34:54 -040083 @echo config-host.mak is out-of-date, running configure
Paolo Bonzinia5665052019-06-10 12:05:14 +020084 @if test -f meson-private/coredata.dat; then \
85 ./config.status --skip-meson; \
86 else \
Paolo Bonzini6c5f8932023-05-23 17:56:33 +020087 ./config.status; \
Paolo Bonzinia5665052019-06-10 12:05:14 +020088 fi
Emilio G. Cota26fffe22018-10-21 13:56:29 -040089
Paolo Bonzini5914ef72020-10-23 08:34:54 -040090# 2. meson.stamp exists if meson has run at least once (so ninja reconfigure
91# works), but otherwise never needs to be updated
Paolo Bonzini6c5f8932023-05-23 17:56:33 +020092
Paolo Bonzini5914ef72020-10-23 08:34:54 -040093meson-private/coredata.dat: meson.stamp
94meson.stamp: config-host.mak
95 @touch meson.stamp
96
Paolo Bonzini6c5f8932023-05-23 17:56:33 +020097# 3. ensure meson-generated build files are up-to-date
Paolo Bonzini09e93322020-08-13 09:28:11 -040098
99ifneq ($(NINJA),)
Paolo Bonzini09e93322020-08-13 09:28:11 -0400100Makefile.ninja: build.ninja
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400101 $(quiet-@){ \
102 echo 'ninja-targets = \'; \
103 $(NINJA) -t targets all | sed 's/:.*//; $$!s/$$/ \\/'; \
104 echo 'build-files = \'; \
105 $(NINJA) -t query build.ninja | sed -n '1,/^ input:/d; /^ outputs:/q; s/$$/ \\/p'; \
106 } > $@.tmp && mv $@.tmp $@
Paolo Bonzini09e93322020-08-13 09:28:11 -0400107-include Makefile.ninja
Paolo Bonzinib0fcc6f2023-05-19 19:32:56 +0200108endif
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400109
Paolo Bonzinib0fcc6f2023-05-19 19:32:56 +0200110ifneq ($(MESON),)
Paolo Bonzini6c5f8932023-05-23 17:56:33 +0200111# The path to meson always points to pyvenv/bin/meson, but the absolute
112# paths could change. In that case, force a regeneration of build.ninja.
113# Note that this invocation of $(NINJA), just like when Make rebuilds
114# Makefiles, does not include -n.
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400115build.ninja: build.ninja.stamp
Paolo Bonzinifc5db022020-12-16 13:13:40 +0100116$(build-files):
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400117build.ninja.stamp: meson.stamp $(build-files)
Paolo Bonzini6c5f8932023-05-23 17:56:33 +0200118 @if test "$$(cat build.ninja.stamp)" = "$(MESON)" && test -n "$(NINJA)"; then \
119 $(NINJA) build.ninja; \
120 else \
121 echo "$(MESON) setup --reconfigure $(SRC_PATH)"; \
122 $(MESON) setup --reconfigure $(SRC_PATH); \
123 fi && echo "$(MESON)" > $@
Paolo Bonzini09e93322020-08-13 09:28:11 -0400124
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400125Makefile.mtest: build.ninja scripts/mtest2make.py
Paolo Bonzini09e93322020-08-13 09:28:11 -0400126 $(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@
127-include Makefile.mtest
Paolo Bonzini61d63092021-10-07 15:08:28 +0200128
129.PHONY: update-buildoptions
130all update-buildoptions: $(SRC_PATH)/scripts/meson-buildoptions.sh
131$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt
132 $(MESON) introspect --buildoptions $(SRC_PATH)/meson.build | $(PYTHON) \
133 scripts/meson-buildoptions.py > $@.tmp && mv $@.tmp $@
Paolo Bonzini09e93322020-08-13 09:28:11 -0400134endif
135
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400136# 4. Rules to bridge to other makefiles
Paolo Bonzini09e93322020-08-13 09:28:11 -0400137
138ifneq ($(NINJA),)
Alexey Neyman14833e22021-07-21 19:08:46 -0700139# Filter out long options to avoid flags like --no-print-directory which
140# may result in false positive match for MAKE.n
141MAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS))))
142MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
143MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
Paolo Bonzinic8e6cfb2020-10-26 11:58:54 -0400144MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
Matheus Tavares Bernardinof9a7c442024-04-12 09:58:38 +0200145NINJAFLAGS = \
146 $(if $V,-v) \
147 $(if $(MAKE.n), -n) \
148 $(if $(MAKE.k), -k0) \
149 $(filter-out -j, \
150 $(or $(filter -l% -j%, $(MAKEFLAGS)), \
151 $(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1))) \
Paolo Bonzini231ca962022-05-27 16:35:43 +0100152 -d keepdepfile
Paolo Bonzini09e93322020-08-13 09:28:11 -0400153ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
Paolo Bonzini9ee37d32022-09-14 16:19:36 +0200154ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
Paolo Bonzini09e93322020-08-13 09:28:11 -0400155
Peter Maydell6e6761d2023-01-10 15:12:50 +0000156makefile-targets := build.ninja ctags TAGS cscope dist clean
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400157# "ninja -t targets" also lists all prerequisites. If build system
158# files are marked as PHONY, however, Make will always try to execute
159# "ninja build.ninja".
160ninja-targets := $(filter-out $(build-files) $(makefile-targets), $(ninja-targets))
Paolo Bonzini09e93322020-08-13 09:28:11 -0400161.PHONY: $(ninja-targets) run-ninja
162$(ninja-targets): run-ninja
163
164# Use "| cat" to give Ninja a more "make-y" output. Use "+" to bypass the
165# --output-sync line.
166run-ninja: config-host.mak
167ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
Paolo Bonzini231ca962022-05-27 16:35:43 +0100168 +$(if $(MAKE.nq),@:,$(quiet-@)$(NINJA) $(NINJAFLAGS) \
169 $(sort $(filter $(ninja-targets), $(ninja-cmd-goals))) | cat)
Paolo Bonzini09e93322020-08-13 09:28:11 -0400170endif
171endif
172
Paolo Bonzini2b8575b2020-10-15 12:20:02 -0400173else # config-host.mak does not exist
Fam Zhengeaa2ddb2015-05-22 13:35:07 +0800174ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
Steve Sistare6fd87e72023-04-19 06:08:20 -0700175$(error Please call configure before running make)
aurel3255d7e8f2009-04-15 14:42:57 +0000176endif
Paolo Bonzini2b8575b2020-10-15 12:20:02 -0400177endif # config-host.mak does not exist
bellard766a4872003-02-18 23:35:48 +0000178
Paolo Bonzini660f7932020-09-01 12:10:05 -0400179SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet)
Paul Brooka992fe32009-11-22 16:25:30 +0000180
Fam Zheng46e7b702016-06-01 10:23:31 +0800181include $(SRC_PATH)/tests/Makefile.include
Paolo Bonzini992aeb82012-12-21 08:34:49 +0100182
Paolo Bonzini484e2cc2019-12-12 13:30:36 +0100183all: recurse-all
Marc-André Lureau675b9b52019-02-12 17:25:23 +0100184
Paolo Bonzini2a5919a2023-08-30 12:05:08 +0200185SUBDIR_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(SUBDIRS)))
186.PHONY: $(SUBDIR_RULES)
187$(SUBDIR_RULES):
Paolo Bonzini49b7d742020-08-31 08:36:27 -0400188 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
Paul Brookc05ac892009-07-31 13:18:32 +0100189
Paolo Bonzini2a5919a2023-08-30 12:05:08 +0200190ifneq ($(filter contrib/plugins, $(SUBDIRS)),)
191.PHONY: plugins
192plugins: contrib/plugins/all
193endif
194
Paolo Bonzini5e6d1572020-08-05 13:05:13 +0200195.PHONY: recurse-all recurse-clean
Paolo Bonzini2a5919a2023-08-30 12:05:08 +0200196recurse-all: $(addsuffix /all, $(SUBDIRS))
197recurse-clean: $(addsuffix /clean, $(SUBDIRS))
198recurse-distclean: $(addsuffix /distclean, $(SUBDIRS))
bellard83f64092006-08-01 16:21:11 +0000199
Paolo Bonzini3bc2f572012-11-16 18:35:27 +0100200######################################################################
bellard4fb240a2007-11-07 19:24:02 +0000201
Paolo Bonzini09e93322020-08-13 09:28:11 -0400202clean: recurse-clean
Paolo Bonzini1023e002020-11-05 07:44:56 -0500203 -$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean || :
204 -$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) clean-ctlist || :
Alex Bennée029e2da2022-02-04 20:43:12 +0000205 find . \( -name '*.so' -o -name '*.dll' -o \
206 -name '*.[oda]' -o -name '*.gcno' \) -type f \
Laszlo Ersek23858f42019-02-04 17:03:21 +0100207 ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
208 ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
Laszlo Ersek23858f42019-02-04 17:03:21 +0100209 -exec rm {} +
Paolo Bonzini9da9be22021-10-13 13:51:32 +0200210 rm -f TAGS cscope.* *~ */*~
Paolo Bonzinic7e618d2023-11-03 10:00:04 +0100211 @$(MAKE) -Ctests/qemu-iotests clean
bellard31e31b82003-02-18 22:55:36 +0000212
Paolo Bonzini859aef02020-08-04 18:14:26 +0200213VERSION = $(shell cat $(SRC_PATH)/VERSION)
Anthony Liguori34bb4432012-07-17 13:33:32 -0500214
215dist: qemu-$(VERSION).tar.bz2
216
217qemu-%.tar.bz2:
218 $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
219
Paolo Bonzini4a3447e2022-09-29 12:41:56 +0100220distclean: clean recurse-distclean
Paolo Bonzini1023e002020-11-05 07:44:56 -0500221 -$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :
Juan Quintelad31d2402023-03-01 12:19:10 +0100222 rm -f config-host.mak Makefile.prereqs
Paolo Bonzinic7022a72022-09-29 12:42:07 +0100223 rm -f tests/tcg/*/config-target.mak tests/tcg/config-host.mak
Paolo Bonzini9da9be22021-10-13 13:51:32 +0200224 rm -f config.status
225 rm -f roms/seabios/config.mak
Emilio G. Cota26fffe22018-10-21 13:56:29 -0400226 rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
Paolo Bonzini64ed6f92020-08-03 17:04:25 +0200227 rm -f *-config-target.h *-config-devices.mak *-config-devices.h
Paolo Bonzinia5665052019-06-10 12:05:14 +0200228 rm -rf meson-private meson-logs meson-info compile_commands.json
Paolo Bonzini5914ef72020-10-23 08:34:54 -0400229 rm -f Makefile.ninja Makefile.mtest build.ninja.stamp meson.stamp
Alexandre Raymond793553a2011-07-25 23:56:02 -0400230 rm -f config.log
Peter Maydell67ed96f2012-02-01 18:50:42 +0000231 rm -f linux-headers/asm
Juan Quintelad31d2402023-03-01 12:19:10 +0100232 rm -Rf .sdk qemu-bundle
bellard7d132992003-03-06 23:23:54 +0000233
Peter Xuaf7d1062021-08-04 09:23:28 -0400234find-src-path = find "$(SRC_PATH)" -path "$(SRC_PATH)/meson" -prune -o \
235 -type l -prune -o \( -name "*.[chsS]" -o -name "*.[ch].inc" \)
Greg Kurzc857f902020-09-03 21:47:55 +0200236
Greg Kurzd7986402020-09-01 16:20:10 +0200237.PHONY: ctags
238ctags:
Alex Bennéef2c78152021-01-14 16:57:23 +0000239 $(call quiet-command, \
240 rm -f "$(SRC_PATH)/"tags, \
241 "CTAGS", "Remove old tags")
242 $(call quiet-command, \
243 $(find-src-path) -exec ctags \
244 -f "$(SRC_PATH)/"tags --append {} +, \
245 "CTAGS", "Re-index $(SRC_PATH)")
Greg Kurzd7986402020-09-01 16:20:10 +0200246
Alex Bennéeb8a32252021-01-14 16:57:20 +0000247.PHONY: gtags
248gtags:
249 $(call quiet-command, \
250 rm -f "$(SRC_PATH)/"GTAGS; \
251 rm -f "$(SRC_PATH)/"GRTAGS; \
252 rm -f "$(SRC_PATH)/"GPATH, \
253 "GTAGS", "Remove old $@ files")
254 $(call quiet-command, \
255 (cd $(SRC_PATH) && \
Peter Xub8c9ed12021-08-04 09:23:27 -0400256 $(find-src-path) -print | gtags -f -), \
Alex Bennéeb8a32252021-01-14 16:57:20 +0000257 "GTAGS", "Re-index $(SRC_PATH)")
258
Greg Kurzd7986402020-09-01 16:20:10 +0200259.PHONY: TAGS
260TAGS:
Alex Bennéeaf5d5762021-01-14 16:57:24 +0000261 $(call quiet-command, \
262 rm -f "$(SRC_PATH)/"TAGS, \
263 "TAGS", "Remove old $@")
264 $(call quiet-command, \
265 $(find-src-path) -exec etags \
266 -f "$(SRC_PATH)/"TAGS --append {} +, \
267 "TAGS", "Re-index $(SRC_PATH)")
Greg Kurzd7986402020-09-01 16:20:10 +0200268
269.PHONY: cscope
270cscope:
Alex Bennée3e6c1472021-01-14 16:57:25 +0000271 $(call quiet-command, \
272 rm -f "$(SRC_PATH)/"cscope.* , \
273 "cscope", "Remove old $@ files")
274 $(call quiet-command, \
275 ($(find-src-path) -print | sed -e 's,^\./,,' \
276 > "$(SRC_PATH)/cscope.files"), \
277 "cscope", "Create file list")
278 $(call quiet-command, \
279 cscope -b -i"$(SRC_PATH)/cscope.files" \
280 -f"$(SRC_PATH)"/cscope.out, \
281 "cscope", "Re-index $(SRC_PATH)")
Greg Kurzd7986402020-09-01 16:20:10 +0200282
Paolo Bonzinia5665052019-06-10 12:05:14 +0200283# Needed by "meson install"
284export DESTDIR
bellard612384d2003-03-22 17:31:19 +0000285
Daniel P. Berrangé4ebb0402022-01-05 13:49:42 +0000286include $(SRC_PATH)/tests/lcitool/Makefile.include
Fam Zheng324027c2016-06-01 12:25:17 +0800287include $(SRC_PATH)/tests/docker/Makefile.include
Fam Zhengb1fb9a62017-09-05 10:11:58 +0800288include $(SRC_PATH)/tests/vm/Makefile.include
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400289
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100290print-help-run = printf " %-30s - %s\\n" "$1" "$2"
Greg Kurz784106e2020-11-05 16:47:00 +0100291print-help = @$(call print-help-run,$1,$2)
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100292
Richard Henderson335b8f72023-09-29 13:43:50 -0700293.PHONY: update-linux-vdso
294update-linux-vdso:
295 @for m in $(SRC_PATH)/linux-user/*/Makefile.vdso; do \
296 $(MAKE) $(SUBDIR_MAKEFLAGS) -C $$(dirname $$m) -f Makefile.vdso \
297 SRC_PATH=$(SRC_PATH) BUILD_DIR=$(BUILD_DIR); \
298 done
299
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400300.PHONY: help
301help:
302 @echo 'Generic targets:'
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100303 $(call print-help,all,Build all)
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100304 $(call print-help,dir/file.o,Build specified target only)
305 $(call print-help,install,Install QEMU, documentation and tools)
Alex Bennéeb8a32252021-01-14 16:57:20 +0000306 $(call print-help,ctags/gtags/TAGS,Generate tags file for editors)
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100307 $(call print-help,cscope,Generate cscope index)
Paolo Bonzini968b4db2020-02-03 14:45:33 +0100308 $(call print-help,sparse,Run sparse on the QEMU source)
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400309 @echo ''
Paolo Bonzini2a5919a2023-08-30 12:05:08 +0200310ifneq ($(filter contrib/plugins, $(SUBDIRS)),)
Alex Bennéec17a3862020-09-09 12:27:41 +0100311 @echo 'Plugin targets:'
312 $(call print-help,plugins,Build the example TCG plugins)
313 @echo ''
314endif
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400315 @echo 'Cleaning targets:'
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100316 $(call print-help,clean,Remove most generated files but keep the config)
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100317 $(call print-help,distclean,Remove all generated files)
318 $(call print-help,dist,Build a distributable tarball)
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400319 @echo ''
Richard Henderson335b8f72023-09-29 13:43:50 -0700320 @echo 'Linux-user targets:'
321 $(call print-help,update-linux-vdso,Build linux-user vdso images)
322 @echo ''
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400323 @echo 'Test targets:'
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100324 $(call print-help,check,Run all tests (check-help for details))
Paolo Bonzini9ed72472020-09-02 07:25:19 -0400325 $(call print-help,bench,Run all benchmarks)
Daniel P. Berrangé4ebb0402022-01-05 13:49:42 +0000326 $(call print-help,lcitool-help,Help about targets for managing build environment manifests)
Alex Bennée6147c242021-02-02 13:39:50 +0000327 $(call print-help,docker-help,Help about targets running tests inside containers)
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100328 $(call print-help,vm-help,Help about targets running tests inside VM)
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400329 @echo ''
330 @echo 'Documentation targets:'
Peter Maydell4ac2ee12020-09-25 17:23:04 +0100331 $(call print-help,html man,Build documentation in specified format)
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400332 @echo ''
Paolo Bonzini1f2146f2023-08-30 11:39:45 +0200333ifneq ($(filter msi, $(ninja-targets)),)
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400334 @echo 'Windows targets:'
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100335 $(call print-help,installer,Build NSIS-based installer for QEMU)
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100336 $(call print-help,msi,Build MSI-based installer for qemu-ga)
Marc-André Lureau0d8e0652016-09-13 18:20:33 +0400337 @echo ''
338endif
Philippe Mathieu-Daudéc355de52020-03-05 01:48:54 +0100339 $(call print-help,$(MAKE) [targets],(quiet build, default))
340 $(call print-help,$(MAKE) V=1 [targets],(verbose build))
Paolo Bonzini660f7932020-09-01 12:10:05 -0400341
342# will delete the target of a rule if commands exit with a nonzero exit status
343.DELETE_ON_ERROR:
344
345print-%:
346 @echo '$*=$($*)'