xref: /openbmc/qemu/Makefile (revision de59dda3)
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
1328fa2927SPhilippe Mathieu-DaudéUNCHECKED_GOALS := %clean TAGS cscope ctags dist \
1428fa2927SPhilippe Mathieu-Daudé    html info pdf txt \
15de1da442SMarc-André Lureau    help check-help print-% \
164f2f6276SPhilippe Mathieu-Daudé    docker docker-% vm-help vm-test vm-build-%
17eaa2ddbbSFam Zheng
18250b086eSLluís Vilanova# All following code might depend on configuration variables
1955d7e8f6Saurel32ifneq ($(wildcard config-host.mak),)
201ad2134fSPaul Brook# Put the all: rule here so that config-host.mak can contain dependencies.
218f67aa82SStefan Weilall:
22ad064840Spbrookinclude config-host.mak
23d1bd2423SPeter Maydell
24aef45d51SDaniel P. Berrangegit-submodule-update:
25aef45d51SDaniel P. Berrange
26aef45d51SDaniel P. Berrange.PHONY: git-submodule-update
27aef45d51SDaniel P. Berrange
28aef45d51SDaniel P. Berrangegit_module_status := $(shell \
29aef45d51SDaniel P. Berrange  cd '$(SRC_PATH)' && \
30cc84d63aSDaniel P. Berrange  GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
31aef45d51SDaniel P. Berrange  echo $$?; \
32aef45d51SDaniel P. Berrange)
33aef45d51SDaniel P. Berrange
34aef45d51SDaniel P. Berrangeifeq (1,$(git_module_status))
35f62bbee5SDaniel P. Berrangeifeq (no,$(GIT_UPDATE))
36f62bbee5SDaniel P. Berrangegit-submodule-update:
37f62bbee5SDaniel P. Berrange	$(call quiet-command, \
38f62bbee5SDaniel P. Berrange            echo && \
39f62bbee5SDaniel P. Berrange            echo "GIT submodule checkout is out of date. Please run" && \
40f62bbee5SDaniel P. Berrange            echo "  scripts/git-submodule.sh update $(GIT_SUBMODULES)" && \
41f62bbee5SDaniel P. Berrange            echo "from the source directory checkout $(SRC_PATH)" && \
42f62bbee5SDaniel P. Berrange            echo && \
43f62bbee5SDaniel P. Berrange            exit 1)
44f62bbee5SDaniel P. Berrangeelse
45aef45d51SDaniel P. Berrangegit-submodule-update:
46aef45d51SDaniel P. Berrange	$(call quiet-command, \
47cc84d63aSDaniel P. Berrange          (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
48aef45d51SDaniel P. Berrange          "GIT","$(GIT_SUBMODULES)")
49aef45d51SDaniel P. Berrangeendif
50aef45d51SDaniel P. Berrangeendif
51aef45d51SDaniel P. Berrange
52a5665051SPaolo Bonziniexport NINJA=./ninjatool
53a5665051SPaolo Bonzini
54a5665051SPaolo Bonzini# Running meson regenerates both build.ninja and ninjatool, and that is
55a5665051SPaolo Bonzini# enough to prime the rest of the build.
56a5665051SPaolo Bonzinininjatool: build.ninja
57a5665051SPaolo Bonzini
58a5665051SPaolo Bonzini# Only needed in case Makefile.ninja does not exist.
59a5665051SPaolo Bonzini.PHONY: ninja-clean ninja-distclean clean-ctlist
60a5665051SPaolo Bonziniclean-ctlist:
61a5665051SPaolo Bonzinininja-clean::
62a5665051SPaolo Bonzinininja-distclean::
63a5665051SPaolo Bonzinibuild.ninja: config-host.mak
64a5665051SPaolo Bonzini
65a5665051SPaolo BonziniMakefile.ninja: build.ninja ninjatool
66a5665051SPaolo Bonzini	./ninjatool -t ninja2make --omit clean dist uninstall < $< > $@
67a5665051SPaolo Bonzini-include Makefile.ninja
68a5665051SPaolo Bonzini
69a5665051SPaolo Bonzini${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}: .var.command += -MP
70a5665051SPaolo Bonzini
71245dac4aSPaolo Bonzini# If MESON is empty, the rule will be re-evaluated after Makefiles are
72245dac4aSPaolo Bonzini# reread (and MESON won't be empty anymore).
73245dac4aSPaolo Bonziniifneq ($(MESON),)
74245dac4aSPaolo BonziniMakefile.mtest: build.ninja scripts/mtest2make.py
75245dac4aSPaolo Bonzini	$(MESON) introspect --tests | $(PYTHON) scripts/mtest2make.py > $@
76245dac4aSPaolo Bonzini-include Makefile.mtest
77245dac4aSPaolo Bonziniendif
78245dac4aSPaolo Bonzini
7992712822SDaniel P. Berrange.git-submodule-status: git-submodule-update config-host.mak
80aef45d51SDaniel P. Berrange
81d1bd2423SPeter Maydell# Check that we're not trying to do an out-of-tree build from
82d1bd2423SPeter Maydell# a tree that's been used for an in-tree build.
83d1bd2423SPeter Maydellifneq ($(realpath $(SRC_PATH)),$(realpath .))
84d1bd2423SPeter Maydellifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
85d1bd2423SPeter Maydell$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
86d1bd2423SPeter Maydellseems to have been used for an in-tree build. You can fix this by running \
87b98a3baeSPhilippe Mathieu-Daudé"$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
88d1bd2423SPeter Maydellendif
89d1bd2423SPeter Maydellendif
90d1bd2423SPeter Maydell
912b1f35b9SAlex BennéeCONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
922b1f35b9SAlex BennéeCONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
936b827ccaSStefano StabelliniCONFIG_XEN := $(CONFIG_XEN_BACKEND)
94f3aa844bSPaolo BonziniCONFIG_ALL=y
95f3aa844bSPaolo Bonzini-include config-all-devices.mak
96f3aa844bSPaolo Bonzini-include config-all-disas.mak
97f3aa844bSPaolo Bonzini
983a6b016dSMarkus Armbrusterconfig-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
99e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
100a5665051SPaolo Bonzini	@if test -f meson-private/coredata.dat; then \
101a5665051SPaolo Bonzini	  ./config.status --skip-meson; \
102a5665051SPaolo Bonzini	else \
103a5665051SPaolo Bonzini	  ./config.status; \
104a5665051SPaolo Bonzini	fi
10526fffe29SEmilio G. Cota
10626fffe29SEmilio G. Cota# Force configure to re-run if the API symbols are updated
10726fffe29SEmilio G. Cotaifeq ($(CONFIG_PLUGIN),y)
10826fffe29SEmilio G. Cotaconfig-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols
10926fffe29SEmilio G. Cotaendif
11026fffe29SEmilio G. Cota
11155d7e8f6Saurel32else
11255d7e8f6Saurel32config-host.mak:
113eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
11455d7e8f6Saurel32	@echo "Please call configure before running make!"
11555d7e8f6Saurel32	@exit 1
11655d7e8f6Saurel32endif
1177748b8cbSMike Frysingerendif
118766a487aSbellard
119fb57c881SFam Zhenginclude $(SRC_PATH)/rules.mak
120fb57c881SFam Zheng
121c932ce31SPaolo Bonzini# lor is defined in rules.mak
12229de2804SLaurent VivierCONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS))
12329de2804SLaurent Vivier
1243f885659SMarc-André Lureaugenerated-files-y = config-host.h
125bf582c34SEric Blake
1263dff199cSLaurent Viviergenerated-files-y += module_block.h
1270c0c1fd9SMarc Mari
1283dff199cSLaurent Viviergenerated-files-y += .git-submodule-status
1290ab8ed18SDaniel P. Berrange
130d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
131d9ace8b3SJuan Quintela# We don't generate any of them
132d9ace8b3SJuan QuintelaMakefile: ;
133d9ace8b3SJuan Quintelaconfigure: ;
134d9ace8b3SJuan Quintela
135bd3f5706SMarc-André Lureau.PHONY: all clean cscope distclean html info install install-doc \
1367c3d1917SDaniel P. Berrange	pdf txt recurse-all dist msi FORCE
1370cb3fb1eSpbrook
138fec90ff0SPaolo Bonzini$(call set-vpath, $(SRC_PATH))
1398c462f8fSpbrook
1403e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
14167c0f08dSJuan Quintela
142fdbff6bdSPhilippe Mathieu-DaudéHELPERS-y = $(HELPERS)
143d52c454aSMarc-André Lureau
144b53c54c6SPeter Maydell# Sphinx does not allow building manuals into the same directory as
145b53c54c6SPeter Maydell# the source files, so if we're doing an in-tree QEMU build we must
146b53c54c6SPeter Maydell# build the manuals into a subdirectory (and then install them from
147b53c54c6SPeter Maydell# there for 'make install'). For an out-of-tree build we can just
148b53c54c6SPeter Maydell# use the docs/ subdirectory in the build tree as normal.
149b53c54c6SPeter Maydellifeq ($(realpath $(SRC_PATH)),$(realpath .))
150b53c54c6SPeter MaydellMANUAL_BUILDDIR := docs/built
151b53c54c6SPeter Maydellelse
152b53c54c6SPeter MaydellMANUAL_BUILDDIR := docs
153b53c54c6SPeter Maydellendif
154b53c54c6SPeter Maydell
155cc8ae6deSpbrookifdef BUILD_DOCS
156d06118bfSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/system/qemu.1
157a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/qemu-img.1
158a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/qemu-nbd.8
15987c0868fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8
1606a7e2bbeSStefan Hajnocziifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
161a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/virtiofsd.1
1626a7e2bbeSStefan Hajnocziendif
163acab923dSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7
164d59157eaSPaolo BonziniDOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
165d59157eaSPaolo BonziniDOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
1661bf84a1eSKashyap ChamarthyDOCS+=$(MANUAL_BUILDDIR)/system/qemu-cpu-models.7
16722108f33SStefan HajnocziDOCS+=$(MANUAL_BUILDDIR)/index.html
168983eef5aSMeador Ingeifdef CONFIG_VIRTFS
169a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1
170983eef5aSMeador Ingeendif
17162dd1048SDaniel P. Berrangéifdef CONFIG_TRACE_SYSTEMTAP
172a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1
17362dd1048SDaniel P. Berrangéendif
174cc8ae6deSpbrookelse
175cc8ae6deSpbrookDOCS=
176cc8ae6deSpbrookendif
1777d13299dSbellard
1788cc357b5SDaniel P. BerrangeSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
179e0e312f3SPaolo BonziniSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(filter %-softmmu, $(TARGET_DIRS)))
180e0e312f3SPaolo BonziniSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %.d, $(SUBDIR_DEVICES_MAK))
1811f3d3c8fSJuan Quintela
1828bdd3d49SStefan Weilifeq ($(SUBDIR_DEVICES_MAK),)
183b7c11e57SPaolo Bonziniconfig-all-devices.mak: config-host.mak
1840bdb12c7SPeter Maydell	$(call quiet-command,echo '# no devices' > $@,"GEN","$@")
1858bdd3d49SStefan Weilelse
186b7c11e57SPaolo Bonziniconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak
187bb585a78SPaolo Bonzini	$(call quiet-command, sed -n \
188bb585a78SPaolo Bonzini             's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
189bb585a78SPaolo Bonzini             $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
1900bdb12c7SPeter Maydell             "GEN","$@")
1918bdd3d49SStefan Weilendif
1921f3d3c8fSJuan Quintela
193bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
194bd9141bbSPaul Brook
195e0e312f3SPaolo Bonzini# This has to be kept in sync with Kconfig.host.
196e0e312f3SPaolo BonziniMINIKCONF_ARGS = \
197f3494749SPaolo Bonzini    $(CONFIG_MINIKCONF_MODE) \
198aaa1b70aSPaolo Bonzini    $@ $*/config-devices.mak.d $< $(SRC_PATH)/Kconfig \
19996df0fddSPhilippe Mathieu-Daudé    CONFIG_TCG=$(CONFIG_TCG) \
200e0e312f3SPaolo Bonzini    CONFIG_KVM=$(CONFIG_KVM) \
201e0e312f3SPaolo Bonzini    CONFIG_SPICE=$(CONFIG_SPICE) \
202e0e312f3SPaolo Bonzini    CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
203e0e312f3SPaolo Bonzini    CONFIG_TPM=$(CONFIG_TPM) \
204e0e312f3SPaolo Bonzini    CONFIG_XEN=$(CONFIG_XEN) \
205e0e312f3SPaolo Bonzini    CONFIG_OPENGL=$(CONFIG_OPENGL) \
206e0e312f3SPaolo Bonzini    CONFIG_X11=$(CONFIG_X11) \
207e0e312f3SPaolo Bonzini    CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \
20821c6b0c8SMarc-André Lureau    CONFIG_VHOST_KERNEL=$(CONFIG_VHOST_KERNEL) \
209e0e312f3SPaolo Bonzini    CONFIG_VIRTFS=$(CONFIG_VIRTFS) \
210d6c1bd4aSPaolo Bonzini    CONFIG_LINUX=$(CONFIG_LINUX) \
211d6c1bd4aSPaolo Bonzini    CONFIG_PVRDMA=$(CONFIG_PVRDMA)
212e0e312f3SPaolo Bonzini
213f4bda37dSPhilippe Mathieu-DaudéMINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
214e0e312f3SPaolo Bonzini
215aaa1b70aSPaolo Bonzini$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/Kconfig $(BUILD_DIR)/config-host.mak
2161e0ef873SPhilippe Mathieu-Daudé	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
2171e0ef873SPhilippe Mathieu-Daudé		> $@.tmp, "GEN", "$@.tmp")
21812ccfec9SMichael S. Tsirkin	$(call quiet-command, if test -f $@; then \
219904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
220012f0879SStefan Weil	    mv $@.tmp $@; \
221012f0879SStefan Weil	    cp -p $@ $@.old; \
222012f0879SStefan Weil	  else \
223012f0879SStefan Weil	    if test -f $@.old; then \
224012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
225012f0879SStefan Weil	    else \
226a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
227012f0879SStefan Weil	    fi; \
228b98a3baeSPhilippe Mathieu-Daudé	    echo "Run \"$(MAKE) defconfig\" to regenerate."; \
229a992fe3dSPaul Brook	    rm $@.tmp; \
230012f0879SStefan Weil	  fi; \
231a992fe3dSPaul Brook	 else \
232a992fe3dSPaul Brook	  mv $@.tmp $@; \
233012f0879SStefan Weil	  cp -p $@ $@.old; \
2340bdb12c7SPeter Maydell	 fi,"GEN","$@");
235a992fe3dSPaul Brook
236a992fe3dSPaul Brookdefconfig:
237a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
238a992fe3dSPaul Brook
239992aeb8eSPaolo Bonziniifneq ($(wildcard config-host.mak),)
240992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/Makefile.objs
241ba1183daSFam Zhengendif
242ba1183daSFam Zheng
243ba1183daSFam Zhengdummy := $(call unnest-vars,, \
2445b76dd13SDaniel P. Berrange                authz-obj-y \
24532d955a4SMarc-André Lureau                chardev-obj-y \
246ba1183daSFam Zheng                block-obj-y \
247cc475698SFam Zheng                block-obj-m \
24814837c64SKevin Wolf                storage-daemon-obj-y \
24914837c64SKevin Wolf                storage-daemon-obj-m \
250fb37726dSDaniel P. Berrange                crypto-obj-y \
251666a3af9SDaniel P. Berrange                io-obj-y \
252cc475698SFam Zheng                common-obj-y \
253a81df1b6SPaolo Bonzini                common-obj-m)
254243af022SPaolo Bonzini
25546e7b706SFam Zhenginclude $(SRC_PATH)/tests/Makefile.include
256992aeb8eSPaolo Bonzini
257ea458960SMarc-André Lureauall: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules
258b9dea4fbSpbrook
2591215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
2601215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
2611215c6e7SJuan Quintela
262c621dc3eSAlexander BulekovTARGET_DIRS_RULES := $(foreach t, all fuzz clean install, $(addsuffix /$(t), $(TARGET_DIRS)))
263916359f6SAndreas Färber
2641338a4b7SMarkus ArmbrusterSOFTMMU_ALL_RULES=$(filter %-softmmu/all, $(TARGET_DIRS_RULES))
2651338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(authz-obj-y)
2661338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(block-obj-y)
26714837c64SKevin Wolf$(SOFTMMU_ALL_RULES): $(storage-daemon-obj-y)
2681338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(chardev-obj-y)
2691338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(crypto-obj-y)
2701338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(io-obj-y)
271*de59dda3SMarc-André Lureau$(SOFTMMU_ALL_RULES): $(qom-obj-y)
2721338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): config-all-devices.mak
273cec7d0b6Spbrook
274c621dc3eSAlexander BulekovSOFTMMU_FUZZ_RULES=$(filter %-softmmu/fuzz, $(TARGET_DIRS_RULES))
275c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(authz-obj-y)
276c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(block-obj-y)
277c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(chardev-obj-y)
278c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(crypto-obj-y)
279c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(io-obj-y)
280c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): config-all-devices.mak
281c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(edk2-decompressed)
282c621dc3eSAlexander Bulekov
2831338a4b7SMarkus Armbruster.PHONY: $(TARGET_DIRS_RULES)
2841338a4b7SMarkus Armbruster# The $(TARGET_DIRS_RULES) are of the form SUBDIR/GOAL, so that
2851338a4b7SMarkus Armbruster# $(dir $@) yields the sub-directory, and $(notdir $@) yields the sub-goal
2861338a4b7SMarkus Armbruster$(TARGET_DIRS_RULES):
2871338a4b7SMarkus Armbruster	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
2884aa42531Spbrook
28967953a37SClaudio Fontana# LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC
29067953a37SClaudio FontanaDTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib=""
291965f486cSPeter MaydellDTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
29267953a37SClaudio FontanaDTC_CPPFLAGS=-I$(SRC_PATH)/dtc/libfdt
293a540f158SPeter Crosthwaite
2943b8593eeSMarkus Armbruster.PHONY: dtc/all
29567953a37SClaudio Fontanadtc/all: .git-submodule-status dtc/libfdt
29667953a37SClaudio Fontana	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,)
297a540f158SPeter Crosthwaite
29800525864SAaron Lindsaydtc/%: .git-submodule-status
299814e1110SJan Kiszka	@mkdir -p $@
300a540f158SPeter Crosthwaite
301e219c499SRichard Henderson# Overriding CFLAGS causes us to lose defines added in the sub-makefile.
302e219c499SRichard Henderson# Not overriding CFLAGS leads to mis-matches between compilation modes.
303e219c499SRichard Henderson# Therefore we replicate some of the logic in the sub-makefile.
304e219c499SRichard Henderson# Remove all the extra -Warning flags that QEMU uses that Capstone doesn't;
305e219c499SRichard Henderson# no need to annoy QEMU developers with such things.
306e219c499SRichard HendersonCAP_CFLAGS = $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS))
307e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
308e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_ARM
309e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_ARM64
310e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
311e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_X86
312e219c499SRichard Henderson
3133b8593eeSMarkus Armbruster.PHONY: capstone/all
3143b8593eeSMarkus Armbrustercapstone/all: .git-submodule-status
3159f81aeb5SAlistair Francis	$(call quiet-command,$(MAKE) -C $(SRC_PATH)/capstone CAPSTONE_SHARED=no BUILDDIR="$(BUILD_DIR)/capstone" CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" CFLAGS="$(CAP_CFLAGS)" $(SUBDIR_MAKEFLAGS) $(BUILD_DIR)/capstone/$(LIBCAPSTONE))
316e219c499SRichard Henderson
3173b8593eeSMarkus Armbruster.PHONY: slirp/all
3183b8593eeSMarkus Armbrusterslirp/all: .git-submodule-status
319daa79d9aSAlex Bennée	$(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp		\
320daa79d9aSAlex Bennée		BUILD_DIR="$(BUILD_DIR)/slirp" 			\
321daa79d9aSAlex Bennée		PKG_CONFIG="$(PKG_CONFIG)" 				\
322daa79d9aSAlex Bennée		CC="$(CC)" AR="$(AR)" 	LD="$(LD)" RANLIB="$(RANLIB)"	\
323db5adeaaSPaolo Bonzini		CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
324675b9b53SMarc-André Lureau
3251338a4b7SMarkus Armbruster$(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
326b8d89ba8SPaolo Bonzini	$(qom-obj-y)
327add16157SBlue Swirl
328c621dc3eSAlexander Bulekov$(filter %/fuzz, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
329c621dc3eSAlexander Bulekov	$(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY))
330c621dc3eSAlexander Bulekov
3313b8593eeSMarkus ArmbrusterROM_DIRS = $(addprefix pc-bios/, $(ROMS))
3321338a4b7SMarkus ArmbrusterROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
333a9c87304SMarc-André Lureau# Only keep -O and -g cflags
3341338a4b7SMarkus Armbruster.PHONY: $(ROM_DIRS_RULES)
3351338a4b7SMarkus Armbruster$(ROM_DIRS_RULES):
3361338a4b7SMarkus Armbruster	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
337c05ac895SPaul Brook
3388d358a5eSMarkus Armbruster.PHONY: recurse-all recurse-clean recurse-install
3391338a4b7SMarkus Armbrusterrecurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
3401338a4b7SMarkus Armbrusterrecurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
3411338a4b7SMarkus Armbrusterrecurse-install: $(addsuffix /install, $(TARGET_DIRS))
34247ae060eSMarkus Armbruster$(addsuffix /install, $(TARGET_DIRS)): all
3434aa42531Spbrook
344c17a18efSMarc-André Lureau$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h
3450bdb12c7SPeter Maydell	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o")
3465354e4d2SMarc-André Lureau
347c17a18efSMarc-André LureauMakefile: $(version-obj-y)
3483bc2f570SPaolo Bonzini
3493bc2f570SPaolo Bonzini######################################################################
3504fb240a4Sbellard
351ebedb37cSPaolo BonziniCOMMON_LDADDS = libqemuutil.a
3520ab8ed18SDaniel P. Berrange
3533c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
354153859beSStuart Brady
3555b76dd13SDaniel P. Berrangeqemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
3565b76dd13SDaniel P. Berrangeqemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
3575b76dd13SDaniel P. Berrangeqemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
3585e6911cfSKevin Wolfqemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS)
3590a8e1acdSaliguori
3605b76dd13SDaniel P. Berrangescsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
361fe8fc5aeSPaolo Bonziniifdef CONFIG_MPATH
362fe8fc5aeSPaolo Bonziniscsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
363fe8fc5aeSPaolo Bonziniendif
364b855f8d1SPaolo Bonzini
3650c0c1fd9SMarc Marimodule_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak
3660c0c1fd9SMarc Mari	$(call quiet-command,$(PYTHON) $< $@ \
3670c0c1fd9SMarc Mari	$(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
3680bdb12c7SPeter Maydell	"GEN","$@")
3690c0c1fd9SMarc Mari
370a5665051SPaolo Bonziniclean: recurse-clean ninja-clean clean-ctlist
371a5665051SPaolo Bonzini	-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean
3722d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
37325be210fSJuan Quintela	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
374df2943baSMichael S. Tsirkin	rm -f qemu-options.def
37523858f40SLaszlo Ersek	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
37623858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
37723858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
37823858f40SLaszlo Ersek		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
37923858f40SLaszlo Ersek		-exec rm {} +
3800814465aSPaolo Bonzini	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~ */*~
381b855f8d1SPaolo Bonzini	rm -f fsdev/*.pod scsi/*.pod
3823dff199cSLaurent Vivier	rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
383e92af6ecSJuan Quintela	rm -f config-all-devices.mak
384d69cda7eSPeter Maydell	rm -f $(SUBDIR_DEVICES_MAK)
38531e31b8aSbellard
38634bb443eSAnthony LiguoriVERSION ?= $(shell cat VERSION)
38734bb443eSAnthony Liguori
38834bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2
38934bb443eSAnthony Liguori
39034bb443eSAnthony Liguoriqemu-%.tar.bz2:
39134bb443eSAnthony Liguori	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
39234bb443eSAnthony Liguori
3935f71eac0SPeter Maydelldefine clean-manual =
3941290e671SPeter Maydellrm -rf $(MANUAL_BUILDDIR)/$1/_static
3951290e671SPeter Maydellrm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html
3965f71eac0SPeter Maydellendef
3975f71eac0SPeter Maydell
398a5665051SPaolo Bonzinidistclean: clean ninja-distclean
399a5665051SPaolo Bonzini	-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean -g
400ee5195eeSRichard Henderson	rm -f config-host.mak config-host.h* $(DOCS)
4012038f8c8SPaolo Bonzini	rm -f tests/tcg/config-*.mak
402ae219359SThomas Huth	rm -f config-all-devices.mak config-all-disas.mak config.status
403e92af6ecSJuan Quintela	rm -f $(SUBDIR_DEVICES_MAK)
404ae219359SThomas Huth	rm -f po/*.mo tests/qemu-iotests/common.env
405fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
40626fffe29SEmilio G. Cota	rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
407a5665051SPaolo Bonzini	rm -rf meson-private meson-logs meson-info compile_commands.json
408245dac4aSPaolo Bonzini	rm -f Makefile.ninja ninjatool ninjatool.stamp Makefile.mtest
409793553acSAlexandre Raymond	rm -f config.log
41067ed96f9SPeter Maydell	rm -f linux-headers/asm
411d59157eaSPaolo Bonzini	rm -f docs/version.texi
412d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi
413d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7
414d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
415d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
416d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
41781f33401SPeter Maydell	rm -rf .doctrees
4185f71eac0SPeter Maydell	$(call clean-manual,devel)
4195f71eac0SPeter Maydell	$(call clean-manual,interop)
4200783a732SPeter Maydell	$(call clean-manual,specs)
4210928523aSPeter Maydell	$(call clean-manual,system)
42265c3542bSPeter Maydell	$(call clean-manual,tools)
42309147930SPaolo Bonzini	$(call clean-manual,user)
4242b1f35b9SAlex Bennée	for d in $(TARGET_DIRS); do \
425bc1b050dSbellard	rm -rf $$d || exit 1 ; \
42676bc6838Sbellard        done
427d9840e25STomoki Sekiyama	rm -Rf .sdk
4287d13299dSbellard
42906e7772fSGerd HoffmannKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  no  pt-br  sv \
430fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
43126b1cbf8SGerd Hoffmannde-ch  es     fo  fr-ca  hu     ja  mk  pt  sl     tr \
4323751e722SJan Krupabepo    cz
433fed4a9adSbellard
43477755340Sthsifdef INSTALL_BLOBS
43532eb2da3SBruce RogersBLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
4367a4dfd1eSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
4370a87fd69SGerd Hoffmannvgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \
438b2ce76a0SThomas Huthopenbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
4395ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
4405ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
4419fd02979SSander Eikelenboomefi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
4429fd02979SSander Eikelenboomefi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
44345027808SGerd Hoffmannefi-e1000e.rom efi-vmxnet3.rom \
444b3ce38dcSPhilippe Mathieu-Daudéqemu-nsis.bmp \
4454b387f9eSBALATON Zoltanbamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
4462785dc7bSStefano Garzarellamultiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
4476c5359e1SChristian Borntraegers390-ccw.img s390-netboot.img \
448744a928cSAlexey Kardashevskiyslof.bin skiboot.lid \
4490c6ab8c9SCole Robinsonpalcode-clipper \
45082e65fe0SBALATON Zoltanu-boot.e500 u-boot-sam460-20100605.bin \
45143ad2564SRichard Hendersonqemu_vga.ndrv \
45226ce90fdSLaszlo Ersekedk2-licenses.txt \
45391f3a2f0SAlistair Francishppa-firmware.img \
454a6fcc80bSBin Mengopensbi-riscv32-sifive_u-fw_jump.bin opensbi-riscv32-virt-fw_jump.bin \
45591f3a2f0SAlistair Francisopensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin
45677755340Sthselse
45777755340SthsBLOBS=
45877755340Sthsendif
45977755340Sths
460336cfef4SPeter Maydell# Note that we manually filter-out the non-Sphinx documentation which
46127a296fcSPeter Maydell# is currently built into the docs/interop directory in the build tree,
46227a296fcSPeter Maydell# and also any sphinx-built manpages.
4635f71eac0SPeter Maydelldefine install-manual =
4641290e671SPeter Maydellfor d in $$(cd $(MANUAL_BUILDDIR) && find $1 -type d); do $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/$$d"; done
46527a296fcSPeter Maydellfor f in $$(cd $(MANUAL_BUILDDIR) && find $1 -type f -a '!' '(' -name '*.[0-9]' -o -name 'qemu-*-qapi.*' -o -name 'qemu-*-ref.*' ')' ); do $(INSTALL_DATA) "$(MANUAL_BUILDDIR)/$$f" "$(DESTDIR)$(qemu_docdir)/$$f"; done
4665f71eac0SPeter Maydellendef
4675f71eac0SPeter Maydell
4685f71eac0SPeter Maydell# Note that we deliberately do not install the "devel" manual: it is
4695f71eac0SPeter Maydell# for QEMU developers, and not interesting to our users.
4705f71eac0SPeter Maydell.PHONY: install-sphinxdocs
4715f71eac0SPeter Maydellinstall-sphinxdocs: sphinxdocs
4725f71eac0SPeter Maydell	$(call install-manual,interop)
4730783a732SPeter Maydell	$(call install-manual,specs)
4740928523aSPeter Maydell	$(call install-manual,system)
47565c3542bSPeter Maydell	$(call install-manual,tools)
47609147930SPaolo Bonzini	$(call install-manual,user)
4775f71eac0SPeter Maydell
4785f71eac0SPeter Maydellinstall-doc: $(DOCS) install-sphinxdocs
479d7dd65baSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
48022108f33SStefan Hajnoczi	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)"
481c13dba2cSLiao Pingfang	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
482c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
483c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
48496d409ebSJuan Quintelaifdef CONFIG_POSIX
48558f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
486d06118bfSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1"
48756e8bdd4SMarc-André Lureau	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
488d59157eaSPaolo Bonzini	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
489acab923dSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7"
4901bf84a1eSKashyap Chamarthy	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7"
491c932ce31SPaolo Bonziniifeq ($(CONFIG_TOOLS),y)
492a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-img.1 "$(DESTDIR)$(mandir)/man1"
49358f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
494a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
49538954dcaSpbrookendif
49662dd1048SDaniel P. Berrangéifdef CONFIG_TRACE_SYSTEMTAP
497a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1"
49862dd1048SDaniel P. Berrangéendif
499f15bff25SPaolo Bonziniifeq ($(CONFIG_GUEST_AGENT),y)
500b53c54c6SPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
501c13dba2cSLiao Pingfang	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
502c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
503c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
504d59157eaSPaolo Bonzini	$(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
505665b5d0dSMarc-André Lureauendif
5068a3e8f7fSAndreas Färberendif
507a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
508a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
509a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
510a2d8f1beSM. Mohan Kumarendif
5116a7e2bbeSStefan Hajnocziifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
512a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtiofsd.1 "$(DESTDIR)$(mandir)/man1"
5136a7e2bbeSStefan Hajnocziendif
514b5ec5ce0Sjohn cooper
515e2d87bffSEduardo Habkostinstall-datadir:
516e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
517e2d87bffSEduardo Habkost
518f2e3978bSLaszlo Ersekinstall-localstatedir:
519f2e3978bSLaszlo Ersekifdef CONFIG_POSIX
520f15bff25SPaolo Bonziniifeq ($(CONFIG_GUEST_AGENT),y)
521f2e3978bSLaszlo Ersek	$(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
522f2e3978bSLaszlo Ersekendif
523f2e3978bSLaszlo Ersekendif
524f2e3978bSLaszlo Ersek
525a8260d38SDaniel P. BerrangéICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
526e2d87bffSEduardo Habkost
52754cb65d8SEmilio G. Cotainstall-includedir:
52854cb65d8SEmilio G. Cota	$(INSTALL_DIR) "$(DESTDIR)$(includedir)"
52954cb65d8SEmilio G. Cota
530a5665051SPaolo Bonzini# Needed by "meson install"
531a5665051SPaolo Bonziniexport DESTDIR
53254cb65d8SEmilio G. Cotainstall: all $(if $(BUILD_DOCS),install-doc) \
53354cb65d8SEmilio G. Cota	install-datadir install-localstatedir install-includedir \
5341338a4b7SMarkus Armbruster	recurse-install
535932a79dfSthsifneq ($(TOOLS),)
5360814465aSPaolo Bonzini	$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
537932a79dfSthsendif
538e3be6f0eSFam Zhengifneq ($(CONFIG_MODULES),)
539e3be6f0eSFam Zheng	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
5402115182fSMichael Tokarev	for s in $(modules-m:.mo=$(DSOSUF)); do \
5412115182fSMichael Tokarev		t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
542264f8b4fSMichael Tokarev		$(INSTALL_LIB) $$s "$$t"; \
5432115182fSMichael Tokarev		test -z "$(STRIP)" || $(STRIP) "$$t"; \
544e3be6f0eSFam Zheng	done
545e3be6f0eSFam Zhengendif
5467b93fadfSCorey Bryantifneq ($(HELPERS-y),)
5470d659426SMichael Tokarev	$(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
5487b93fadfSCorey Bryantendif
54962dd1048SDaniel P. Berrangéifdef CONFIG_TRACE_SYSTEMTAP
55062dd1048SDaniel P. Berrangé	$(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
55162dd1048SDaniel P. Berrangéendif
55277755340Sthsifneq ($(BLOBS),)
55377755340Sths	set -e; for x in $(BLOBS); do \
5546aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
555ad064840Spbrook	done
55677755340Sthsendif
557a8260d38SDaniel P. Berrangé	for s in $(ICON_SIZES); do \
5586c11dda9SStefan Hajnoczi		mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
559a8260d38SDaniel P. Berrangé		$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
5606c11dda9SStefan Hajnoczi			"$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
561a8260d38SDaniel P. Berrangé	done; \
5626c11dda9SStefan Hajnoczi	mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \
563a8260d38SDaniel P. Berrangé	$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \
5646c11dda9SStefan Hajnoczi		"$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
5656c11dda9SStefan Hajnoczi	mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \
566a8260d38SDaniel P. Berrangé	$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
5676c11dda9SStefan Hajnoczi		"$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
5686c11dda9SStefan Hajnoczi	mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
56967ea9546SDaniel P. Berrangé	$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
5706c11dda9SStefan Hajnoczi		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
5712a6b5372SMichael Tokarevifdef CONFIG_GTK
572834574eaSAnthony Liguori	$(MAKE) -C po $@
573834574eaSAnthony Liguoriendif
57454cb65d8SEmilio G. Cotaifeq ($(CONFIG_PLUGIN),y)
57554cb65d8SEmilio G. Cota	$(INSTALL_DATA) $(SRC_PATH)/include/qemu/qemu-plugin.h "$(DESTDIR)$(includedir)/qemu-plugin.h"
57654cb65d8SEmilio G. Cotaendif
5776aae2a2eSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
57818be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
5796aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
580ad064840Spbrook	done
581a81df1b6SPaolo Bonzini	for d in $(TARGET_DIRS); do \
582a81df1b6SPaolo Bonzini	$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
583a81df1b6SPaolo Bonzini        done
584612384d7Sbellard
5853ef693a0Sbellard# documentation
586e8518c92SMarkus ArmbrusterMAKEINFO=makeinfo
587d59157eaSPaolo BonziniMAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
588d59157eaSPaolo BonziniMAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES)
589e8338fdbSMarc-André LureauTEXI2PODFLAGS=$(MAKEINFOINCLUDES) -DVERSION="$(VERSION)" -DCONFDIR="$(qemu_confdir)"
590d59157eaSPaolo BonziniTEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES)
59156e8bdd4SMarc-André Lureau
592e8338fdbSMarc-André Lureaudocs/version.texi: $(SRC_PATH)/VERSION config-host.mak
593e8338fdbSMarc-André Lureau	$(call quiet-command,(\
594e8338fdbSMarc-André Lureau		echo "@set VERSION $(VERSION)" && \
595e8338fdbSMarc-André Lureau		echo "@set CONFDIR $(qemu_confdir)" \
596e8338fdbSMarc-André Lureau	)> $@,"GEN","$@")
597fea346f5SPeter Maydell
59844cb280dSPaolo Bonzini%.html: %.texi docs/version.texi
599e9ee06bdSMarc-André Lureau	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
600e9ee06bdSMarc-André Lureau	--html $< -o $@,"GEN","$@")
6013ef693a0Sbellard
60244cb280dSPaolo Bonzini%.info: %.texi docs/version.texi
603e9ee06bdSMarc-André Lureau	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@")
604f3548328Sbellard
60544cb280dSPaolo Bonzini%.txt: %.texi docs/version.texi
606f8bab10bSMarc-André Lureau	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
607f8bab10bSMarc-André Lureau	--plaintext $< -o $@,"GEN","$@")
608f8bab10bSMarc-André Lureau
60944cb280dSPaolo Bonzini%.pdf: %.texi docs/version.texi
610d59157eaSPaolo Bonzini	$(call quiet-command,texi2pdf $(TEXI2PDFFLAGS) $< -o $@,"GEN","$@")
611bd7f9747SMarkus Armbruster
6125f71eac0SPeter Maydell# Sphinx builds all its documentation at once in one invocation
6135f71eac0SPeter Maydell# and handles "don't rebuild things unless necessary" itself.
6145f71eac0SPeter Maydell# The '.doctrees' files are cached information to speed this up.
6155f71eac0SPeter Maydell.PHONY: sphinxdocs
6160928523aSPeter Maydellsphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \
6170928523aSPeter Maydell            $(MANUAL_BUILDDIR)/interop/index.html \
6180928523aSPeter Maydell            $(MANUAL_BUILDDIR)/specs/index.html \
61965c3542bSPeter Maydell            $(MANUAL_BUILDDIR)/system/index.html \
62009147930SPaolo Bonzini            $(MANUAL_BUILDDIR)/tools/index.html \
62109147930SPaolo Bonzini            $(MANUAL_BUILDDIR)/user/index.html
6225f71eac0SPeter Maydell
6235f71eac0SPeter Maydell# Canned command to build a single manual
62427a296fcSPeter Maydell# Arguments: $1 = manual name, $2 = Sphinx builder ('html' or 'man')
6256bda415cSEduardo Habkost# Note the use of different doctree for each (manual, builder) tuple;
6266bda415cSEduardo Habkost# this works around Sphinx not handling parallel invocation on
6276bda415cSEduardo Habkost# a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946
628516e8b7dSPeter Maydellbuild-manual = $(call quiet-command,CONFDIR="$(qemu_confdir)" $(SPHINX_BUILD) $(if $(V),,-q) $(SPHINX_WERROR) -b $2 -D version=$(VERSION) -D release="$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1")
6295f71eac0SPeter Maydell# We assume all RST files in the manual's directory are used in it
630814e068fSPeter Maydellmanual-deps = $(wildcard $(SRC_PATH)/docs/$1/*.rst $(SRC_PATH)/docs/$1/*/*.rst) \
631de1572caSPeter Maydell              $(SRC_PATH)/docs/defs.rst.inc \
6329165d323SPeter Maydell              $(SRC_PATH)/docs/$1/conf.py $(SRC_PATH)/docs/conf.py \
6339165d323SPeter Maydell              $(SRC_PATH)/docs/sphinx/*.py
634e0f3728dSPeter Maydell# Macro to write out the rule and dependencies for building manpages
635e0f3728dSPeter Maydell# Usage: $(call define-manpage-rule,manualname,manpage1 manpage2...[,extradeps])
636e0f3728dSPeter Maydell# 'extradeps' is optional, and specifies extra files (eg .hx files) that
637e0f3728dSPeter Maydell# the manual page depends on.
638e0f3728dSPeter Maydelldefine define-manpage-rule
639e0f3728dSPeter Maydell$(call atomic,$(foreach manpage,$2,$(MANUAL_BUILDDIR)/$1/$(manpage)),$(call manual-deps,$1) $3)
640e0f3728dSPeter Maydell	$(call build-manual,$1,man)
641e0f3728dSPeter Maydellendef
6425f71eac0SPeter Maydell
6431290e671SPeter Maydell$(MANUAL_BUILDDIR)/devel/index.html: $(call manual-deps,devel)
64427a296fcSPeter Maydell	$(call build-manual,devel,html)
6455f71eac0SPeter Maydell
646a08b4a9fSPeter Maydell$(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop)
64727a296fcSPeter Maydell	$(call build-manual,interop,html)
6485f71eac0SPeter Maydell
6490783a732SPeter Maydell$(MANUAL_BUILDDIR)/specs/index.html: $(call manual-deps,specs)
65027a296fcSPeter Maydell	$(call build-manual,specs,html)
65127a296fcSPeter Maydell
65209ce5f2dSPeter Maydell$(MANUAL_BUILDDIR)/system/index.html: $(call manual-deps,system) $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/qemu-options.hx
6530928523aSPeter Maydell	$(call build-manual,system,html)
6540928523aSPeter Maydell
655a08b4a9fSPeter Maydell$(MANUAL_BUILDDIR)/tools/index.html: $(call manual-deps,tools) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc
65665c3542bSPeter Maydell	$(call build-manual,tools,html)
65765c3542bSPeter Maydell
65809147930SPaolo Bonzini$(MANUAL_BUILDDIR)/user/index.html: $(call manual-deps,user)
65909147930SPaolo Bonzini	$(call build-manual,user,html)
66009147930SPaolo Bonzini
661a08b4a9fSPeter Maydell$(call define-manpage-rule,interop,qemu-ga.8)
6620783a732SPeter Maydell
663d06118bfSPeter Maydell$(call define-manpage-rule,system,qemu.1 qemu-block-drivers.7 qemu-cpu-models.7)
664acab923dSPeter Maydell
665a08b4a9fSPeter Maydell$(call define-manpage-rule,tools,\
666a08b4a9fSPeter Maydell       qemu-img.1 qemu-nbd.8 qemu-trace-stap.1\
667a08b4a9fSPeter Maydell       virtiofsd.1 virtfs-proxy-helper.1,\
668a08b4a9fSPeter Maydell       $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc)
669a08b4a9fSPeter Maydell
67022108f33SStefan Hajnoczi$(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h
671d83bbedaSStefan Hajnoczi	@mkdir -p "$(MANUAL_BUILDDIR)"
67222108f33SStefan Hajnoczi	$(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \
67322108f33SStefan Hajnoczi             "GEN","$@")
67422108f33SStefan Hajnoczi
675eb815e24SMarkus Armbrusterdocs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi
676fb0bc835SMarkus Armbruster	@cp -p $< $@
6774afeeb57SMarkus Armbruster
678f15bff25SPaolo Bonzinidocs/interop/qemu-ga-qapi.texi: qga/qga-qapi-doc.texi
679fb0bc835SMarkus Armbruster	@cp -p $< $@
68056e8bdd4SMarc-André Lureau
6815b1d0e92SPeter Maydellhtml: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs
6825b1d0e92SPeter Maydellinfo: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
6835b1d0e92SPeter Maydellpdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
6845b1d0e92SPeter Maydelltxt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
685818220f5Saliguori
686d59157eaSPaolo Bonzinidocs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \
687d59157eaSPaolo Bonzini    docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \
688d59157eaSPaolo Bonzini    docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \
689d59157eaSPaolo Bonzini	docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi
69056e8bdd4SMarc-André Lureau
691d59157eaSPaolo Bonzinidocs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \
692d59157eaSPaolo Bonzini    docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \
693d59157eaSPaolo Bonzini    docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \
694d59157eaSPaolo Bonzini	docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi
69556e8bdd4SMarc-André Lureau
696ae560cc3SEric Blake$(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl
697ae560cc3SEric Blake
698fe8bf5f6SAlex Bennée# Reports/Analysis
699fe8bf5f6SAlex Bennée
700fe8bf5f6SAlex Bennée%/coverage-report.html:
701fe8bf5f6SAlex Bennée	@mkdir -p $*
702fe8bf5f6SAlex Bennée	$(call quiet-command,\
7035eda6e42SAlex Bennée		gcovr -r $(SRC_PATH) \
7045eda6e42SAlex Bennée		$(foreach t, $(TARGET_DIRS), --object-directory $(BUILD_DIR)/$(t)) \
7055eda6e42SAlex Bennée		 --object-directory $(BUILD_DIR) \
706337f2311SAlex Bennée		-p --html --html-details -o $@, \
707fe8bf5f6SAlex Bennée		"GEN", "coverage-report.html")
708fe8bf5f6SAlex Bennée
709fe8bf5f6SAlex Bennée.PHONY: coverage-report
710fe8bf5f6SAlex Bennéecoverage-report: $(CURDIR)/reports/coverage/coverage-report.html
71156e8bdd4SMarc-André Lureau
712f53ec699SStefan Weilifdef CONFIG_WIN32
713f53ec699SStefan Weil
714f53ec699SStefan WeilINSTALLER = qemu-setup-$(VERSION)$(EXESUF)
715f53ec699SStefan Weil
716f53ec699SStefan Weilnsisflags = -V2 -NOCD
717f53ec699SStefan Weil
718f53ec699SStefan Weilifneq ($(wildcard $(SRC_PATH)/dll),)
719f53ec699SStefan Weilifeq ($(ARCH),x86_64)
720f53ec699SStefan Weil# 64 bit executables
721f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w64
722f53ec699SStefan Weilnsisflags += -DW64
723f53ec699SStefan Weilelse
724f53ec699SStefan Weil# 32 bit executables
725f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w32
726f53ec699SStefan Weilendif
727f53ec699SStefan Weilendif
728f53ec699SStefan Weil
729f53ec699SStefan Weil.PHONY: installer
730f53ec699SStefan Weilinstaller: $(INSTALLER)
731f53ec699SStefan Weil
732f53ec699SStefan WeilINSTDIR=/tmp/qemu-nsis
733f53ec699SStefan Weil
7341b00a4c4SPaolo Bonzini$(INSTALLER): $(SRC_PATH)/qemu.nsi
7351b00a4c4SPaolo Bonzini	$(MAKE) install DESTDIR=${INSTDIR}
736f53ec699SStefan Weilifdef SIGNCODE
7371b00a4c4SPaolo Bonzini	(cd ${INSTDIR}/${bindir}; \
738f53ec699SStefan Weil         for i in *.exe; do \
739f53ec699SStefan Weil           $(SIGNCODE) $${i}; \
740f53ec699SStefan Weil         done \
741f53ec699SStefan Weil        )
742f53ec699SStefan Weilendif # SIGNCODE
7431b00a4c4SPaolo Bonzini	(cd ${INSTDIR}/${bindir}; \
744f53ec699SStefan Weil         for i in qemu-system-*.exe; do \
745f53ec699SStefan Weil           arch=$${i%.exe}; \
746f53ec699SStefan Weil           arch=$${arch#qemu-system-}; \
747f53ec699SStefan Weil           echo Section \"$$arch\" Section_$$arch; \
748f53ec699SStefan Weil           echo SetOutPath \"\$$INSTDIR\"; \
749f53ec699SStefan Weil           echo File \"\$${BINDIR}\\$$i\"; \
750f53ec699SStefan Weil           echo SectionEnd; \
751f53ec699SStefan Weil         done \
7521b00a4c4SPaolo Bonzini        ) >${INSTDIR}/${bindir}/system-emulations.nsh
753f53ec699SStefan Weil	makensis $(nsisflags) \
754f53ec699SStefan Weil                $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
755f53ec699SStefan Weil                $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
7561b00a4c4SPaolo Bonzini                -DBINDIR="${INSTDIR}/${bindir}" \
757f53ec699SStefan Weil                $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
758f53ec699SStefan Weil                -DSRCDIR="$(SRC_PATH)" \
759f53ec699SStefan Weil                -DOUTFILE="$(INSTALLER)" \
760805d8a67SStefan Weil                -DDISPLAYVERSION="$(VERSION)" \
761f53ec699SStefan Weil                $(SRC_PATH)/qemu.nsi
762f53ec699SStefan Weil	rm -r ${INSTDIR}
763f53ec699SStefan Weilifdef SIGNCODE
764f53ec699SStefan Weil	$(SIGNCODE) $(INSTALLER)
765f53ec699SStefan Weilendif # SIGNCODE
766f53ec699SStefan Weilendif # CONFIG_WIN
767f53ec699SStefan Weil
768cb5fc67dSAnthony Liguori# Add a dependency on the generated files, so that they are always
769cb5fc67dSAnthony Liguori# rebuilt before other object files
770428952cfSThomas Huthifneq ($(wildcard config-host.mak),)
771eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
7723dff199cSLaurent VivierMakefile: $(generated-files-y)
7737748b8cbSMike Frysingerendif
774428952cfSThomas Huthendif
775cb5fc67dSAnthony Liguori
7764fb240a4Sbellard# Include automatically generated dependency files
7771435ddb8SPaolo Bonzini# Dependencies in Makefile.objs files come from our recursive subdir rules
7781435ddb8SPaolo Bonzini-include $(wildcard *.d tests/*.d)
779324027c2SFam Zheng
780324027c2SFam Zhenginclude $(SRC_PATH)/tests/docker/Makefile.include
781b1fb9a63SFam Zhenginclude $(SRC_PATH)/tests/vm/Makefile.include
7820d8e065fSMarc-André Lureau
783c355de59SPhilippe Mathieu-Daudéprint-help-run = printf "  %-30s - %s\\n" "$1" "$2"
784c355de59SPhilippe Mathieu-Daudéprint-help = $(quiet-@)$(call print-help-run,$1,$2)
785c355de59SPhilippe Mathieu-Daudé
7860d8e065fSMarc-André Lureau.PHONY: help
7870d8e065fSMarc-André Lureauhelp:
7880d8e065fSMarc-André Lureau	@echo  'Generic targets:'
789c355de59SPhilippe Mathieu-Daudé	$(call print-help,all,Build all)
7900decdfe2SMarc-André Lureauifdef CONFIG_MODULES
791c355de59SPhilippe Mathieu-Daudé	$(call print-help,modules,Build all modules)
7920decdfe2SMarc-André Lureauendif
793c355de59SPhilippe Mathieu-Daudé	$(call print-help,dir/file.o,Build specified target only)
794c355de59SPhilippe Mathieu-Daudé	$(call print-help,install,Install QEMU, documentation and tools)
795c355de59SPhilippe Mathieu-Daudé	$(call print-help,ctags/TAGS,Generate tags file for editors)
796c355de59SPhilippe Mathieu-Daudé	$(call print-help,cscope,Generate cscope index)
797968b4db3SPaolo Bonzini	$(call print-help,sparse,Run sparse on the QEMU source)
7980d8e065fSMarc-André Lureau	@echo  ''
7992b1f35b9SAlex Bennée	@$(if $(TARGET_DIRS), \
8000d8e065fSMarc-André Lureau		echo 'Architecture specific targets:'; \
8012b1f35b9SAlex Bennée		$(foreach t, $(TARGET_DIRS), \
802763815a8SPhilippe Mathieu-Daudé		$(call print-help-run,$(t)/all,Build for $(t)); \
803763815a8SPhilippe Mathieu-Daudé		$(if $(CONFIG_FUZZ), \
804763815a8SPhilippe Mathieu-Daudé			$(if $(findstring softmmu,$(t)), \
805763815a8SPhilippe Mathieu-Daudé				$(call print-help-run,$(t)/fuzz,Build fuzzer for $(t)); \
806763815a8SPhilippe Mathieu-Daudé		))) \
8070d8e065fSMarc-André Lureau		echo '')
808fdbff6bdSPhilippe Mathieu-Daudé	@$(if $(HELPERS-y), \
809fdbff6bdSPhilippe Mathieu-Daudé		echo 'Helper targets:'; \
810fdbff6bdSPhilippe Mathieu-Daudé		$(foreach t, $(HELPERS-y), \
811fdbff6bdSPhilippe Mathieu-Daudé		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
812fdbff6bdSPhilippe Mathieu-Daudé		echo '')
81381ed0a57SPhilippe Mathieu-Daudé	@$(if $(TOOLS), \
81481ed0a57SPhilippe Mathieu-Daudé		echo 'Tools targets:'; \
81581ed0a57SPhilippe Mathieu-Daudé		$(foreach t, $(TOOLS), \
81681ed0a57SPhilippe Mathieu-Daudé		$(call print-help-run,$(t),Build $(shell basename $(t)) tool);) \
8170d8e065fSMarc-André Lureau		echo '')
8180d8e065fSMarc-André Lureau	@echo  'Cleaning targets:'
819c355de59SPhilippe Mathieu-Daudé	$(call print-help,clean,Remove most generated files but keep the config)
820c355de59SPhilippe Mathieu-Daudé	$(call print-help,distclean,Remove all generated files)
821c355de59SPhilippe Mathieu-Daudé	$(call print-help,dist,Build a distributable tarball)
8220d8e065fSMarc-André Lureau	@echo  ''
8230d8e065fSMarc-André Lureau	@echo  'Test targets:'
824c355de59SPhilippe Mathieu-Daudé	$(call print-help,check,Run all tests (check-help for details))
825c355de59SPhilippe Mathieu-Daudé	$(call print-help,docker,Help about targets running tests inside containers)
826c355de59SPhilippe Mathieu-Daudé	$(call print-help,vm-help,Help about targets running tests inside VM)
8270d8e065fSMarc-André Lureau	@echo  ''
8280d8e065fSMarc-André Lureau	@echo  'Documentation targets:'
829c355de59SPhilippe Mathieu-Daudé	$(call print-help,html info pdf txt,Build documentation in specified format)
8300d8e065fSMarc-André Lureau	@echo  ''
8310d8e065fSMarc-André Lureauifdef CONFIG_WIN32
8320d8e065fSMarc-André Lureau	@echo  'Windows targets:'
833c355de59SPhilippe Mathieu-Daudé	$(call print-help,installer,Build NSIS-based installer for QEMU)
8340d8e065fSMarc-André Lureauifdef QEMU_GA_MSI_ENABLED
835c355de59SPhilippe Mathieu-Daudé	$(call print-help,msi,Build MSI-based installer for qemu-ga)
8360d8e065fSMarc-André Lureauendif
8370d8e065fSMarc-André Lureau	@echo  ''
8380d8e065fSMarc-André Lureauendif
839c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) [targets],(quiet build, default))
840c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) V=1 [targets],(verbose build))
841