xref: /openbmc/qemu/Makefile (revision d3b18480)
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
127*d3b18480SMarc-André Lureaugenerated-files-y += target/s390x/gen-features.h
128*d3b18480SMarc-André Lureautarget/s390x/gen-features.h: Makefile.ninja
1290c0c1fd9SMarc Mari
1303dff199cSLaurent Viviergenerated-files-y += .git-submodule-status
1310ab8ed18SDaniel P. Berrange
132d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
133d9ace8b3SJuan Quintela# We don't generate any of them
134d9ace8b3SJuan QuintelaMakefile: ;
135d9ace8b3SJuan Quintelaconfigure: ;
136d9ace8b3SJuan Quintela
137bd3f5706SMarc-André Lureau.PHONY: all clean cscope distclean html info install install-doc \
1387c3d1917SDaniel P. Berrange	pdf txt recurse-all dist msi FORCE
1390cb3fb1eSpbrook
140fec90ff0SPaolo Bonzini$(call set-vpath, $(SRC_PATH))
1418c462f8fSpbrook
1423e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
14367c0f08dSJuan Quintela
144fdbff6bdSPhilippe Mathieu-DaudéHELPERS-y = $(HELPERS)
145d52c454aSMarc-André Lureau
146b53c54c6SPeter Maydell# Sphinx does not allow building manuals into the same directory as
147b53c54c6SPeter Maydell# the source files, so if we're doing an in-tree QEMU build we must
148b53c54c6SPeter Maydell# build the manuals into a subdirectory (and then install them from
149b53c54c6SPeter Maydell# there for 'make install'). For an out-of-tree build we can just
150b53c54c6SPeter Maydell# use the docs/ subdirectory in the build tree as normal.
151b53c54c6SPeter Maydellifeq ($(realpath $(SRC_PATH)),$(realpath .))
152b53c54c6SPeter MaydellMANUAL_BUILDDIR := docs/built
153b53c54c6SPeter Maydellelse
154b53c54c6SPeter MaydellMANUAL_BUILDDIR := docs
155b53c54c6SPeter Maydellendif
156b53c54c6SPeter Maydell
157cc8ae6deSpbrookifdef BUILD_DOCS
158d06118bfSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/system/qemu.1
159a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/qemu-img.1
160a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/qemu-nbd.8
16187c0868fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8
1626a7e2bbeSStefan Hajnocziifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
163a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/virtiofsd.1
1646a7e2bbeSStefan Hajnocziendif
165acab923dSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7
166d59157eaSPaolo BonziniDOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
167d59157eaSPaolo BonziniDOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
1681bf84a1eSKashyap ChamarthyDOCS+=$(MANUAL_BUILDDIR)/system/qemu-cpu-models.7
16922108f33SStefan HajnocziDOCS+=$(MANUAL_BUILDDIR)/index.html
170983eef5aSMeador Ingeifdef CONFIG_VIRTFS
171a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1
172983eef5aSMeador Ingeendif
17362dd1048SDaniel P. Berrangéifdef CONFIG_TRACE_SYSTEMTAP
174a08b4a9fSPeter MaydellDOCS+=$(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1
17562dd1048SDaniel P. Berrangéendif
176cc8ae6deSpbrookelse
177cc8ae6deSpbrookDOCS=
178cc8ae6deSpbrookendif
1797d13299dSbellard
1808cc357b5SDaniel P. BerrangeSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
181e0e312f3SPaolo BonziniSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(filter %-softmmu, $(TARGET_DIRS)))
182e0e312f3SPaolo BonziniSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %.d, $(SUBDIR_DEVICES_MAK))
1831f3d3c8fSJuan Quintela
1848bdd3d49SStefan Weilifeq ($(SUBDIR_DEVICES_MAK),)
185b7c11e57SPaolo Bonziniconfig-all-devices.mak: config-host.mak
1860bdb12c7SPeter Maydell	$(call quiet-command,echo '# no devices' > $@,"GEN","$@")
1878bdd3d49SStefan Weilelse
188b7c11e57SPaolo Bonziniconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak
189bb585a78SPaolo Bonzini	$(call quiet-command, sed -n \
190bb585a78SPaolo Bonzini             's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
191bb585a78SPaolo Bonzini             $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
1920bdb12c7SPeter Maydell             "GEN","$@")
1938bdd3d49SStefan Weilendif
1941f3d3c8fSJuan Quintela
195bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
196bd9141bbSPaul Brook
197e0e312f3SPaolo Bonzini# This has to be kept in sync with Kconfig.host.
198e0e312f3SPaolo BonziniMINIKCONF_ARGS = \
199f3494749SPaolo Bonzini    $(CONFIG_MINIKCONF_MODE) \
200aaa1b70aSPaolo Bonzini    $@ $*/config-devices.mak.d $< $(SRC_PATH)/Kconfig \
20196df0fddSPhilippe Mathieu-Daudé    CONFIG_TCG=$(CONFIG_TCG) \
202e0e312f3SPaolo Bonzini    CONFIG_KVM=$(CONFIG_KVM) \
203e0e312f3SPaolo Bonzini    CONFIG_SPICE=$(CONFIG_SPICE) \
204e0e312f3SPaolo Bonzini    CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
205e0e312f3SPaolo Bonzini    CONFIG_TPM=$(CONFIG_TPM) \
206e0e312f3SPaolo Bonzini    CONFIG_XEN=$(CONFIG_XEN) \
207e0e312f3SPaolo Bonzini    CONFIG_OPENGL=$(CONFIG_OPENGL) \
208e0e312f3SPaolo Bonzini    CONFIG_X11=$(CONFIG_X11) \
209e0e312f3SPaolo Bonzini    CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \
21021c6b0c8SMarc-André Lureau    CONFIG_VHOST_KERNEL=$(CONFIG_VHOST_KERNEL) \
211e0e312f3SPaolo Bonzini    CONFIG_VIRTFS=$(CONFIG_VIRTFS) \
212d6c1bd4aSPaolo Bonzini    CONFIG_LINUX=$(CONFIG_LINUX) \
213d6c1bd4aSPaolo Bonzini    CONFIG_PVRDMA=$(CONFIG_PVRDMA)
214e0e312f3SPaolo Bonzini
215f4bda37dSPhilippe Mathieu-DaudéMINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
216e0e312f3SPaolo Bonzini
217aaa1b70aSPaolo Bonzini$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/Kconfig $(BUILD_DIR)/config-host.mak
2181e0ef873SPhilippe Mathieu-Daudé	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
2191e0ef873SPhilippe Mathieu-Daudé		> $@.tmp, "GEN", "$@.tmp")
22012ccfec9SMichael S. Tsirkin	$(call quiet-command, if test -f $@; then \
221904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
222012f0879SStefan Weil	    mv $@.tmp $@; \
223012f0879SStefan Weil	    cp -p $@ $@.old; \
224012f0879SStefan Weil	  else \
225012f0879SStefan Weil	    if test -f $@.old; then \
226012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
227012f0879SStefan Weil	    else \
228a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
229012f0879SStefan Weil	    fi; \
230b98a3baeSPhilippe Mathieu-Daudé	    echo "Run \"$(MAKE) defconfig\" to regenerate."; \
231a992fe3dSPaul Brook	    rm $@.tmp; \
232012f0879SStefan Weil	  fi; \
233a992fe3dSPaul Brook	 else \
234a992fe3dSPaul Brook	  mv $@.tmp $@; \
235012f0879SStefan Weil	  cp -p $@ $@.old; \
2360bdb12c7SPeter Maydell	 fi,"GEN","$@");
237a992fe3dSPaul Brook
238a992fe3dSPaul Brookdefconfig:
239a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
240a992fe3dSPaul Brook
241992aeb8eSPaolo Bonziniifneq ($(wildcard config-host.mak),)
242992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/Makefile.objs
243ba1183daSFam Zhengendif
244ba1183daSFam Zheng
245ba1183daSFam Zhengdummy := $(call unnest-vars,, \
24632d955a4SMarc-André Lureau                chardev-obj-y \
247ba1183daSFam Zheng                block-obj-y \
248cc475698SFam Zheng                block-obj-m \
24914837c64SKevin Wolf                storage-daemon-obj-y \
25014837c64SKevin Wolf                storage-daemon-obj-m \
251cc475698SFam Zheng                common-obj-y \
252a81df1b6SPaolo Bonzini                common-obj-m)
253243af022SPaolo Bonzini
25446e7b706SFam Zhenginclude $(SRC_PATH)/tests/Makefile.include
255992aeb8eSPaolo Bonzini
256ea458960SMarc-André Lureauall: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules
257b9dea4fbSpbrook
2581215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
2591215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
2601215c6e7SJuan Quintela
261c621dc3eSAlexander BulekovTARGET_DIRS_RULES := $(foreach t, all fuzz clean install, $(addsuffix /$(t), $(TARGET_DIRS)))
262916359f6SAndreas Färber
2631338a4b7SMarkus ArmbrusterSOFTMMU_ALL_RULES=$(filter %-softmmu/all, $(TARGET_DIRS_RULES))
2641338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(authz-obj-y)
2651338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(block-obj-y)
26614837c64SKevin Wolf$(SOFTMMU_ALL_RULES): $(storage-daemon-obj-y)
2671338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(chardev-obj-y)
2681338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(crypto-obj-y)
2691338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): $(io-obj-y)
270de59dda3SMarc-André Lureau$(SOFTMMU_ALL_RULES): $(qom-obj-y)
2711338a4b7SMarkus Armbruster$(SOFTMMU_ALL_RULES): config-all-devices.mak
272cec7d0b6Spbrook
273c621dc3eSAlexander BulekovSOFTMMU_FUZZ_RULES=$(filter %-softmmu/fuzz, $(TARGET_DIRS_RULES))
274c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(authz-obj-y)
275c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(block-obj-y)
276c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(chardev-obj-y)
277c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(crypto-obj-y)
278c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(io-obj-y)
279c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): config-all-devices.mak
280c621dc3eSAlexander Bulekov$(SOFTMMU_FUZZ_RULES): $(edk2-decompressed)
281c621dc3eSAlexander Bulekov
2821338a4b7SMarkus Armbruster.PHONY: $(TARGET_DIRS_RULES)
2831338a4b7SMarkus Armbruster# The $(TARGET_DIRS_RULES) are of the form SUBDIR/GOAL, so that
2841338a4b7SMarkus Armbruster# $(dir $@) yields the sub-directory, and $(notdir $@) yields the sub-goal
2851338a4b7SMarkus Armbruster$(TARGET_DIRS_RULES):
2861338a4b7SMarkus Armbruster	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
2874aa42531Spbrook
28867953a37SClaudio Fontana# LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC
28967953a37SClaudio FontanaDTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib=""
290965f486cSPeter MaydellDTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
29167953a37SClaudio FontanaDTC_CPPFLAGS=-I$(SRC_PATH)/dtc/libfdt
292a540f158SPeter Crosthwaite
2933b8593eeSMarkus Armbruster.PHONY: dtc/all
29467953a37SClaudio Fontanadtc/all: .git-submodule-status dtc/libfdt
29567953a37SClaudio 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,)
296a540f158SPeter Crosthwaite
29700525864SAaron Lindsaydtc/%: .git-submodule-status
298814e1110SJan Kiszka	@mkdir -p $@
299a540f158SPeter Crosthwaite
300e219c499SRichard Henderson# Overriding CFLAGS causes us to lose defines added in the sub-makefile.
301e219c499SRichard Henderson# Not overriding CFLAGS leads to mis-matches between compilation modes.
302e219c499SRichard Henderson# Therefore we replicate some of the logic in the sub-makefile.
303e219c499SRichard Henderson# Remove all the extra -Warning flags that QEMU uses that Capstone doesn't;
304e219c499SRichard Henderson# no need to annoy QEMU developers with such things.
305e219c499SRichard HendersonCAP_CFLAGS = $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS))
306e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
307e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_ARM
308e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_ARM64
309e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
310e219c499SRichard HendersonCAP_CFLAGS += -DCAPSTONE_HAS_X86
311e219c499SRichard Henderson
3123b8593eeSMarkus Armbruster.PHONY: capstone/all
3133b8593eeSMarkus Armbrustercapstone/all: .git-submodule-status
3149f81aeb5SAlistair 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))
315e219c499SRichard Henderson
3163b8593eeSMarkus Armbruster.PHONY: slirp/all
3173b8593eeSMarkus Armbrusterslirp/all: .git-submodule-status
318daa79d9aSAlex Bennée	$(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp		\
319daa79d9aSAlex Bennée		BUILD_DIR="$(BUILD_DIR)/slirp" 			\
320daa79d9aSAlex Bennée		PKG_CONFIG="$(PKG_CONFIG)" 				\
321daa79d9aSAlex Bennée		CC="$(CC)" AR="$(AR)" 	LD="$(LD)" RANLIB="$(RANLIB)"	\
322db5adeaaSPaolo Bonzini		CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
323675b9b53SMarc-André Lureau
3241338a4b7SMarkus Armbruster$(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
325b8d89ba8SPaolo Bonzini	$(qom-obj-y)
326add16157SBlue Swirl
327c621dc3eSAlexander Bulekov$(filter %/fuzz, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
328c621dc3eSAlexander Bulekov	$(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY))
329c621dc3eSAlexander Bulekov
3303b8593eeSMarkus ArmbrusterROM_DIRS = $(addprefix pc-bios/, $(ROMS))
3311338a4b7SMarkus ArmbrusterROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
332a9c87304SMarc-André Lureau# Only keep -O and -g cflags
3331338a4b7SMarkus Armbruster.PHONY: $(ROM_DIRS_RULES)
3341338a4b7SMarkus Armbruster$(ROM_DIRS_RULES):
3351338a4b7SMarkus Armbruster	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
336c05ac895SPaul Brook
3378d358a5eSMarkus Armbruster.PHONY: recurse-all recurse-clean recurse-install
3381338a4b7SMarkus Armbrusterrecurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
3391338a4b7SMarkus Armbrusterrecurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
3401338a4b7SMarkus Armbrusterrecurse-install: $(addsuffix /install, $(TARGET_DIRS))
34147ae060eSMarkus Armbruster$(addsuffix /install, $(TARGET_DIRS)): all
3424aa42531Spbrook
343c17a18efSMarc-André Lureau$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h
3440bdb12c7SPeter Maydell	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o")
3455354e4d2SMarc-André Lureau
346c17a18efSMarc-André LureauMakefile: $(version-obj-y)
3473bc2f570SPaolo Bonzini
3483bc2f570SPaolo Bonzini######################################################################
3494fb240a4Sbellard
350ebedb37cSPaolo BonziniCOMMON_LDADDS = libqemuutil.a
3510ab8ed18SDaniel P. Berrange
3523c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
353153859beSStuart Brady
3545b76dd13SDaniel P. Berrangeqemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
3555b76dd13SDaniel P. Berrangeqemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
3565b76dd13SDaniel P. Berrangeqemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
3575e6911cfSKevin 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)
3580a8e1acdSaliguori
3595b76dd13SDaniel 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)
360fe8fc5aeSPaolo Bonziniifdef CONFIG_MPATH
361fe8fc5aeSPaolo Bonziniscsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
362fe8fc5aeSPaolo Bonziniendif
363b855f8d1SPaolo Bonzini
3640c0c1fd9SMarc Marimodule_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak
3650c0c1fd9SMarc Mari	$(call quiet-command,$(PYTHON) $< $@ \
3660c0c1fd9SMarc Mari	$(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
3670bdb12c7SPeter Maydell	"GEN","$@")
3680c0c1fd9SMarc Mari
369a5665051SPaolo Bonziniclean: recurse-clean ninja-clean clean-ctlist
370a5665051SPaolo Bonzini	-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean
3712d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
37225be210fSJuan 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
373df2943baSMichael S. Tsirkin	rm -f qemu-options.def
37423858f40SLaszlo Ersek	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
37523858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
37623858f40SLaszlo Ersek		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
37723858f40SLaszlo Ersek		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
37823858f40SLaszlo Ersek		-exec rm {} +
3790814465aSPaolo Bonzini	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~ */*~
380b855f8d1SPaolo Bonzini	rm -f fsdev/*.pod scsi/*.pod
3813dff199cSLaurent Vivier	rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
382e92af6ecSJuan Quintela	rm -f config-all-devices.mak
383d69cda7eSPeter Maydell	rm -f $(SUBDIR_DEVICES_MAK)
38431e31b8aSbellard
38534bb443eSAnthony LiguoriVERSION ?= $(shell cat VERSION)
38634bb443eSAnthony Liguori
38734bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2
38834bb443eSAnthony Liguori
38934bb443eSAnthony Liguoriqemu-%.tar.bz2:
39034bb443eSAnthony Liguori	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
39134bb443eSAnthony Liguori
3925f71eac0SPeter Maydelldefine clean-manual =
3931290e671SPeter Maydellrm -rf $(MANUAL_BUILDDIR)/$1/_static
3941290e671SPeter Maydellrm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html
3955f71eac0SPeter Maydellendef
3965f71eac0SPeter Maydell
397a5665051SPaolo Bonzinidistclean: clean ninja-distclean
398a5665051SPaolo Bonzini	-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean -g
399ee5195eeSRichard Henderson	rm -f config-host.mak config-host.h* $(DOCS)
4002038f8c8SPaolo Bonzini	rm -f tests/tcg/config-*.mak
401ae219359SThomas Huth	rm -f config-all-devices.mak config-all-disas.mak config.status
402e92af6ecSJuan Quintela	rm -f $(SUBDIR_DEVICES_MAK)
403ae219359SThomas Huth	rm -f po/*.mo tests/qemu-iotests/common.env
404fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
40526fffe29SEmilio G. Cota	rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
406a5665051SPaolo Bonzini	rm -rf meson-private meson-logs meson-info compile_commands.json
407245dac4aSPaolo Bonzini	rm -f Makefile.ninja ninjatool ninjatool.stamp Makefile.mtest
408793553acSAlexandre Raymond	rm -f config.log
40967ed96f9SPeter Maydell	rm -f linux-headers/asm
410d59157eaSPaolo Bonzini	rm -f docs/version.texi
411d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi
412d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7
413d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
414d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
415d59157eaSPaolo Bonzini	rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
41681f33401SPeter Maydell	rm -rf .doctrees
4175f71eac0SPeter Maydell	$(call clean-manual,devel)
4185f71eac0SPeter Maydell	$(call clean-manual,interop)
4190783a732SPeter Maydell	$(call clean-manual,specs)
4200928523aSPeter Maydell	$(call clean-manual,system)
42165c3542bSPeter Maydell	$(call clean-manual,tools)
42209147930SPaolo Bonzini	$(call clean-manual,user)
4232b1f35b9SAlex Bennée	for d in $(TARGET_DIRS); do \
424bc1b050dSbellard	rm -rf $$d || exit 1 ; \
42576bc6838Sbellard        done
426d9840e25STomoki Sekiyama	rm -Rf .sdk
4277d13299dSbellard
42806e7772fSGerd HoffmannKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  no  pt-br  sv \
429fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
43026b1cbf8SGerd Hoffmannde-ch  es     fo  fr-ca  hu     ja  mk  pt  sl     tr \
4313751e722SJan Krupabepo    cz
432fed4a9adSbellard
43377755340Sthsifdef INSTALL_BLOBS
43432eb2da3SBruce RogersBLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
4357a4dfd1eSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
4360a87fd69SGerd Hoffmannvgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \
437b2ce76a0SThomas Huthopenbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
4385ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
4395ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
4409fd02979SSander Eikelenboomefi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
4419fd02979SSander Eikelenboomefi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
44245027808SGerd Hoffmannefi-e1000e.rom efi-vmxnet3.rom \
443b3ce38dcSPhilippe Mathieu-Daudéqemu-nsis.bmp \
4444b387f9eSBALATON Zoltanbamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
4452785dc7bSStefano Garzarellamultiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
4466c5359e1SChristian Borntraegers390-ccw.img s390-netboot.img \
447744a928cSAlexey Kardashevskiyslof.bin skiboot.lid \
4480c6ab8c9SCole Robinsonpalcode-clipper \
44982e65fe0SBALATON Zoltanu-boot.e500 u-boot-sam460-20100605.bin \
45043ad2564SRichard Hendersonqemu_vga.ndrv \
45126ce90fdSLaszlo Ersekedk2-licenses.txt \
45291f3a2f0SAlistair Francishppa-firmware.img \
453a6fcc80bSBin Mengopensbi-riscv32-sifive_u-fw_jump.bin opensbi-riscv32-virt-fw_jump.bin \
45491f3a2f0SAlistair Francisopensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin
45577755340Sthselse
45677755340SthsBLOBS=
45777755340Sthsendif
45877755340Sths
459336cfef4SPeter Maydell# Note that we manually filter-out the non-Sphinx documentation which
46027a296fcSPeter Maydell# is currently built into the docs/interop directory in the build tree,
46127a296fcSPeter Maydell# and also any sphinx-built manpages.
4625f71eac0SPeter Maydelldefine install-manual =
4631290e671SPeter Maydellfor d in $$(cd $(MANUAL_BUILDDIR) && find $1 -type d); do $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/$$d"; done
46427a296fcSPeter 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
4655f71eac0SPeter Maydellendef
4665f71eac0SPeter Maydell
4675f71eac0SPeter Maydell# Note that we deliberately do not install the "devel" manual: it is
4685f71eac0SPeter Maydell# for QEMU developers, and not interesting to our users.
4695f71eac0SPeter Maydell.PHONY: install-sphinxdocs
4705f71eac0SPeter Maydellinstall-sphinxdocs: sphinxdocs
4715f71eac0SPeter Maydell	$(call install-manual,interop)
4720783a732SPeter Maydell	$(call install-manual,specs)
4730928523aSPeter Maydell	$(call install-manual,system)
47465c3542bSPeter Maydell	$(call install-manual,tools)
47509147930SPaolo Bonzini	$(call install-manual,user)
4765f71eac0SPeter Maydell
4775f71eac0SPeter Maydellinstall-doc: $(DOCS) install-sphinxdocs
478d7dd65baSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
47922108f33SStefan Hajnoczi	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)"
480c13dba2cSLiao Pingfang	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
481c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
482c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
48396d409ebSJuan Quintelaifdef CONFIG_POSIX
48458f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
485d06118bfSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1"
48656e8bdd4SMarc-André Lureau	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
487d59157eaSPaolo Bonzini	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
488acab923dSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7"
4891bf84a1eSKashyap Chamarthy	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7"
490c932ce31SPaolo Bonziniifeq ($(CONFIG_TOOLS),y)
491a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-img.1 "$(DESTDIR)$(mandir)/man1"
49258f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
493a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
49438954dcaSpbrookendif
49562dd1048SDaniel P. Berrangéifdef CONFIG_TRACE_SYSTEMTAP
496a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1"
49762dd1048SDaniel P. Berrangéendif
498f15bff25SPaolo Bonziniifeq ($(CONFIG_GUEST_AGENT),y)
499b53c54c6SPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
500c13dba2cSLiao Pingfang	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
501c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
502c13dba2cSLiao Pingfang	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
503d59157eaSPaolo Bonzini	$(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
504665b5d0dSMarc-André Lureauendif
5058a3e8f7fSAndreas Färberendif
506a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
507a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
508a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
509a2d8f1beSM. Mohan Kumarendif
5106a7e2bbeSStefan Hajnocziifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
511a08b4a9fSPeter Maydell	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtiofsd.1 "$(DESTDIR)$(mandir)/man1"
5126a7e2bbeSStefan Hajnocziendif
513b5ec5ce0Sjohn cooper
514e2d87bffSEduardo Habkostinstall-datadir:
515e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
516e2d87bffSEduardo Habkost
517f2e3978bSLaszlo Ersekinstall-localstatedir:
518f2e3978bSLaszlo Ersekifdef CONFIG_POSIX
519f15bff25SPaolo Bonziniifeq ($(CONFIG_GUEST_AGENT),y)
520f2e3978bSLaszlo Ersek	$(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
521f2e3978bSLaszlo Ersekendif
522f2e3978bSLaszlo Ersekendif
523f2e3978bSLaszlo Ersek
524a8260d38SDaniel P. BerrangéICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
525e2d87bffSEduardo Habkost
52654cb65d8SEmilio G. Cotainstall-includedir:
52754cb65d8SEmilio G. Cota	$(INSTALL_DIR) "$(DESTDIR)$(includedir)"
52854cb65d8SEmilio G. Cota
529a5665051SPaolo Bonzini# Needed by "meson install"
530a5665051SPaolo Bonziniexport DESTDIR
53154cb65d8SEmilio G. Cotainstall: all $(if $(BUILD_DOCS),install-doc) \
53254cb65d8SEmilio G. Cota	install-datadir install-localstatedir install-includedir \
5331338a4b7SMarkus Armbruster	recurse-install
534932a79dfSthsifneq ($(TOOLS),)
5350814465aSPaolo Bonzini	$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
536932a79dfSthsendif
537e3be6f0eSFam Zhengifneq ($(CONFIG_MODULES),)
538e3be6f0eSFam Zheng	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
5392115182fSMichael Tokarev	for s in $(modules-m:.mo=$(DSOSUF)); do \
5402115182fSMichael Tokarev		t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
541264f8b4fSMichael Tokarev		$(INSTALL_LIB) $$s "$$t"; \
5422115182fSMichael Tokarev		test -z "$(STRIP)" || $(STRIP) "$$t"; \
543e3be6f0eSFam Zheng	done
544e3be6f0eSFam Zhengendif
5457b93fadfSCorey Bryantifneq ($(HELPERS-y),)
5460d659426SMichael Tokarev	$(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
5477b93fadfSCorey Bryantendif
54862dd1048SDaniel P. Berrangéifdef CONFIG_TRACE_SYSTEMTAP
54962dd1048SDaniel P. Berrangé	$(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
55062dd1048SDaniel P. Berrangéendif
55177755340Sthsifneq ($(BLOBS),)
55277755340Sths	set -e; for x in $(BLOBS); do \
5536aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
554ad064840Spbrook	done
55577755340Sthsendif
556a8260d38SDaniel P. Berrangé	for s in $(ICON_SIZES); do \
5576c11dda9SStefan Hajnoczi		mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
558a8260d38SDaniel P. Berrangé		$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
5596c11dda9SStefan Hajnoczi			"$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
560a8260d38SDaniel P. Berrangé	done; \
5616c11dda9SStefan Hajnoczi	mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \
562a8260d38SDaniel P. Berrangé	$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \
5636c11dda9SStefan Hajnoczi		"$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
5646c11dda9SStefan Hajnoczi	mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \
565a8260d38SDaniel P. Berrangé	$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
5666c11dda9SStefan Hajnoczi		"$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
5676c11dda9SStefan Hajnoczi	mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
56867ea9546SDaniel P. Berrangé	$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
5696c11dda9SStefan Hajnoczi		"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
5702a6b5372SMichael Tokarevifdef CONFIG_GTK
571834574eaSAnthony Liguori	$(MAKE) -C po $@
572834574eaSAnthony Liguoriendif
57354cb65d8SEmilio G. Cotaifeq ($(CONFIG_PLUGIN),y)
57454cb65d8SEmilio G. Cota	$(INSTALL_DATA) $(SRC_PATH)/include/qemu/qemu-plugin.h "$(DESTDIR)$(includedir)/qemu-plugin.h"
57554cb65d8SEmilio G. Cotaendif
5766aae2a2eSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
57718be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
5786aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
579ad064840Spbrook	done
580a81df1b6SPaolo Bonzini	for d in $(TARGET_DIRS); do \
581a81df1b6SPaolo Bonzini	$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
582a81df1b6SPaolo Bonzini        done
583612384d7Sbellard
5843ef693a0Sbellard# documentation
585e8518c92SMarkus ArmbrusterMAKEINFO=makeinfo
586d59157eaSPaolo BonziniMAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
587d59157eaSPaolo BonziniMAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES)
588e8338fdbSMarc-André LureauTEXI2PODFLAGS=$(MAKEINFOINCLUDES) -DVERSION="$(VERSION)" -DCONFDIR="$(qemu_confdir)"
589d59157eaSPaolo BonziniTEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES)
59056e8bdd4SMarc-André Lureau
591e8338fdbSMarc-André Lureaudocs/version.texi: $(SRC_PATH)/VERSION config-host.mak
592e8338fdbSMarc-André Lureau	$(call quiet-command,(\
593e8338fdbSMarc-André Lureau		echo "@set VERSION $(VERSION)" && \
594e8338fdbSMarc-André Lureau		echo "@set CONFDIR $(qemu_confdir)" \
595e8338fdbSMarc-André Lureau	)> $@,"GEN","$@")
596fea346f5SPeter Maydell
59744cb280dSPaolo Bonzini%.html: %.texi docs/version.texi
598e9ee06bdSMarc-André Lureau	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
599e9ee06bdSMarc-André Lureau	--html $< -o $@,"GEN","$@")
6003ef693a0Sbellard
60144cb280dSPaolo Bonzini%.info: %.texi docs/version.texi
602e9ee06bdSMarc-André Lureau	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@")
603f3548328Sbellard
60444cb280dSPaolo Bonzini%.txt: %.texi docs/version.texi
605f8bab10bSMarc-André Lureau	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
606f8bab10bSMarc-André Lureau	--plaintext $< -o $@,"GEN","$@")
607f8bab10bSMarc-André Lureau
60844cb280dSPaolo Bonzini%.pdf: %.texi docs/version.texi
609d59157eaSPaolo Bonzini	$(call quiet-command,texi2pdf $(TEXI2PDFFLAGS) $< -o $@,"GEN","$@")
610bd7f9747SMarkus Armbruster
6115f71eac0SPeter Maydell# Sphinx builds all its documentation at once in one invocation
6125f71eac0SPeter Maydell# and handles "don't rebuild things unless necessary" itself.
6135f71eac0SPeter Maydell# The '.doctrees' files are cached information to speed this up.
6145f71eac0SPeter Maydell.PHONY: sphinxdocs
6150928523aSPeter Maydellsphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \
6160928523aSPeter Maydell            $(MANUAL_BUILDDIR)/interop/index.html \
6170928523aSPeter Maydell            $(MANUAL_BUILDDIR)/specs/index.html \
61865c3542bSPeter Maydell            $(MANUAL_BUILDDIR)/system/index.html \
61909147930SPaolo Bonzini            $(MANUAL_BUILDDIR)/tools/index.html \
62009147930SPaolo Bonzini            $(MANUAL_BUILDDIR)/user/index.html
6215f71eac0SPeter Maydell
6225f71eac0SPeter Maydell# Canned command to build a single manual
62327a296fcSPeter Maydell# Arguments: $1 = manual name, $2 = Sphinx builder ('html' or 'man')
6246bda415cSEduardo Habkost# Note the use of different doctree for each (manual, builder) tuple;
6256bda415cSEduardo Habkost# this works around Sphinx not handling parallel invocation on
6266bda415cSEduardo Habkost# a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946
627516e8b7dSPeter 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")
6285f71eac0SPeter Maydell# We assume all RST files in the manual's directory are used in it
629814e068fSPeter Maydellmanual-deps = $(wildcard $(SRC_PATH)/docs/$1/*.rst $(SRC_PATH)/docs/$1/*/*.rst) \
630de1572caSPeter Maydell              $(SRC_PATH)/docs/defs.rst.inc \
6319165d323SPeter Maydell              $(SRC_PATH)/docs/$1/conf.py $(SRC_PATH)/docs/conf.py \
6329165d323SPeter Maydell              $(SRC_PATH)/docs/sphinx/*.py
633e0f3728dSPeter Maydell# Macro to write out the rule and dependencies for building manpages
634e0f3728dSPeter Maydell# Usage: $(call define-manpage-rule,manualname,manpage1 manpage2...[,extradeps])
635e0f3728dSPeter Maydell# 'extradeps' is optional, and specifies extra files (eg .hx files) that
636e0f3728dSPeter Maydell# the manual page depends on.
637e0f3728dSPeter Maydelldefine define-manpage-rule
638e0f3728dSPeter Maydell$(call atomic,$(foreach manpage,$2,$(MANUAL_BUILDDIR)/$1/$(manpage)),$(call manual-deps,$1) $3)
639e0f3728dSPeter Maydell	$(call build-manual,$1,man)
640e0f3728dSPeter Maydellendef
6415f71eac0SPeter Maydell
6421290e671SPeter Maydell$(MANUAL_BUILDDIR)/devel/index.html: $(call manual-deps,devel)
64327a296fcSPeter Maydell	$(call build-manual,devel,html)
6445f71eac0SPeter Maydell
645a08b4a9fSPeter Maydell$(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop)
64627a296fcSPeter Maydell	$(call build-manual,interop,html)
6475f71eac0SPeter Maydell
6480783a732SPeter Maydell$(MANUAL_BUILDDIR)/specs/index.html: $(call manual-deps,specs)
64927a296fcSPeter Maydell	$(call build-manual,specs,html)
65027a296fcSPeter Maydell
65109ce5f2dSPeter 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
6520928523aSPeter Maydell	$(call build-manual,system,html)
6530928523aSPeter Maydell
654a08b4a9fSPeter Maydell$(MANUAL_BUILDDIR)/tools/index.html: $(call manual-deps,tools) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc
65565c3542bSPeter Maydell	$(call build-manual,tools,html)
65665c3542bSPeter Maydell
65709147930SPaolo Bonzini$(MANUAL_BUILDDIR)/user/index.html: $(call manual-deps,user)
65809147930SPaolo Bonzini	$(call build-manual,user,html)
65909147930SPaolo Bonzini
660a08b4a9fSPeter Maydell$(call define-manpage-rule,interop,qemu-ga.8)
6610783a732SPeter Maydell
662d06118bfSPeter Maydell$(call define-manpage-rule,system,qemu.1 qemu-block-drivers.7 qemu-cpu-models.7)
663acab923dSPeter Maydell
664a08b4a9fSPeter Maydell$(call define-manpage-rule,tools,\
665a08b4a9fSPeter Maydell       qemu-img.1 qemu-nbd.8 qemu-trace-stap.1\
666a08b4a9fSPeter Maydell       virtiofsd.1 virtfs-proxy-helper.1,\
667a08b4a9fSPeter Maydell       $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc)
668a08b4a9fSPeter Maydell
66922108f33SStefan Hajnoczi$(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h
670d83bbedaSStefan Hajnoczi	@mkdir -p "$(MANUAL_BUILDDIR)"
67122108f33SStefan Hajnoczi	$(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \
67222108f33SStefan Hajnoczi             "GEN","$@")
67322108f33SStefan Hajnoczi
674eb815e24SMarkus Armbrusterdocs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi
675fb0bc835SMarkus Armbruster	@cp -p $< $@
6764afeeb57SMarkus Armbruster
677f15bff25SPaolo Bonzinidocs/interop/qemu-ga-qapi.texi: qga/qga-qapi-doc.texi
678fb0bc835SMarkus Armbruster	@cp -p $< $@
67956e8bdd4SMarc-André Lureau
6805b1d0e92SPeter Maydellhtml: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs
6815b1d0e92SPeter Maydellinfo: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
6825b1d0e92SPeter Maydellpdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
6835b1d0e92SPeter Maydelltxt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
684818220f5Saliguori
685d59157eaSPaolo Bonzinidocs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \
686d59157eaSPaolo Bonzini    docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \
687d59157eaSPaolo Bonzini    docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \
688d59157eaSPaolo Bonzini	docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi
68956e8bdd4SMarc-André Lureau
690d59157eaSPaolo Bonzinidocs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \
691d59157eaSPaolo Bonzini    docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \
692d59157eaSPaolo Bonzini    docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \
693d59157eaSPaolo Bonzini	docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi
69456e8bdd4SMarc-André Lureau
695ae560cc3SEric Blake$(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl
696ae560cc3SEric Blake
697fe8bf5f6SAlex Bennée# Reports/Analysis
698fe8bf5f6SAlex Bennée
699fe8bf5f6SAlex Bennée%/coverage-report.html:
700fe8bf5f6SAlex Bennée	@mkdir -p $*
701fe8bf5f6SAlex Bennée	$(call quiet-command,\
7025eda6e42SAlex Bennée		gcovr -r $(SRC_PATH) \
7035eda6e42SAlex Bennée		$(foreach t, $(TARGET_DIRS), --object-directory $(BUILD_DIR)/$(t)) \
7045eda6e42SAlex Bennée		 --object-directory $(BUILD_DIR) \
705337f2311SAlex Bennée		-p --html --html-details -o $@, \
706fe8bf5f6SAlex Bennée		"GEN", "coverage-report.html")
707fe8bf5f6SAlex Bennée
708fe8bf5f6SAlex Bennée.PHONY: coverage-report
709fe8bf5f6SAlex Bennéecoverage-report: $(CURDIR)/reports/coverage/coverage-report.html
71056e8bdd4SMarc-André Lureau
711f53ec699SStefan Weilifdef CONFIG_WIN32
712f53ec699SStefan Weil
713f53ec699SStefan WeilINSTALLER = qemu-setup-$(VERSION)$(EXESUF)
714f53ec699SStefan Weil
715f53ec699SStefan Weilnsisflags = -V2 -NOCD
716f53ec699SStefan Weil
717f53ec699SStefan Weilifneq ($(wildcard $(SRC_PATH)/dll),)
718f53ec699SStefan Weilifeq ($(ARCH),x86_64)
719f53ec699SStefan Weil# 64 bit executables
720f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w64
721f53ec699SStefan Weilnsisflags += -DW64
722f53ec699SStefan Weilelse
723f53ec699SStefan Weil# 32 bit executables
724f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w32
725f53ec699SStefan Weilendif
726f53ec699SStefan Weilendif
727f53ec699SStefan Weil
728f53ec699SStefan Weil.PHONY: installer
729f53ec699SStefan Weilinstaller: $(INSTALLER)
730f53ec699SStefan Weil
731f53ec699SStefan WeilINSTDIR=/tmp/qemu-nsis
732f53ec699SStefan Weil
7331b00a4c4SPaolo Bonzini$(INSTALLER): $(SRC_PATH)/qemu.nsi
7341b00a4c4SPaolo Bonzini	$(MAKE) install DESTDIR=${INSTDIR}
735f53ec699SStefan Weilifdef SIGNCODE
7361b00a4c4SPaolo Bonzini	(cd ${INSTDIR}/${bindir}; \
737f53ec699SStefan Weil         for i in *.exe; do \
738f53ec699SStefan Weil           $(SIGNCODE) $${i}; \
739f53ec699SStefan Weil         done \
740f53ec699SStefan Weil        )
741f53ec699SStefan Weilendif # SIGNCODE
7421b00a4c4SPaolo Bonzini	(cd ${INSTDIR}/${bindir}; \
743f53ec699SStefan Weil         for i in qemu-system-*.exe; do \
744f53ec699SStefan Weil           arch=$${i%.exe}; \
745f53ec699SStefan Weil           arch=$${arch#qemu-system-}; \
746f53ec699SStefan Weil           echo Section \"$$arch\" Section_$$arch; \
747f53ec699SStefan Weil           echo SetOutPath \"\$$INSTDIR\"; \
748f53ec699SStefan Weil           echo File \"\$${BINDIR}\\$$i\"; \
749f53ec699SStefan Weil           echo SectionEnd; \
750f53ec699SStefan Weil         done \
7511b00a4c4SPaolo Bonzini        ) >${INSTDIR}/${bindir}/system-emulations.nsh
752f53ec699SStefan Weil	makensis $(nsisflags) \
753f53ec699SStefan Weil                $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
754f53ec699SStefan Weil                $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
7551b00a4c4SPaolo Bonzini                -DBINDIR="${INSTDIR}/${bindir}" \
756f53ec699SStefan Weil                $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
757f53ec699SStefan Weil                -DSRCDIR="$(SRC_PATH)" \
758f53ec699SStefan Weil                -DOUTFILE="$(INSTALLER)" \
759805d8a67SStefan Weil                -DDISPLAYVERSION="$(VERSION)" \
760f53ec699SStefan Weil                $(SRC_PATH)/qemu.nsi
761f53ec699SStefan Weil	rm -r ${INSTDIR}
762f53ec699SStefan Weilifdef SIGNCODE
763f53ec699SStefan Weil	$(SIGNCODE) $(INSTALLER)
764f53ec699SStefan Weilendif # SIGNCODE
765f53ec699SStefan Weilendif # CONFIG_WIN
766f53ec699SStefan Weil
767cb5fc67dSAnthony Liguori# Add a dependency on the generated files, so that they are always
768cb5fc67dSAnthony Liguori# rebuilt before other object files
769428952cfSThomas Huthifneq ($(wildcard config-host.mak),)
770eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
7713dff199cSLaurent VivierMakefile: $(generated-files-y)
7727748b8cbSMike Frysingerendif
773428952cfSThomas Huthendif
774cb5fc67dSAnthony Liguori
7754fb240a4Sbellard# Include automatically generated dependency files
7761435ddb8SPaolo Bonzini# Dependencies in Makefile.objs files come from our recursive subdir rules
7771435ddb8SPaolo Bonzini-include $(wildcard *.d tests/*.d)
778324027c2SFam Zheng
779324027c2SFam Zhenginclude $(SRC_PATH)/tests/docker/Makefile.include
780b1fb9a63SFam Zhenginclude $(SRC_PATH)/tests/vm/Makefile.include
7810d8e065fSMarc-André Lureau
782c355de59SPhilippe Mathieu-Daudéprint-help-run = printf "  %-30s - %s\\n" "$1" "$2"
783c355de59SPhilippe Mathieu-Daudéprint-help = $(quiet-@)$(call print-help-run,$1,$2)
784c355de59SPhilippe Mathieu-Daudé
7850d8e065fSMarc-André Lureau.PHONY: help
7860d8e065fSMarc-André Lureauhelp:
7870d8e065fSMarc-André Lureau	@echo  'Generic targets:'
788c355de59SPhilippe Mathieu-Daudé	$(call print-help,all,Build all)
7890decdfe2SMarc-André Lureauifdef CONFIG_MODULES
790c355de59SPhilippe Mathieu-Daudé	$(call print-help,modules,Build all modules)
7910decdfe2SMarc-André Lureauendif
792c355de59SPhilippe Mathieu-Daudé	$(call print-help,dir/file.o,Build specified target only)
793c355de59SPhilippe Mathieu-Daudé	$(call print-help,install,Install QEMU, documentation and tools)
794c355de59SPhilippe Mathieu-Daudé	$(call print-help,ctags/TAGS,Generate tags file for editors)
795c355de59SPhilippe Mathieu-Daudé	$(call print-help,cscope,Generate cscope index)
796968b4db3SPaolo Bonzini	$(call print-help,sparse,Run sparse on the QEMU source)
7970d8e065fSMarc-André Lureau	@echo  ''
7982b1f35b9SAlex Bennée	@$(if $(TARGET_DIRS), \
7990d8e065fSMarc-André Lureau		echo 'Architecture specific targets:'; \
8002b1f35b9SAlex Bennée		$(foreach t, $(TARGET_DIRS), \
801763815a8SPhilippe Mathieu-Daudé		$(call print-help-run,$(t)/all,Build for $(t)); \
802763815a8SPhilippe Mathieu-Daudé		$(if $(CONFIG_FUZZ), \
803763815a8SPhilippe Mathieu-Daudé			$(if $(findstring softmmu,$(t)), \
804763815a8SPhilippe Mathieu-Daudé				$(call print-help-run,$(t)/fuzz,Build fuzzer for $(t)); \
805763815a8SPhilippe Mathieu-Daudé		))) \
8060d8e065fSMarc-André Lureau		echo '')
807fdbff6bdSPhilippe Mathieu-Daudé	@$(if $(HELPERS-y), \
808fdbff6bdSPhilippe Mathieu-Daudé		echo 'Helper targets:'; \
809fdbff6bdSPhilippe Mathieu-Daudé		$(foreach t, $(HELPERS-y), \
810fdbff6bdSPhilippe Mathieu-Daudé		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
811fdbff6bdSPhilippe Mathieu-Daudé		echo '')
81281ed0a57SPhilippe Mathieu-Daudé	@$(if $(TOOLS), \
81381ed0a57SPhilippe Mathieu-Daudé		echo 'Tools targets:'; \
81481ed0a57SPhilippe Mathieu-Daudé		$(foreach t, $(TOOLS), \
81581ed0a57SPhilippe Mathieu-Daudé		$(call print-help-run,$(t),Build $(shell basename $(t)) tool);) \
8160d8e065fSMarc-André Lureau		echo '')
8170d8e065fSMarc-André Lureau	@echo  'Cleaning targets:'
818c355de59SPhilippe Mathieu-Daudé	$(call print-help,clean,Remove most generated files but keep the config)
819c355de59SPhilippe Mathieu-Daudé	$(call print-help,distclean,Remove all generated files)
820c355de59SPhilippe Mathieu-Daudé	$(call print-help,dist,Build a distributable tarball)
8210d8e065fSMarc-André Lureau	@echo  ''
8220d8e065fSMarc-André Lureau	@echo  'Test targets:'
823c355de59SPhilippe Mathieu-Daudé	$(call print-help,check,Run all tests (check-help for details))
824c355de59SPhilippe Mathieu-Daudé	$(call print-help,docker,Help about targets running tests inside containers)
825c355de59SPhilippe Mathieu-Daudé	$(call print-help,vm-help,Help about targets running tests inside VM)
8260d8e065fSMarc-André Lureau	@echo  ''
8270d8e065fSMarc-André Lureau	@echo  'Documentation targets:'
828c355de59SPhilippe Mathieu-Daudé	$(call print-help,html info pdf txt,Build documentation in specified format)
8290d8e065fSMarc-André Lureau	@echo  ''
8300d8e065fSMarc-André Lureauifdef CONFIG_WIN32
8310d8e065fSMarc-André Lureau	@echo  'Windows targets:'
832c355de59SPhilippe Mathieu-Daudé	$(call print-help,installer,Build NSIS-based installer for QEMU)
8330d8e065fSMarc-André Lureauifdef QEMU_GA_MSI_ENABLED
834c355de59SPhilippe Mathieu-Daudé	$(call print-help,msi,Build MSI-based installer for qemu-ga)
8350d8e065fSMarc-André Lureauendif
8360d8e065fSMarc-André Lureau	@echo  ''
8370d8e065fSMarc-André Lureauendif
838c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) [targets],(quiet build, default))
839c355de59SPhilippe Mathieu-Daudé	$(call print-help,$(MAKE) V=1 [targets],(verbose build))
840