xref: /openbmc/qemu/Makefile (revision 6fe12bc6)
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
81*6fe12bc6SAlex Bennéeconfig-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh \
82*6fe12bc6SAlex Bennée		$(SRC_PATH)/pythondeps.toml $(SRC_PATH)/VERSION
835914ef77SPaolo Bonzini	@echo config-host.mak is out-of-date, running configure
84a5665051SPaolo Bonzini	@if test -f meson-private/coredata.dat; then \
85a5665051SPaolo Bonzini	  ./config.status --skip-meson; \
86a5665051SPaolo Bonzini	else \
876c5f893dSPaolo Bonzini	  ./config.status; \
88a5665051SPaolo Bonzini	fi
8926fffe29SEmilio G. Cota
905914ef77SPaolo Bonzini# 2. meson.stamp exists if meson has run at least once (so ninja reconfigure
915914ef77SPaolo Bonzini# works), but otherwise never needs to be updated
926c5f893dSPaolo Bonzini
935914ef77SPaolo Bonzinimeson-private/coredata.dat: meson.stamp
945914ef77SPaolo Bonzinimeson.stamp: config-host.mak
955914ef77SPaolo Bonzini	@touch meson.stamp
965914ef77SPaolo Bonzini
976c5f893dSPaolo Bonzini# 3. ensure meson-generated build files are up-to-date
9809e93326SPaolo Bonzini
9909e93326SPaolo Bonziniifneq ($(NINJA),)
10009e93326SPaolo BonziniMakefile.ninja: build.ninja
1015914ef77SPaolo Bonzini	$(quiet-@){ \
1025914ef77SPaolo Bonzini	  echo 'ninja-targets = \'; \
1035914ef77SPaolo Bonzini	  $(NINJA) -t targets all | sed 's/:.*//; $$!s/$$/ \\/'; \
1045914ef77SPaolo Bonzini	  echo 'build-files = \'; \
1055914ef77SPaolo Bonzini	  $(NINJA) -t query build.ninja | sed -n '1,/^  input:/d; /^  outputs:/q; s/$$/ \\/p'; \
1065914ef77SPaolo Bonzini	} > $@.tmp && mv $@.tmp $@
10709e93326SPaolo Bonzini-include Makefile.ninja
108b0fcc6fcSPaolo Bonziniendif
1095914ef77SPaolo Bonzini
110b0fcc6fcSPaolo Bonziniifneq ($(MESON),)
1116c5f893dSPaolo Bonzini# The path to meson always points to pyvenv/bin/meson, but the absolute
1126c5f893dSPaolo Bonzini# paths could change.  In that case, force a regeneration of build.ninja.
1136c5f893dSPaolo Bonzini# Note that this invocation of $(NINJA), just like when Make rebuilds
1146c5f893dSPaolo Bonzini# Makefiles, does not include -n.
1155914ef77SPaolo Bonzinibuild.ninja: build.ninja.stamp
116fc5db021SPaolo Bonzini$(build-files):
1175914ef77SPaolo Bonzinibuild.ninja.stamp: meson.stamp $(build-files)
1186c5f893dSPaolo Bonzini	@if test "$$(cat build.ninja.stamp)" = "$(MESON)" && test -n "$(NINJA)"; then \
1196c5f893dSPaolo Bonzini	  $(NINJA) build.ninja; \
1206c5f893dSPaolo Bonzini	else \
1216c5f893dSPaolo Bonzini	  echo "$(MESON) setup --reconfigure $(SRC_PATH)"; \
1226c5f893dSPaolo Bonzini	  $(MESON) setup --reconfigure $(SRC_PATH); \
1236c5f893dSPaolo Bonzini	fi && echo "$(MESON)" > $@
12409e93326SPaolo Bonzini
1255914ef77SPaolo BonziniMakefile.mtest: build.ninja scripts/mtest2make.py
12609e93326SPaolo Bonzini	$(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@
12709e93326SPaolo Bonzini-include Makefile.mtest
12861d63097SPaolo Bonzini
12961d63097SPaolo Bonzini.PHONY: update-buildoptions
13061d63097SPaolo Bonziniall update-buildoptions: $(SRC_PATH)/scripts/meson-buildoptions.sh
13161d63097SPaolo Bonzini$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt
13261d63097SPaolo Bonzini	$(MESON) introspect --buildoptions $(SRC_PATH)/meson.build | $(PYTHON) \
13361d63097SPaolo Bonzini	  scripts/meson-buildoptions.py > $@.tmp && mv $@.tmp $@
13409e93326SPaolo Bonziniendif
13509e93326SPaolo Bonzini
1365914ef77SPaolo Bonzini# 4. Rules to bridge to other makefiles
13709e93326SPaolo Bonzini
13809e93326SPaolo Bonziniifneq ($(NINJA),)
13914833e24SAlexey Neyman# Filter out long options to avoid flags like --no-print-directory which
14014833e24SAlexey Neyman# may result in false positive match for MAKE.n
14114833e24SAlexey NeymanMAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS))))
14214833e24SAlexey NeymanMAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
14314833e24SAlexey NeymanMAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
144c8e6cfbaSPaolo BonziniMAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
145f9a7c447SMatheus Tavares BernardinoNINJAFLAGS = \
146f9a7c447SMatheus Tavares Bernardino        $(if $V,-v) \
147f9a7c447SMatheus Tavares Bernardino        $(if $(MAKE.n), -n) \
148f9a7c447SMatheus Tavares Bernardino        $(if $(MAKE.k), -k0) \
149f9a7c447SMatheus Tavares Bernardino        $(filter-out -j, \
150f9a7c447SMatheus Tavares Bernardino          $(or $(filter -l% -j%, $(MAKEFLAGS)), \
151f9a7c447SMatheus Tavares Bernardino               $(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1))) \
152231ca963SPaolo Bonzini        -d keepdepfile
15309e93326SPaolo Bonzinininja-cmd-goals = $(or $(MAKECMDGOALS), all)
1549ee37d3bSPaolo Bonzinininja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
15509e93326SPaolo Bonzini
1566e6761d8SPeter Maydellmakefile-targets := build.ninja ctags TAGS cscope dist clean
1575914ef77SPaolo Bonzini# "ninja -t targets" also lists all prerequisites.  If build system
1585914ef77SPaolo Bonzini# files are marked as PHONY, however, Make will always try to execute
1595914ef77SPaolo Bonzini# "ninja build.ninja".
1605914ef77SPaolo Bonzinininja-targets := $(filter-out $(build-files) $(makefile-targets), $(ninja-targets))
16109e93326SPaolo Bonzini.PHONY: $(ninja-targets) run-ninja
16209e93326SPaolo Bonzini$(ninja-targets): run-ninja
16309e93326SPaolo Bonzini
16409e93326SPaolo Bonzini# Use "| cat" to give Ninja a more "make-y" output.  Use "+" to bypass the
16509e93326SPaolo Bonzini# --output-sync line.
16609e93326SPaolo Bonzinirun-ninja: config-host.mak
16709e93326SPaolo Bonziniifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
168231ca963SPaolo Bonzini	+$(if $(MAKE.nq),@:,$(quiet-@)$(NINJA) $(NINJAFLAGS) \
169231ca963SPaolo Bonzini	   $(sort $(filter $(ninja-targets), $(ninja-cmd-goals))) | cat)
17009e93326SPaolo Bonziniendif
17109e93326SPaolo Bonziniendif
17209e93326SPaolo Bonzini
1732b8575bdSPaolo Bonzinielse # config-host.mak does not exist
174eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
1756fd87e74SSteve Sistare$(error Please call configure before running make)
17655d7e8f6Saurel32endif
1772b8575bdSPaolo Bonziniendif # config-host.mak does not exist
178766a487aSbellard
179660f7930SPaolo BonziniSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet)
180a992fe3dSPaul Brook
18146e7b706SFam Zhenginclude $(SRC_PATH)/tests/Makefile.include
182992aeb8eSPaolo Bonzini
183484e2cc7SPaolo Bonziniall: recurse-all
184675b9b53SMarc-André Lureau
1852a5919abSPaolo BonziniSUBDIR_RULES=$(foreach t, all clean distclean, $(addsuffix /$(t), $(SUBDIRS)))
1862a5919abSPaolo Bonzini.PHONY: $(SUBDIR_RULES)
1872a5919abSPaolo Bonzini$(SUBDIR_RULES):
18849b7d744SPaolo Bonzini	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
189c05ac895SPaul Brook
1902a5919abSPaolo Bonziniifneq ($(filter contrib/plugins, $(SUBDIRS)),)
1912a5919abSPaolo Bonzini.PHONY: plugins
1922a5919abSPaolo Bonziniplugins: contrib/plugins/all
1932a5919abSPaolo Bonziniendif
1942a5919abSPaolo Bonzini
1955e6d1573SPaolo Bonzini.PHONY: recurse-all recurse-clean
1962a5919abSPaolo Bonzinirecurse-all: $(addsuffix /all, $(SUBDIRS))
1972a5919abSPaolo Bonzinirecurse-clean: $(addsuffix /clean, $(SUBDIRS))
1982a5919abSPaolo Bonzinirecurse-distclean: $(addsuffix /distclean, $(SUBDIRS))
1994aa42531Spbrook
2003bc2f570SPaolo Bonzini######################################################################
2014fb240a4Sbellard
20209e93326SPaolo Bonziniclean: recurse-clean
2031023e003SPaolo Bonzini	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean || :
2041023e003SPaolo Bonzini	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) clean-ctlist || :
205029e2da8SAlex Bennée	find . \( -name '*.so' -o -name '*.dll' -o \
206029e2da8SAlex Bennée		  -name '*.[oda]' -o -name '*.gcno' \) -type f \
20723858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
20823858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
20923858f40SLaszlo Ersek		-exec rm {} +
2109da9be2cSPaolo Bonzini	rm -f TAGS cscope.* *~ */*~
211c7e618d4SPaolo Bonzini	@$(MAKE) -Ctests/qemu-iotests clean
21231e31b8aSbellard
213859aef02SPaolo BonziniVERSION = $(shell cat $(SRC_PATH)/VERSION)
21434bb443eSAnthony Liguori
21534bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2
21634bb443eSAnthony Liguori
21734bb443eSAnthony Liguoriqemu-%.tar.bz2:
21834bb443eSAnthony Liguori	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
21934bb443eSAnthony Liguori
2204a3447e5SPaolo Bonzinidistclean: clean recurse-distclean
2211023e003SPaolo Bonzini	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :
222d31d2404SJuan Quintela	rm -f config-host.mak Makefile.prereqs
223c7022a70SPaolo Bonzini	rm -f tests/tcg/*/config-target.mak tests/tcg/config-host.mak
2249da9be2cSPaolo Bonzini	rm -f config.status
2259da9be2cSPaolo Bonzini	rm -f roms/seabios/config.mak
22626fffe29SEmilio G. Cota	rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
22764ed6f92SPaolo Bonzini	rm -f *-config-target.h *-config-devices.mak *-config-devices.h
228a5665051SPaolo Bonzini	rm -rf meson-private meson-logs meson-info compile_commands.json
2295914ef77SPaolo Bonzini	rm -f Makefile.ninja Makefile.mtest build.ninja.stamp meson.stamp
230793553acSAlexandre Raymond	rm -f config.log
23167ed96f9SPeter Maydell	rm -f linux-headers/asm
232d31d2404SJuan Quintela	rm -Rf .sdk qemu-bundle
2337d13299dSbellard
234af7d106eSPeter Xufind-src-path = find "$(SRC_PATH)" -path "$(SRC_PATH)/meson" -prune -o \
235af7d106eSPeter Xu	-type l -prune -o \( -name "*.[chsS]" -o -name "*.[ch].inc" \)
236c857f905SGreg Kurz
237d7986405SGreg Kurz.PHONY: ctags
238d7986405SGreg Kurzctags:
239f2c78150SAlex Bennée	$(call quiet-command, 			\
240f2c78150SAlex Bennée		rm -f "$(SRC_PATH)/"tags, 	\
241f2c78150SAlex Bennée		"CTAGS", "Remove old tags")
242f2c78150SAlex Bennée	$(call quiet-command, \
243f2c78150SAlex Bennée		$(find-src-path) -exec ctags 		\
244f2c78150SAlex Bennée		-f "$(SRC_PATH)/"tags --append {} +,	\
245f2c78150SAlex Bennée		"CTAGS", "Re-index $(SRC_PATH)")
246d7986405SGreg Kurz
247b8a32254SAlex Bennée.PHONY: gtags
248b8a32254SAlex Bennéegtags:
249b8a32254SAlex Bennée	$(call quiet-command, 			\
250b8a32254SAlex Bennée		rm -f "$(SRC_PATH)/"GTAGS; 	\
251b8a32254SAlex Bennée		rm -f "$(SRC_PATH)/"GRTAGS; 	\
252b8a32254SAlex Bennée		rm -f "$(SRC_PATH)/"GPATH, 	\
253b8a32254SAlex Bennée		"GTAGS", "Remove old $@ files")
254b8a32254SAlex Bennée	$(call quiet-command, 				\
255b8a32254SAlex Bennée	        (cd $(SRC_PATH) && 			\
256b8c9ed15SPeter Xu		 $(find-src-path) -print | gtags -f -),	\
257b8a32254SAlex Bennée		"GTAGS", "Re-index $(SRC_PATH)")
258b8a32254SAlex Bennée
259d7986405SGreg Kurz.PHONY: TAGS
260d7986405SGreg KurzTAGS:
261af5d5762SAlex Bennée	$(call quiet-command, 			\
262af5d5762SAlex Bennée		rm -f "$(SRC_PATH)/"TAGS,	\
263af5d5762SAlex Bennée		"TAGS", "Remove old $@")
264af5d5762SAlex Bennée	$(call quiet-command, 				\
265af5d5762SAlex Bennée		$(find-src-path) -exec etags 		\
266af5d5762SAlex Bennée		-f "$(SRC_PATH)/"TAGS --append {} +, 	\
267af5d5762SAlex Bennée		"TAGS", "Re-index $(SRC_PATH)")
268d7986405SGreg Kurz
269d7986405SGreg Kurz.PHONY: cscope
270d7986405SGreg Kurzcscope:
2713e6c1475SAlex Bennée	$(call quiet-command,			\
2723e6c1475SAlex Bennée		rm -f "$(SRC_PATH)/"cscope.* ,	\
2733e6c1475SAlex Bennée		"cscope", "Remove old $@ files")
2743e6c1475SAlex Bennée	$(call quiet-command, 					\
2753e6c1475SAlex Bennée		($(find-src-path) -print | sed -e 's,^\./,,'    \
2763e6c1475SAlex Bennée		> "$(SRC_PATH)/cscope.files"), 			\
2773e6c1475SAlex Bennée		"cscope", "Create file list")
2783e6c1475SAlex Bennée	$(call quiet-command, 				\
2793e6c1475SAlex Bennée		cscope -b -i"$(SRC_PATH)/cscope.files" 	\
2803e6c1475SAlex Bennée		-f"$(SRC_PATH)"/cscope.out, 		\
2813e6c1475SAlex Bennée		"cscope", "Re-index $(SRC_PATH)")
282d7986405SGreg Kurz
283a5665051SPaolo Bonzini# Needed by "meson install"
284a5665051SPaolo Bonziniexport DESTDIR
285612384d7Sbellard
2864ebb040fSDaniel P. Berrangéinclude $(SRC_PATH)/tests/lcitool/Makefile.include
287324027c2SFam Zhenginclude $(SRC_PATH)/tests/docker/Makefile.include
288b1fb9a63SFam Zhenginclude $(SRC_PATH)/tests/vm/Makefile.include
2890d8e065fSMarc-André Lureau
290c355de59SPhilippe Mathieu-Daudéprint-help-run = printf "  %-30s - %s\\n" "$1" "$2"
291784106ecSGreg Kurzprint-help = @$(call print-help-run,$1,$2)
292c355de59SPhilippe Mathieu-Daudé
293335b8f70SRichard Henderson.PHONY: update-linux-vdso
294335b8f70SRichard Hendersonupdate-linux-vdso:
295335b8f70SRichard Henderson	@for m in $(SRC_PATH)/linux-user/*/Makefile.vdso; do \
296335b8f70SRichard Henderson	  $(MAKE) $(SUBDIR_MAKEFLAGS) -C $$(dirname $$m) -f Makefile.vdso \
297335b8f70SRichard Henderson		SRC_PATH=$(SRC_PATH) BUILD_DIR=$(BUILD_DIR); \
298335b8f70SRichard Henderson	done
299335b8f70SRichard Henderson
3000d8e065fSMarc-André Lureau.PHONY: help
3010d8e065fSMarc-André Lureauhelp:
3020d8e065fSMarc-André Lureau	@echo  'Generic targets:'
303c355de59SPhilippe Mathieu-Daudé	$(call print-help,all,Build all)
304c355de59SPhilippe Mathieu-Daudé	$(call print-help,dir/file.o,Build specified target only)
305c355de59SPhilippe Mathieu-Daudé	$(call print-help,install,Install QEMU, documentation and tools)
306b8a32254SAlex Bennée	$(call print-help,ctags/gtags/TAGS,Generate tags file for editors)
307c355de59SPhilippe Mathieu-Daudé	$(call print-help,cscope,Generate cscope index)
308968b4db3SPaolo Bonzini	$(call print-help,sparse,Run sparse on the QEMU source)
3090d8e065fSMarc-André Lureau	@echo  ''
3102a5919abSPaolo Bonziniifneq ($(filter contrib/plugins, $(SUBDIRS)),)
311c17a386bSAlex Bennée	@echo  'Plugin targets:'
312c17a386bSAlex Bennée	$(call print-help,plugins,Build the example TCG plugins)
313c17a386bSAlex Bennée	@echo  ''
314c17a386bSAlex Bennéeendif
3150d8e065fSMarc-André Lureau	@echo  'Cleaning targets:'
316c355de59SPhilippe Mathieu-Daudé	$(call print-help,clean,Remove most generated files but keep the config)
317c355de59SPhilippe Mathieu-Daudé	$(call print-help,distclean,Remove all generated files)
318c355de59SPhilippe Mathieu-Daudé	$(call print-help,dist,Build a distributable tarball)
3190d8e065fSMarc-André Lureau	@echo  ''
320335b8f70SRichard Henderson	@echo  'Linux-user targets:'
321335b8f70SRichard Henderson	$(call print-help,update-linux-vdso,Build linux-user vdso images)
322335b8f70SRichard Henderson	@echo  ''
3230d8e065fSMarc-André Lureau	@echo  'Test targets:'
324c355de59SPhilippe Mathieu-Daudé	$(call print-help,check,Run all tests (check-help for details))
3259ed7247aSPaolo Bonzini	$(call print-help,bench,Run all benchmarks)
3264ebb040fSDaniel P. Berrangé	$(call print-help,lcitool-help,Help about targets for managing build environment manifests)
3276147c249SAlex Bennée	$(call print-help,docker-help,Help about targets running tests inside containers)
328c355de59SPhilippe Mathieu-Daudé	$(call print-help,vm-help,Help about targets running tests inside VM)
3290d8e065fSMarc-André Lureau	@echo  ''
3300d8e065fSMarc-André Lureau	@echo  'Documentation targets:'
3314ac2ee19SPeter Maydell	$(call print-help,html man,Build documentation in specified format)
3320d8e065fSMarc-André Lureau	@echo  ''
3331f2146f7SPaolo Bonziniifneq ($(filter msi, $(ninja-targets)),)
3340d8e065fSMarc-André Lureau	@echo  'Windows targets:'
335c355de59SPhilippe Mathieu-Daudé	$(call print-help,installer,Build NSIS-based installer for QEMU)
336c355de59SPhilippe Mathieu-Daudé	$(call print-help,msi,Build MSI-based installer for qemu-ga)
3370d8e065fSMarc-André Lureau	@echo  ''
3380d8e065fSMarc-André Lureauendif
339c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) [targets],(quiet build, default))
340c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) V=1 [targets],(verbose build))
341660f7930SPaolo Bonzini
342660f7930SPaolo Bonzini# will delete the target of a rule if commands exit with a nonzero exit status
343660f7930SPaolo Bonzini.DELETE_ON_ERROR:
344660f7930SPaolo Bonzini
345660f7930SPaolo Bonziniprint-%:
346660f7930SPaolo Bonzini	@echo '$*=$($*)'
347