xref: /qemu/Makefile (revision f9a7c447)
10cb3fb1eSpbrook# Makefile for QEMU.
20cb3fb1eSpbrook
34ace32e2SAntonio Ospiteifneq ($(words $(subst :, ,$(CURDIR))), 1)
44ace32e2SAntonio Ospite  $(error main directory cannot contain spaces nor colons)
54ace32e2SAntonio Ospiteendif
64ace32e2SAntonio Ospite
7519e1693SStefan Weil# Always point to the root of the build tree (needs GNU make).
8519e1693SStefan WeilBUILD_DIR=$(CURDIR)
9388d4758SLluís Vilanova
10eaa2ddbbSFam Zheng# Before including a proper config-host.mak, assume we are in the source tree
11eaa2ddbbSFam ZhengSRC_PATH=.
12eaa2ddbbSFam Zheng
13660f7930SPaolo Bonzini# Don't use implicit rules or variables
14660f7930SPaolo Bonzini# we have explicit rules for everything
15660f7930SPaolo BonziniMAKEFLAGS += -rR
16660f7930SPaolo Bonzini
17bc054393SThomas HuthSHELL = bash -o pipefail
183bf45835SPaolo Bonzini
19660f7930SPaolo Bonzini# Usage: $(call quiet-command,command and args,"NAME","args to print")
20660f7930SPaolo Bonzini# This will run "command and args", and either:
21660f7930SPaolo Bonzini#  if V=1 just print the whole command and args
22660f7930SPaolo Bonzini#  otherwise print the 'quiet' output in the format "  NAME     args to print"
23660f7930SPaolo Bonzini# NAME should be a short name of the command, 7 letters or fewer.
24660f7930SPaolo Bonzini# If called with only a single argument, will print nothing in quiet mode.
25660f7930SPaolo Bonziniquiet-command-run = $(if $(V),,$(if $2,printf "  %-7s %s\n" $2 $3 && ))$1
26660f7930SPaolo Bonziniquiet-@ = $(if $(V),,@)
27660f7930SPaolo Bonziniquiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
28660f7930SPaolo Bonzini
296fd87e74SSteve SistareUNCHECKED_GOALS := TAGS gtags cscope ctags dist \
30de1da442SMarc-André Lureau    help check-help print-% \
31369dbbe0SAlex Bennée    docker docker-% lcitool-refresh vm-help vm-test vm-build-%
32eaa2ddbbSFam Zheng
332b8575bdSPaolo Bonziniall:
342b8575bdSPaolo Bonzini.PHONY: all clean distclean recurse-all dist msi FORCE
352b8575bdSPaolo Bonzini
362b8575bdSPaolo Bonzini# Don't try to regenerate Makefile or configure
372b8575bdSPaolo Bonzini# We don't generate any of them
382b8575bdSPaolo BonziniMakefile: ;
392b8575bdSPaolo Bonziniconfigure: ;
402b8575bdSPaolo Bonzini
41250b086eSLluís Vilanova# All following code might depend on configuration variables
4255d7e8f6Saurel32ifneq ($(wildcard config-host.mak),)
43ad064840Spbrookinclude config-host.mak
44d1bd2423SPeter Maydell
45b898bf28SPaolo Bonziniinclude Makefile.prereqs
46b898bf28SPaolo BonziniMakefile.prereqs: config-host.mak
47b898bf28SPaolo Bonzini
4809e93326SPaolo Bonzini# 0. ensure the build tree is okay
49a5665051SPaolo Bonzini
50d1bd2423SPeter Maydell# Check that we're not trying to do an out-of-tree build from
51d1bd2423SPeter Maydell# a tree that's been used for an in-tree build.
52d1bd2423SPeter Maydellifneq ($(realpath $(SRC_PATH)),$(realpath .))
53d1bd2423SPeter Maydellifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
54d1bd2423SPeter Maydell$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
55d1bd2423SPeter Maydellseems to have been used for an in-tree build. You can fix this by running \
56b98a3baeSPhilippe Mathieu-Daudé"$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
57d1bd2423SPeter Maydellendif
58d1bd2423SPeter Maydellendif
59d1bd2423SPeter Maydell
602b8575bdSPaolo Bonzini# force a rerun of configure if config-host.mak is too old or corrupted
612b8575bdSPaolo Bonziniifeq ($(MESON),)
622b8575bdSPaolo Bonzini.PHONY: config-host.mak
632b8575bdSPaolo Bonzinix := $(shell rm -rf meson-private meson-info meson-logs)
642b8575bdSPaolo Bonziniendif
652b8575bdSPaolo Bonziniifeq ($(NINJA),)
662b8575bdSPaolo Bonzini.PHONY: config-host.mak
672b8575bdSPaolo Bonzinix := $(shell rm -rf meson-private meson-info meson-logs)
685914ef77SPaolo Bonzinielse
695914ef77SPaolo Bonziniexport NINJA
702b8575bdSPaolo Bonziniendif
712b8575bdSPaolo Bonziniifeq ($(wildcard build.ninja),)
722b8575bdSPaolo Bonzini.PHONY: config-host.mak
732b8575bdSPaolo Bonzinix := $(shell rm -rf meson-private meson-info meson-logs)
742b8575bdSPaolo Bonziniendif
7516bf7a33SPaolo Bonziniifeq ($(origin prefix),file)
7616bf7a33SPaolo Bonzini.PHONY: config-host.mak
7716bf7a33SPaolo Bonzinix := $(shell rm -rf meson-private meson-info meson-logs)
7816bf7a33SPaolo Bonziniendif
792b8575bdSPaolo Bonzini
8009e93326SPaolo Bonzini# 1. ensure config-host.mak is up-to-date
817e270af2SAkihiko Odakiconfig-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh $(SRC_PATH)/VERSION
825914ef77SPaolo Bonzini	@echo config-host.mak is out-of-date, running configure
83a5665051SPaolo Bonzini	@if test -f meson-private/coredata.dat; then \
84a5665051SPaolo Bonzini	  ./config.status --skip-meson; \
85a5665051SPaolo Bonzini	else \
866c5f893dSPaolo Bonzini	  ./config.status; \
87a5665051SPaolo Bonzini	fi
8826fffe29SEmilio G. Cota
895914ef77SPaolo Bonzini# 2. meson.stamp exists if meson has run at least once (so ninja reconfigure
905914ef77SPaolo Bonzini# works), but otherwise never needs to be updated
916c5f893dSPaolo Bonzini
925914ef77SPaolo Bonzinimeson-private/coredata.dat: meson.stamp
935914ef77SPaolo Bonzinimeson.stamp: config-host.mak
945914ef77SPaolo Bonzini	@touch meson.stamp
955914ef77SPaolo Bonzini
966c5f893dSPaolo Bonzini# 3. ensure meson-generated build files are up-to-date
9709e93326SPaolo Bonzini
9809e93326SPaolo Bonziniifneq ($(NINJA),)
9909e93326SPaolo BonziniMakefile.ninja: build.ninja
1005914ef77SPaolo Bonzini	$(quiet-@){ \
1015914ef77SPaolo Bonzini	  echo 'ninja-targets = \'; \
1025914ef77SPaolo Bonzini	  $(NINJA) -t targets all | sed 's/:.*//; $$!s/$$/ \\/'; \
1035914ef77SPaolo Bonzini	  echo 'build-files = \'; \
1045914ef77SPaolo Bonzini	  $(NINJA) -t query build.ninja | sed -n '1,/^  input:/d; /^  outputs:/q; s/$$/ \\/p'; \
1055914ef77SPaolo Bonzini	} > $@.tmp && mv $@.tmp $@
10609e93326SPaolo Bonzini-include Makefile.ninja
107b0fcc6fcSPaolo Bonziniendif
1085914ef77SPaolo Bonzini
109b0fcc6fcSPaolo Bonziniifneq ($(MESON),)
1106c5f893dSPaolo Bonzini# The path to meson always points to pyvenv/bin/meson, but the absolute
1116c5f893dSPaolo Bonzini# paths could change.  In that case, force a regeneration of build.ninja.
1126c5f893dSPaolo Bonzini# Note that this invocation of $(NINJA), just like when Make rebuilds
1136c5f893dSPaolo Bonzini# Makefiles, does not include -n.
1145914ef77SPaolo Bonzinibuild.ninja: build.ninja.stamp
115fc5db021SPaolo Bonzini$(build-files):
1165914ef77SPaolo Bonzinibuild.ninja.stamp: meson.stamp $(build-files)
1176c5f893dSPaolo Bonzini	@if test "$$(cat build.ninja.stamp)" = "$(MESON)" && test -n "$(NINJA)"; then \
1186c5f893dSPaolo Bonzini	  $(NINJA) build.ninja; \
1196c5f893dSPaolo Bonzini	else \
1206c5f893dSPaolo Bonzini	  echo "$(MESON) setup --reconfigure $(SRC_PATH)"; \
1216c5f893dSPaolo Bonzini	  $(MESON) setup --reconfigure $(SRC_PATH); \
1226c5f893dSPaolo Bonzini	fi && echo "$(MESON)" > $@
12309e93326SPaolo Bonzini
1245914ef77SPaolo BonziniMakefile.mtest: build.ninja scripts/mtest2make.py
12509e93326SPaolo Bonzini	$(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@
12609e93326SPaolo Bonzini-include Makefile.mtest
12761d63097SPaolo Bonzini
12861d63097SPaolo Bonzini.PHONY: update-buildoptions
12961d63097SPaolo Bonziniall update-buildoptions: $(SRC_PATH)/scripts/meson-buildoptions.sh
13061d63097SPaolo Bonzini$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt
13161d63097SPaolo Bonzini	$(MESON) introspect --buildoptions $(SRC_PATH)/meson.build | $(PYTHON) \
13261d63097SPaolo Bonzini	  scripts/meson-buildoptions.py > $@.tmp && mv $@.tmp $@
13309e93326SPaolo Bonziniendif
13409e93326SPaolo Bonzini
1355914ef77SPaolo Bonzini# 4. Rules to bridge to other makefiles
13609e93326SPaolo Bonzini
13709e93326SPaolo Bonziniifneq ($(NINJA),)
13814833e24SAlexey Neyman# Filter out long options to avoid flags like --no-print-directory which
13914833e24SAlexey Neyman# may result in false positive match for MAKE.n
14014833e24SAlexey NeymanMAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS))))
14114833e24SAlexey NeymanMAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
14214833e24SAlexey NeymanMAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
143c8e6cfbaSPaolo BonziniMAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
144*f9a7c447SMatheus Tavares BernardinoNINJAFLAGS = \
145*f9a7c447SMatheus Tavares Bernardino        $(if $V,-v) \
146*f9a7c447SMatheus Tavares Bernardino        $(if $(MAKE.n), -n) \
147*f9a7c447SMatheus Tavares Bernardino        $(if $(MAKE.k), -k0) \
148*f9a7c447SMatheus Tavares Bernardino        $(filter-out -j, \
149*f9a7c447SMatheus Tavares Bernardino          $(or $(filter -l% -j%, $(MAKEFLAGS)), \
150*f9a7c447SMatheus Tavares Bernardino               $(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1))) \
151231ca963SPaolo Bonzini        -d keepdepfile
15209e93326SPaolo Bonzinininja-cmd-goals = $(or $(MAKECMDGOALS), all)
1539ee37d3bSPaolo Bonzinininja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
15409e93326SPaolo Bonzini
1556e6761d8SPeter Maydellmakefile-targets := build.ninja ctags TAGS cscope dist clean
1565914ef77SPaolo Bonzini# "ninja -t targets" also lists all prerequisites.  If build system
1575914ef77SPaolo Bonzini# files are marked as PHONY, however, Make will always try to execute
1585914ef77SPaolo Bonzini# "ninja build.ninja".
1595914ef77SPaolo Bonzinininja-targets := $(filter-out $(build-files) $(makefile-targets), $(ninja-targets))
16009e93326SPaolo Bonzini.PHONY: $(ninja-targets) run-ninja
16109e93326SPaolo Bonzini$(ninja-targets): run-ninja
16209e93326SPaolo Bonzini
16309e93326SPaolo Bonzini# Use "| cat" to give Ninja a more "make-y" output.  Use "+" to bypass the
16409e93326SPaolo Bonzini# --output-sync line.
16509e93326SPaolo Bonzinirun-ninja: config-host.mak
16609e93326SPaolo Bonziniifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
167231ca963SPaolo Bonzini	+$(if $(MAKE.nq),@:,$(quiet-@)$(NINJA) $(NINJAFLAGS) \
168231ca963SPaolo Bonzini	   $(sort $(filter $(ninja-targets), $(ninja-cmd-goals))) | cat)
16909e93326SPaolo Bonziniendif
17009e93326SPaolo Bonziniendif
17109e93326SPaolo Bonzini
1722b8575bdSPaolo Bonzinielse # config-host.mak does not exist
173eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
1746fd87e74SSteve Sistare$(error Please call configure before running make)
17555d7e8f6Saurel32endif
1762b8575bdSPaolo Bonziniendif # config-host.mak does not exist
177766a487aSbellard
178660f7930SPaolo BonziniSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet)
179a992fe3dSPaul Brook
18046e7b706SFam Zhenginclude $(SRC_PATH)/tests/Makefile.include
181992aeb8eSPaolo Bonzini
182484e2cc7SPaolo Bonziniall: recurse-all
183675b9b53SMarc-André Lureau
1842a5919abSPaolo BonziniSUBDIR_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(SUBDIRS)))
1852a5919abSPaolo Bonzini.PHONY: $(SUBDIR_RULES)
1862a5919abSPaolo Bonzini$(SUBDIR_RULES):
18749b7d744SPaolo Bonzini	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
188c05ac895SPaul Brook
1892a5919abSPaolo Bonziniifneq ($(filter contrib/plugins, $(SUBDIRS)),)
1902a5919abSPaolo Bonzini.PHONY: plugins
1912a5919abSPaolo Bonziniplugins: contrib/plugins/all
1922a5919abSPaolo Bonziniendif
1932a5919abSPaolo Bonzini
1945e6d1573SPaolo Bonzini.PHONY: recurse-all recurse-clean
1952a5919abSPaolo Bonzinirecurse-all: $(addsuffix /all, $(SUBDIRS))
1962a5919abSPaolo Bonzinirecurse-clean: $(addsuffix /clean, $(SUBDIRS))
1972a5919abSPaolo Bonzinirecurse-distclean: $(addsuffix /distclean, $(SUBDIRS))
1984aa42531Spbrook
1993bc2f570SPaolo Bonzini######################################################################
2004fb240a4Sbellard
20109e93326SPaolo Bonziniclean: recurse-clean
2021023e003SPaolo Bonzini	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean || :
2031023e003SPaolo Bonzini	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) clean-ctlist || :
204029e2da8SAlex Bennée	find . \( -name '*.so' -o -name '*.dll' -o \
205029e2da8SAlex Bennée		  -name '*.[oda]' -o -name '*.gcno' \) -type f \
20623858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
20723858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
20823858f40SLaszlo Ersek		-exec rm {} +
2099da9be2cSPaolo Bonzini	rm -f TAGS cscope.* *~ */*~
210c7e618d4SPaolo Bonzini	@$(MAKE) -Ctests/qemu-iotests clean
21131e31b8aSbellard
212859aef02SPaolo BonziniVERSION = $(shell cat $(SRC_PATH)/VERSION)
21334bb443eSAnthony Liguori
21434bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2
21534bb443eSAnthony Liguori
21634bb443eSAnthony Liguoriqemu-%.tar.bz2:
21734bb443eSAnthony Liguori	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
21834bb443eSAnthony Liguori
2194a3447e5SPaolo Bonzinidistclean: clean recurse-distclean
2201023e003SPaolo Bonzini	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :
221d31d2404SJuan Quintela	rm -f config-host.mak Makefile.prereqs
222c7022a70SPaolo Bonzini	rm -f tests/tcg/*/config-target.mak tests/tcg/config-host.mak
2239da9be2cSPaolo Bonzini	rm -f config.status
2249da9be2cSPaolo Bonzini	rm -f roms/seabios/config.mak
22526fffe29SEmilio G. Cota	rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
22664ed6f92SPaolo Bonzini	rm -f *-config-target.h *-config-devices.mak *-config-devices.h
227a5665051SPaolo Bonzini	rm -rf meson-private meson-logs meson-info compile_commands.json
2285914ef77SPaolo Bonzini	rm -f Makefile.ninja Makefile.mtest build.ninja.stamp meson.stamp
229793553acSAlexandre Raymond	rm -f config.log
23067ed96f9SPeter Maydell	rm -f linux-headers/asm
231d31d2404SJuan Quintela	rm -Rf .sdk qemu-bundle
2327d13299dSbellard
233af7d106eSPeter Xufind-src-path = find "$(SRC_PATH)" -path "$(SRC_PATH)/meson" -prune -o \
234af7d106eSPeter Xu	-type l -prune -o \( -name "*.[chsS]" -o -name "*.[ch].inc" \)
235c857f905SGreg Kurz
236d7986405SGreg Kurz.PHONY: ctags
237d7986405SGreg Kurzctags:
238f2c78150SAlex Bennée	$(call quiet-command, 			\
239f2c78150SAlex Bennée		rm -f "$(SRC_PATH)/"tags, 	\
240f2c78150SAlex Bennée		"CTAGS", "Remove old tags")
241f2c78150SAlex Bennée	$(call quiet-command, \
242f2c78150SAlex Bennée		$(find-src-path) -exec ctags 		\
243f2c78150SAlex Bennée		-f "$(SRC_PATH)/"tags --append {} +,	\
244f2c78150SAlex Bennée		"CTAGS", "Re-index $(SRC_PATH)")
245d7986405SGreg Kurz
246b8a32254SAlex Bennée.PHONY: gtags
247b8a32254SAlex Bennéegtags:
248b8a32254SAlex Bennée	$(call quiet-command, 			\
249b8a32254SAlex Bennée		rm -f "$(SRC_PATH)/"GTAGS; 	\
250b8a32254SAlex Bennée		rm -f "$(SRC_PATH)/"GRTAGS; 	\
251b8a32254SAlex Bennée		rm -f "$(SRC_PATH)/"GPATH, 	\
252b8a32254SAlex Bennée		"GTAGS", "Remove old $@ files")
253b8a32254SAlex Bennée	$(call quiet-command, 				\
254b8a32254SAlex Bennée	        (cd $(SRC_PATH) && 			\
255b8c9ed15SPeter Xu		 $(find-src-path) -print | gtags -f -),	\
256b8a32254SAlex Bennée		"GTAGS", "Re-index $(SRC_PATH)")
257b8a32254SAlex Bennée
258d7986405SGreg Kurz.PHONY: TAGS
259d7986405SGreg KurzTAGS:
260af5d5762SAlex Bennée	$(call quiet-command, 			\
261af5d5762SAlex Bennée		rm -f "$(SRC_PATH)/"TAGS,	\
262af5d5762SAlex Bennée		"TAGS", "Remove old $@")
263af5d5762SAlex Bennée	$(call quiet-command, 				\
264af5d5762SAlex Bennée		$(find-src-path) -exec etags 		\
265af5d5762SAlex Bennée		-f "$(SRC_PATH)/"TAGS --append {} +, 	\
266af5d5762SAlex Bennée		"TAGS", "Re-index $(SRC_PATH)")
267d7986405SGreg Kurz
268d7986405SGreg Kurz.PHONY: cscope
269d7986405SGreg Kurzcscope:
2703e6c1475SAlex Bennée	$(call quiet-command,			\
2713e6c1475SAlex Bennée		rm -f "$(SRC_PATH)/"cscope.* ,	\
2723e6c1475SAlex Bennée		"cscope", "Remove old $@ files")
2733e6c1475SAlex Bennée	$(call quiet-command, 					\
2743e6c1475SAlex Bennée		($(find-src-path) -print | sed -e 's,^\./,,'    \
2753e6c1475SAlex Bennée		> "$(SRC_PATH)/cscope.files"), 			\
2763e6c1475SAlex Bennée		"cscope", "Create file list")
2773e6c1475SAlex Bennée	$(call quiet-command, 				\
2783e6c1475SAlex Bennée		cscope -b -i"$(SRC_PATH)/cscope.files" 	\
2793e6c1475SAlex Bennée		-f"$(SRC_PATH)"/cscope.out, 		\
2803e6c1475SAlex Bennée		"cscope", "Re-index $(SRC_PATH)")
281d7986405SGreg Kurz
282a5665051SPaolo Bonzini# Needed by "meson install"
283a5665051SPaolo Bonziniexport DESTDIR
284612384d7Sbellard
2854ebb040fSDaniel P. Berrangéinclude $(SRC_PATH)/tests/lcitool/Makefile.include
286324027c2SFam Zhenginclude $(SRC_PATH)/tests/docker/Makefile.include
287b1fb9a63SFam Zhenginclude $(SRC_PATH)/tests/vm/Makefile.include
2880d8e065fSMarc-André Lureau
289c355de59SPhilippe Mathieu-Daudéprint-help-run = printf "  %-30s - %s\\n" "$1" "$2"
290784106ecSGreg Kurzprint-help = @$(call print-help-run,$1,$2)
291c355de59SPhilippe Mathieu-Daudé
292335b8f70SRichard Henderson.PHONY: update-linux-vdso
293335b8f70SRichard Hendersonupdate-linux-vdso:
294335b8f70SRichard Henderson	@for m in $(SRC_PATH)/linux-user/*/Makefile.vdso; do \
295335b8f70SRichard Henderson	  $(MAKE) $(SUBDIR_MAKEFLAGS) -C $$(dirname $$m) -f Makefile.vdso \
296335b8f70SRichard Henderson		SRC_PATH=$(SRC_PATH) BUILD_DIR=$(BUILD_DIR); \
297335b8f70SRichard Henderson	done
298335b8f70SRichard Henderson
2990d8e065fSMarc-André Lureau.PHONY: help
3000d8e065fSMarc-André Lureauhelp:
3010d8e065fSMarc-André Lureau	@echo  'Generic targets:'
302c355de59SPhilippe Mathieu-Daudé	$(call print-help,all,Build all)
303c355de59SPhilippe Mathieu-Daudé	$(call print-help,dir/file.o,Build specified target only)
304c355de59SPhilippe Mathieu-Daudé	$(call print-help,install,Install QEMU, documentation and tools)
305b8a32254SAlex Bennée	$(call print-help,ctags/gtags/TAGS,Generate tags file for editors)
306c355de59SPhilippe Mathieu-Daudé	$(call print-help,cscope,Generate cscope index)
307968b4db3SPaolo Bonzini	$(call print-help,sparse,Run sparse on the QEMU source)
3080d8e065fSMarc-André Lureau	@echo  ''
3092a5919abSPaolo Bonziniifneq ($(filter contrib/plugins, $(SUBDIRS)),)
310c17a386bSAlex Bennée	@echo  'Plugin targets:'
311c17a386bSAlex Bennée	$(call print-help,plugins,Build the example TCG plugins)
312c17a386bSAlex Bennée	@echo  ''
313c17a386bSAlex Bennéeendif
3140d8e065fSMarc-André Lureau	@echo  'Cleaning targets:'
315c355de59SPhilippe Mathieu-Daudé	$(call print-help,clean,Remove most generated files but keep the config)
316c355de59SPhilippe Mathieu-Daudé	$(call print-help,distclean,Remove all generated files)
317c355de59SPhilippe Mathieu-Daudé	$(call print-help,dist,Build a distributable tarball)
3180d8e065fSMarc-André Lureau	@echo  ''
319335b8f70SRichard Henderson	@echo  'Linux-user targets:'
320335b8f70SRichard Henderson	$(call print-help,update-linux-vdso,Build linux-user vdso images)
321335b8f70SRichard Henderson	@echo  ''
3220d8e065fSMarc-André Lureau	@echo  'Test targets:'
323c355de59SPhilippe Mathieu-Daudé	$(call print-help,check,Run all tests (check-help for details))
3249ed7247aSPaolo Bonzini	$(call print-help,bench,Run all benchmarks)
3254ebb040fSDaniel P. Berrangé	$(call print-help,lcitool-help,Help about targets for managing build environment manifests)
3266147c249SAlex Bennée	$(call print-help,docker-help,Help about targets running tests inside containers)
327c355de59SPhilippe Mathieu-Daudé	$(call print-help,vm-help,Help about targets running tests inside VM)
3280d8e065fSMarc-André Lureau	@echo  ''
3290d8e065fSMarc-André Lureau	@echo  'Documentation targets:'
3304ac2ee19SPeter Maydell	$(call print-help,html man,Build documentation in specified format)
3310d8e065fSMarc-André Lureau	@echo  ''
3321f2146f7SPaolo Bonziniifneq ($(filter msi, $(ninja-targets)),)
3330d8e065fSMarc-André Lureau	@echo  'Windows targets:'
334c355de59SPhilippe Mathieu-Daudé	$(call print-help,installer,Build NSIS-based installer for QEMU)
335c355de59SPhilippe Mathieu-Daudé	$(call print-help,msi,Build MSI-based installer for qemu-ga)
3360d8e065fSMarc-André Lureau	@echo  ''
3370d8e065fSMarc-André Lureauendif
338c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) [targets],(quiet build, default))
339c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) V=1 [targets],(verbose build))
340660f7930SPaolo Bonzini
341660f7930SPaolo Bonzini# will delete the target of a rule if commands exit with a nonzero exit status
342660f7930SPaolo Bonzini.DELETE_ON_ERROR:
343660f7930SPaolo Bonzini
344660f7930SPaolo Bonziniprint-%:
345660f7930SPaolo Bonzini	@echo '$*=$($*)'
346