macio: Convert use of qdev_set_parent_bus()
[qemu/ar7.git] / Makefile
blobed0ed93b2d6405b7ac1bfdb5424c4cc98febb3ec
1 # Makefile for QEMU.
3 ifneq ($(words $(subst :, ,$(CURDIR))), 1)
4 $(error main directory cannot contain spaces nor colons)
5 endif
7 # Always point to the root of the build tree (needs GNU make).
8 BUILD_DIR=$(CURDIR)
10 # Before including a proper config-host.mak, assume we are in the source tree
11 SRC_PATH=.
13 UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
14 html info pdf txt \
15 help check-help print-% \
16 docker docker-% vm-help vm-test vm-build-%
18 # All following code might depend on configuration variables
19 ifneq ($(wildcard config-host.mak),)
20 # Put the all: rule here so that config-host.mak can contain dependencies.
21 all:
22 include config-host.mak
24 git-submodule-update:
26 .PHONY: git-submodule-update
28 git_module_status := $(shell \
29 cd '$(SRC_PATH)' && \
30 GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
31 echo $$?; \
34 ifeq (1,$(git_module_status))
35 ifeq (no,$(GIT_UPDATE))
36 git-submodule-update:
37 $(call quiet-command, \
38 echo && \
39 echo "GIT submodule checkout is out of date. Please run" && \
40 echo " scripts/git-submodule.sh update $(GIT_SUBMODULES)" && \
41 echo "from the source directory checkout $(SRC_PATH)" && \
42 echo && \
43 exit 1)
44 else
45 git-submodule-update:
46 $(call quiet-command, \
47 (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
48 "GIT","$(GIT_SUBMODULES)")
49 endif
50 endif
52 .git-submodule-status: git-submodule-update config-host.mak
54 # Check that we're not trying to do an out-of-tree build from
55 # a tree that's been used for an in-tree build.
56 ifneq ($(realpath $(SRC_PATH)),$(realpath .))
57 ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
58 $(error This is an out of tree build but your source tree ($(SRC_PATH)) \
59 seems to have been used for an in-tree build. You can fix this by running \
60 "$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
61 endif
62 endif
64 CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
65 CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
66 CONFIG_XEN := $(CONFIG_XEN_BACKEND)
67 CONFIG_ALL=y
68 -include config-all-devices.mak
69 -include config-all-disas.mak
71 config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
72 @echo $@ is out-of-date, running configure
73 @./config.status
75 # Force configure to re-run if the API symbols are updated
76 ifeq ($(CONFIG_PLUGIN),y)
77 config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols
78 endif
80 else
81 config-host.mak:
82 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
83 @echo "Please call configure before running make!"
84 @exit 1
85 endif
86 endif
88 include $(SRC_PATH)/rules.mak
90 # lor is defined in rules.mak
91 CONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS))
93 # Create QEMU_PKGVERSION and FULL_VERSION strings
94 # If PKGVERSION is set, use that; otherwise get version and -dirty status from git
95 QEMU_PKGVERSION := $(if $(PKGVERSION),$(PKGVERSION),$(shell \
96 cd $(SRC_PATH); \
97 if test -e .git; then \
98 git describe --match 'v*' 2>/dev/null | tr -d '\n'; \
99 if ! git diff-index --quiet HEAD &>/dev/null; then \
100 echo "-dirty"; \
101 fi; \
102 fi))
104 # Either "version (pkgversion)", or just "version" if pkgversion not set
105 FULL_VERSION := $(if $(QEMU_PKGVERSION),$(VERSION) ($(QEMU_PKGVERSION)),$(VERSION))
107 generated-files-y = qemu-version.h config-host.h qemu-options.def
109 GENERATED_QAPI_FILES = qapi/qapi-builtin-types.h qapi/qapi-builtin-types.c
110 GENERATED_QAPI_FILES += qapi/qapi-types.h qapi/qapi-types.c
111 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-types-%.h)
112 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-types-%.c)
113 GENERATED_QAPI_FILES += qapi/qapi-builtin-visit.h qapi/qapi-builtin-visit.c
114 GENERATED_QAPI_FILES += qapi/qapi-visit.h qapi/qapi-visit.c
115 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-visit-%.h)
116 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-visit-%.c)
117 GENERATED_QAPI_FILES += qapi/qapi-init-commands.h qapi/qapi-init-commands.c
118 GENERATED_QAPI_FILES += qapi/qapi-commands.h qapi/qapi-commands.c
119 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-commands-%.h)
120 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-commands-%.c)
121 GENERATED_QAPI_FILES += qapi/qapi-emit-events.h qapi/qapi-emit-events.c
122 GENERATED_QAPI_FILES += qapi/qapi-events.h qapi/qapi-events.c
123 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.h)
124 GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.c)
125 GENERATED_QAPI_FILES += qapi/qapi-introspect.c qapi/qapi-introspect.h
126 GENERATED_QAPI_FILES += qapi/qapi-doc.texi
128 # The following list considers only the storage daemon main module. All other
129 # modules are currently shared with the main schema, so we don't actually
130 # generate additional files.
132 GENERATED_STORAGE_DAEMON_QAPI_FILES = storage-daemon/qapi/qapi-commands.h
133 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-commands.c
134 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-emit-events.h
135 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-emit-events.c
136 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-events.h
137 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-events.c
138 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-init-commands.h
139 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-init-commands.c
140 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-introspect.h
141 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-introspect.c
142 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-types.h
143 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-types.c
144 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-visit.h
145 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-visit.c
146 GENERATED_STORAGE_DAEMON_QAPI_FILES += storage-daemon/qapi/qapi-doc.texi
148 generated-files-y += $(GENERATED_QAPI_FILES)
149 generated-files-y += $(GENERATED_STORAGE_DAEMON_QAPI_FILES)
151 generated-files-y += trace/generated-tcg-tracers.h
153 generated-files-y += trace/generated-helpers-wrappers.h
154 generated-files-y += trace/generated-helpers.h
155 generated-files-y += trace/generated-helpers.c
157 generated-files-$(CONFIG_TRACE_UST) += trace-ust-all.h
158 generated-files-$(CONFIG_TRACE_UST) += trace-ust-all.c
160 generated-files-y += module_block.h
162 TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h)
163 TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c)
164 TRACE_DTRACE =
165 ifdef CONFIG_TRACE_DTRACE
166 TRACE_HEADERS += trace-dtrace-root.h $(trace-events-subdirs:%=%/trace-dtrace.h)
167 TRACE_DTRACE += trace-dtrace-root.dtrace $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
168 endif
169 ifdef CONFIG_TRACE_UST
170 TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h)
171 endif
173 generated-files-y += $(TRACE_HEADERS)
174 generated-files-y += $(TRACE_SOURCES)
175 generated-files-y += $(BUILD_DIR)/trace-events-all
176 generated-files-y += .git-submodule-status
178 trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
180 tracetool-y = $(SRC_PATH)/scripts/tracetool.py
181 tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
183 %/trace.h: %/trace.h-timestamp
184 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
185 %/trace.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
186 $(call quiet-command,$(TRACETOOL) \
187 --group=$(call trace-group-name,$@) \
188 --format=h \
189 --backends=$(TRACE_BACKENDS) \
190 $< > $@,"GEN","$(@:%-timestamp=%)")
192 %/trace.c: %/trace.c-timestamp
193 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
194 %/trace.c-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
195 $(call quiet-command,$(TRACETOOL) \
196 --group=$(call trace-group-name,$@) \
197 --format=c \
198 --backends=$(TRACE_BACKENDS) \
199 $< > $@,"GEN","$(@:%-timestamp=%)")
201 %/trace-ust.h: %/trace-ust.h-timestamp
202 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
203 %/trace-ust.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
204 $(call quiet-command,$(TRACETOOL) \
205 --group=$(call trace-group-name,$@) \
206 --format=ust-events-h \
207 --backends=$(TRACE_BACKENDS) \
208 $< > $@,"GEN","$(@:%-timestamp=%)")
210 %/trace-dtrace.dtrace: %/trace-dtrace.dtrace-timestamp
211 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
212 %/trace-dtrace.dtrace-timestamp: $(SRC_PATH)/%/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
213 $(call quiet-command,$(TRACETOOL) \
214 --group=$(call trace-group-name,$@) \
215 --format=d \
216 --backends=$(TRACE_BACKENDS) \
217 $< > $@,"GEN","$(@:%-timestamp=%)")
219 %/trace-dtrace.h: %/trace-dtrace.dtrace $(tracetool-y)
220 $(call quiet-command,dtrace -o $@ -h -s $<, "GEN","$@")
222 %/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
225 trace-root.h: trace-root.h-timestamp
226 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
227 trace-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
228 $(call quiet-command,$(TRACETOOL) \
229 --group=root \
230 --format=h \
231 --backends=$(TRACE_BACKENDS) \
232 $< > $@,"GEN","$(@:%-timestamp=%)")
234 trace-root.c: trace-root.c-timestamp
235 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
236 trace-root.c-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
237 $(call quiet-command,$(TRACETOOL) \
238 --group=root \
239 --format=c \
240 --backends=$(TRACE_BACKENDS) \
241 $< > $@,"GEN","$(@:%-timestamp=%)")
243 trace-ust-root.h: trace-ust-root.h-timestamp
244 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
245 trace-ust-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y) $(BUILD_DIR)/config-host.mak
246 $(call quiet-command,$(TRACETOOL) \
247 --group=root \
248 --format=ust-events-h \
249 --backends=$(TRACE_BACKENDS) \
250 $< > $@,"GEN","$(@:%-timestamp=%)")
252 trace-ust-all.h: trace-ust-all.h-timestamp
253 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
254 trace-ust-all.h-timestamp: $(trace-events-files) $(tracetool-y) $(BUILD_DIR)/config-host.mak
255 $(call quiet-command,$(TRACETOOL) \
256 --group=all \
257 --format=ust-events-h \
258 --backends=$(TRACE_BACKENDS) \
259 $(trace-events-files) > $@,"GEN","$(@:%-timestamp=%)")
261 trace-ust-all.c: trace-ust-all.c-timestamp
262 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
263 trace-ust-all.c-timestamp: $(trace-events-files) $(tracetool-y) $(BUILD_DIR)/config-host.mak
264 $(call quiet-command,$(TRACETOOL) \
265 --group=all \
266 --format=ust-events-c \
267 --backends=$(TRACE_BACKENDS) \
268 $(trace-events-files) > $@,"GEN","$(@:%-timestamp=%)")
270 trace-dtrace-root.dtrace: trace-dtrace-root.dtrace-timestamp
271 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
272 trace-dtrace-root.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
273 $(call quiet-command,$(TRACETOOL) \
274 --group=root \
275 --format=d \
276 --backends=$(TRACE_BACKENDS) \
277 $< > $@,"GEN","$(@:%-timestamp=%)")
279 trace-dtrace-root.h: trace-dtrace-root.dtrace
280 $(call quiet-command,dtrace -o $@ -h -s $<, "GEN","$@")
282 trace-dtrace-root.o: trace-dtrace-root.dtrace
284 KEYCODEMAP_GEN = $(SRC_PATH)/ui/keycodemapdb/tools/keymap-gen
285 KEYCODEMAP_CSV = $(SRC_PATH)/ui/keycodemapdb/data/keymaps.csv
287 KEYCODEMAP_FILES = \
288 ui/input-keymap-atset1-to-qcode.c \
289 ui/input-keymap-linux-to-qcode.c \
290 ui/input-keymap-qcode-to-atset1.c \
291 ui/input-keymap-qcode-to-atset2.c \
292 ui/input-keymap-qcode-to-atset3.c \
293 ui/input-keymap-qcode-to-linux.c \
294 ui/input-keymap-qcode-to-qnum.c \
295 ui/input-keymap-qcode-to-sun.c \
296 ui/input-keymap-qnum-to-qcode.c \
297 ui/input-keymap-usb-to-qcode.c \
298 ui/input-keymap-win32-to-qcode.c \
299 ui/input-keymap-x11-to-qcode.c \
300 ui/input-keymap-xorgevdev-to-qcode.c \
301 ui/input-keymap-xorgkbd-to-qcode.c \
302 ui/input-keymap-xorgxquartz-to-qcode.c \
303 ui/input-keymap-xorgxwin-to-qcode.c \
304 ui/input-keymap-osx-to-qcode.c \
305 $(NULL)
307 generated-files-$(CONFIG_SOFTMMU) += $(KEYCODEMAP_FILES)
309 ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
310 $(call quiet-command,\
311 stem=$* && src=$${stem%-to-*} dst=$${stem#*-to-} && \
312 test -e $(KEYCODEMAP_GEN) && \
313 $(PYTHON) $(KEYCODEMAP_GEN) \
314 --lang glib2 \
315 --varname qemu_input_map_$${src}_to_$${dst} \
316 code-map $(KEYCODEMAP_CSV) $${src} $${dst} \
317 > $@ || rm -f $@, "GEN", "$@")
319 $(KEYCODEMAP_GEN): .git-submodule-status
320 $(KEYCODEMAP_CSV): .git-submodule-status
322 edk2-decompressed = $(basename $(wildcard pc-bios/edk2-*.fd.bz2))
323 pc-bios/edk2-%.fd: pc-bios/edk2-%.fd.bz2
324 $(call quiet-command,bzip2 -d -c $< > $@,"BUNZIP2",$<)
326 # Don't try to regenerate Makefile or configure
327 # We don't generate any of them
328 Makefile: ;
329 configure: ;
331 .PHONY: all clean cscope distclean html info install install-doc \
332 pdf txt recurse-all dist msi FORCE
334 $(call set-vpath, $(SRC_PATH))
336 LIBS+=-lz $(LIBS_TOOLS)
338 vhost-user-json-y =
339 HELPERS-y = $(HELPERS)
341 HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
343 ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
344 HELPERS-y += vhost-user-gpu$(EXESUF)
345 vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
346 endif
348 ifeq ($(CONFIG_SOFTMMU)$(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyyy)
349 HELPERS-y += virtiofsd$(EXESUF)
350 vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
351 endif
353 # Sphinx does not allow building manuals into the same directory as
354 # the source files, so if we're doing an in-tree QEMU build we must
355 # build the manuals into a subdirectory (and then install them from
356 # there for 'make install'). For an out-of-tree build we can just
357 # use the docs/ subdirectory in the build tree as normal.
358 ifeq ($(realpath $(SRC_PATH)),$(realpath .))
359 MANUAL_BUILDDIR := docs/built
360 else
361 MANUAL_BUILDDIR := docs
362 endif
364 ifdef BUILD_DOCS
365 DOCS+=$(MANUAL_BUILDDIR)/system/qemu.1
366 DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-img.1
367 DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-nbd.8
368 DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8
369 ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
370 DOCS+=$(MANUAL_BUILDDIR)/tools/virtiofsd.1
371 endif
372 DOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7
373 DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
374 DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
375 DOCS+=$(MANUAL_BUILDDIR)/system/qemu-cpu-models.7
376 DOCS+=$(MANUAL_BUILDDIR)/index.html
377 ifdef CONFIG_VIRTFS
378 DOCS+=$(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1
379 endif
380 ifdef CONFIG_TRACE_SYSTEMTAP
381 DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1
382 endif
383 else
384 DOCS=
385 endif
387 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
388 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(filter %-softmmu, $(TARGET_DIRS)))
389 SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %.d, $(SUBDIR_DEVICES_MAK))
391 ifeq ($(SUBDIR_DEVICES_MAK),)
392 config-all-devices.mak: config-host.mak
393 $(call quiet-command,echo '# no devices' > $@,"GEN","$@")
394 else
395 config-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak
396 $(call quiet-command, sed -n \
397 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
398 $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
399 "GEN","$@")
400 endif
402 -include $(SUBDIR_DEVICES_MAK_DEP)
404 # This has to be kept in sync with Kconfig.host.
405 MINIKCONF_ARGS = \
406 $(CONFIG_MINIKCONF_MODE) \
407 $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \
408 CONFIG_KVM=$(CONFIG_KVM) \
409 CONFIG_SPICE=$(CONFIG_SPICE) \
410 CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
411 CONFIG_TPM=$(CONFIG_TPM) \
412 CONFIG_XEN=$(CONFIG_XEN) \
413 CONFIG_OPENGL=$(CONFIG_OPENGL) \
414 CONFIG_X11=$(CONFIG_X11) \
415 CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \
416 CONFIG_VHOST_KERNEL=$(CONFIG_VHOST_KERNEL) \
417 CONFIG_VIRTFS=$(CONFIG_VIRTFS) \
418 CONFIG_LINUX=$(CONFIG_LINUX) \
419 CONFIG_PVRDMA=$(CONFIG_PVRDMA)
421 MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
422 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
423 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
425 $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
426 $(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > $@.tmp, "GEN", "$@.tmp")
427 $(call quiet-command, if test -f $@; then \
428 if cmp -s $@.old $@; then \
429 mv $@.tmp $@; \
430 cp -p $@ $@.old; \
431 else \
432 if test -f $@.old; then \
433 echo "WARNING: $@ (user modified) out of date.";\
434 else \
435 echo "WARNING: $@ out of date.";\
436 fi; \
437 echo "Run \"$(MAKE) defconfig\" to regenerate."; \
438 rm $@.tmp; \
439 fi; \
440 else \
441 mv $@.tmp $@; \
442 cp -p $@ $@.old; \
443 fi,"GEN","$@");
445 defconfig:
446 rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
448 ifneq ($(wildcard config-host.mak),)
449 include $(SRC_PATH)/Makefile.objs
450 endif
452 dummy := $(call unnest-vars,, \
453 stub-obj-y \
454 authz-obj-y \
455 chardev-obj-y \
456 util-obj-y \
457 qga-obj-y \
458 elf2dmp-obj-y \
459 ivshmem-client-obj-y \
460 ivshmem-server-obj-y \
461 virtiofsd-obj-y \
462 rdmacm-mux-obj-y \
463 libvhost-user-obj-y \
464 vhost-user-scsi-obj-y \
465 vhost-user-blk-obj-y \
466 vhost-user-input-obj-y \
467 vhost-user-gpu-obj-y \
468 qga-vss-dll-obj-y \
469 block-obj-y \
470 block-obj-m \
471 storage-daemon-obj-y \
472 storage-daemon-obj-m \
473 crypto-obj-y \
474 qom-obj-y \
475 io-obj-y \
476 common-obj-y \
477 common-obj-m \
478 trace-obj-y)
480 include $(SRC_PATH)/tests/Makefile.include
482 all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules $(vhost-user-json-y)
484 qemu-version.h: FORCE
485 $(call quiet-command, \
486 (printf '#define QEMU_PKGVERSION "$(QEMU_PKGVERSION)"\n'; \
487 printf '#define QEMU_FULL_VERSION "$(FULL_VERSION)"\n'; \
488 ) > $@.tmp)
489 $(call quiet-command, if ! cmp -s $@ $@.tmp; then \
490 mv $@.tmp $@; \
491 else \
492 rm $@.tmp; \
495 config-host.h: config-host.h-timestamp
496 config-host.h-timestamp: config-host.mak
497 qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool
498 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@")
500 TARGET_DIRS_RULES := $(foreach t, all fuzz clean install, $(addsuffix /$(t), $(TARGET_DIRS)))
502 SOFTMMU_ALL_RULES=$(filter %-softmmu/all, $(TARGET_DIRS_RULES))
503 $(SOFTMMU_ALL_RULES): $(authz-obj-y)
504 $(SOFTMMU_ALL_RULES): $(block-obj-y)
505 $(SOFTMMU_ALL_RULES): $(storage-daemon-obj-y)
506 $(SOFTMMU_ALL_RULES): $(chardev-obj-y)
507 $(SOFTMMU_ALL_RULES): $(crypto-obj-y)
508 $(SOFTMMU_ALL_RULES): $(io-obj-y)
509 $(SOFTMMU_ALL_RULES): config-all-devices.mak
510 ifdef DECOMPRESS_EDK2_BLOBS
511 $(SOFTMMU_ALL_RULES): $(edk2-decompressed)
512 endif
514 SOFTMMU_FUZZ_RULES=$(filter %-softmmu/fuzz, $(TARGET_DIRS_RULES))
515 $(SOFTMMU_FUZZ_RULES): $(authz-obj-y)
516 $(SOFTMMU_FUZZ_RULES): $(block-obj-y)
517 $(SOFTMMU_FUZZ_RULES): $(chardev-obj-y)
518 $(SOFTMMU_FUZZ_RULES): $(crypto-obj-y)
519 $(SOFTMMU_FUZZ_RULES): $(io-obj-y)
520 $(SOFTMMU_FUZZ_RULES): config-all-devices.mak
521 $(SOFTMMU_FUZZ_RULES): $(edk2-decompressed)
523 .PHONY: $(TARGET_DIRS_RULES)
524 # The $(TARGET_DIRS_RULES) are of the form SUBDIR/GOAL, so that
525 # $(dir $@) yields the sub-directory, and $(notdir $@) yields the sub-goal
526 $(TARGET_DIRS_RULES):
527 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
529 DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
530 DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
531 DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
533 .PHONY: dtc/all
534 dtc/all: .git-submodule-status dtc/libfdt dtc/tests
535 $(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/libfdt.a,)
537 dtc/%: .git-submodule-status
538 @mkdir -p $@
540 # Overriding CFLAGS causes us to lose defines added in the sub-makefile.
541 # Not overriding CFLAGS leads to mis-matches between compilation modes.
542 # Therefore we replicate some of the logic in the sub-makefile.
543 # Remove all the extra -Warning flags that QEMU uses that Capstone doesn't;
544 # no need to annoy QEMU developers with such things.
545 CAP_CFLAGS = $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS))
546 CAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
547 CAP_CFLAGS += -DCAPSTONE_HAS_ARM
548 CAP_CFLAGS += -DCAPSTONE_HAS_ARM64
549 CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
550 CAP_CFLAGS += -DCAPSTONE_HAS_X86
552 .PHONY: capstone/all
553 capstone/all: .git-submodule-status
554 $(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))
556 .PHONY: slirp/all
557 slirp/all: .git-submodule-status
558 $(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp \
559 BUILD_DIR="$(BUILD_DIR)/slirp" \
560 PKG_CONFIG="$(PKG_CONFIG)" \
561 CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" \
562 CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
564 # Compatibility gunk to keep make working across the rename of targets
565 # for recursion, to be removed some time after 4.1.
566 subdir-dtc: dtc/all
567 subdir-capstone: capstone/all
568 subdir-slirp: slirp/all
570 $(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
571 $(qom-obj-y)
573 $(filter %/fuzz, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
574 $(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY))
576 ROM_DIRS = $(addprefix pc-bios/, $(ROMS))
577 ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
578 # Only keep -O and -g cflags
579 .PHONY: $(ROM_DIRS_RULES)
580 $(ROM_DIRS_RULES):
581 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
583 .PHONY: recurse-all recurse-clean recurse-install
584 recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
585 recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
586 recurse-install: $(addsuffix /install, $(TARGET_DIRS))
587 $(addsuffix /install, $(TARGET_DIRS)): all
589 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h
590 $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o")
592 Makefile: $(version-obj-y)
594 ######################################################################
595 # Build libraries
597 libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y)
598 libvhost-user.a: $(libvhost-user-obj-y) $(util-obj-y) $(stub-obj-y)
600 ######################################################################
602 COMMON_LDADDS = libqemuutil.a
604 qemu-img.o: qemu-img-cmds.h
606 qemu-img$(EXESUF): qemu-img.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
607 qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
608 qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
609 qemu-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)
611 qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
613 qemu-keymap$(EXESUF): qemu-keymap.o ui/input-keymap.o $(COMMON_LDADDS)
615 qemu-edid$(EXESUF): qemu-edid.o hw/display/edid-generate.o $(COMMON_LDADDS)
617 fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS)
619 scsi/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)
620 ifdef CONFIG_MPATH
621 scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
622 endif
624 qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
625 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@")
627 qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
628 qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
630 qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS)
631 qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS)
633 qapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \
634 $(SRC_PATH)/scripts/qapi/commands.py \
635 $(SRC_PATH)/scripts/qapi/common.py \
636 $(SRC_PATH)/scripts/qapi/doc.py \
637 $(SRC_PATH)/scripts/qapi/error.py \
638 $(SRC_PATH)/scripts/qapi/events.py \
639 $(SRC_PATH)/scripts/qapi/expr.py \
640 $(SRC_PATH)/scripts/qapi/gen.py \
641 $(SRC_PATH)/scripts/qapi/introspect.py \
642 $(SRC_PATH)/scripts/qapi/parser.py \
643 $(SRC_PATH)/scripts/qapi/schema.py \
644 $(SRC_PATH)/scripts/qapi/source.py \
645 $(SRC_PATH)/scripts/qapi/types.py \
646 $(SRC_PATH)/scripts/qapi/visit.py \
647 $(SRC_PATH)/scripts/qapi-gen.py
649 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
650 qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
651 qga/qapi-generated/qga-qapi-commands.h qga/qapi-generated/qga-qapi-commands.c \
652 qga/qapi-generated/qga-qapi-init-commands.h qga/qapi-generated/qga-qapi-init-commands.c \
653 qga/qapi-generated/qga-qapi-doc.texi: \
654 qga/qapi-generated/qapi-gen-timestamp ;
655 qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
656 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
657 -o qga/qapi-generated -p "qga-" $<, \
658 "GEN","$(@:%-timestamp=%)")
659 @>$@
661 qapi-modules = $(SRC_PATH)/qapi/qapi-schema.json \
662 $(QAPI_MODULES:%=$(SRC_PATH)/qapi/%.json)
664 $(GENERATED_QAPI_FILES): qapi-gen-timestamp ;
665 qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
666 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
667 -o "qapi" -b $<, \
668 "GEN","$(@:%-timestamp=%)")
669 @>$@
671 qapi-modules-storage-daemon = \
672 $(SRC_PATH)/storage-daemon/qapi/qapi-schema.json \
673 $(QAPI_MODULES_STORAGE_DAEMON:%=$(SRC_PATH)/qapi/%.json)
675 $(GENERATED_STORAGE_DAEMON_QAPI_FILES): storage-daemon/qapi/qapi-gen-timestamp ;
676 storage-daemon/qapi/qapi-gen-timestamp: $(qapi-modules-storage-daemon) $(qapi-py)
677 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
678 -o "storage-daemon/qapi" $<, \
679 "GEN","$(@:%-timestamp=%)")
680 @>$@
682 QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qapi-commands.h qga-qapi-init-commands.h)
683 $(qga-obj-y): $(QGALIB_GEN)
685 qemu-ga$(EXESUF): $(qga-obj-y) $(COMMON_LDADDS)
686 $(call LINK, $^)
688 ifdef QEMU_GA_MSI_ENABLED
689 QEMU_GA_MSI=qemu-ga-$(ARCH).msi
691 msi: $(QEMU_GA_MSI)
693 $(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER)
695 $(QEMU_GA_MSI): config-host.mak
697 $(QEMU_GA_MSI): $(SRC_PATH)/qga/installer/qemu-ga.wxs
698 $(call quiet-command,QEMU_GA_VERSION="$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER="$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO="$(QEMU_GA_DISTRO)" BUILD_DIR="$(BUILD_DIR)" \
699 wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<,"WIXL","$@")
700 else
701 msi:
702 @echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)"
703 endif
705 ifneq ($(EXESUF),)
706 .PHONY: qemu-ga
707 qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI)
708 endif
710 elf2dmp$(EXESUF): $(elf2dmp-obj-y)
711 $(call LINK, $^)
713 ifdef CONFIG_IVSHMEM
714 ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) $(COMMON_LDADDS)
715 $(call LINK, $^)
716 ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMMON_LDADDS)
717 $(call LINK, $^)
718 endif
719 vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) libvhost-user.a
720 $(call LINK, $^)
721 vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) libvhost-user.a
722 $(call LINK, $^)
724 rdmacm-mux$(EXESUF): LIBS += "-libumad"
725 rdmacm-mux$(EXESUF): $(rdmacm-mux-obj-y) $(COMMON_LDADDS)
726 $(call LINK, $^)
728 # relies on Linux-specific syscalls
729 ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
730 virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
731 $(call LINK, $^)
732 endif
734 vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
735 $(call LINK, $^)
737 ifdef CONFIG_VHOST_USER_INPUT
738 ifdef CONFIG_LINUX
739 vhost-user-input$(EXESUF): $(vhost-user-input-obj-y) libvhost-user.a libqemuutil.a
740 $(call LINK, $^)
742 # build by default, do not install
743 all: vhost-user-input$(EXESUF)
744 endif
745 endif
747 module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak
748 $(call quiet-command,$(PYTHON) $< $@ \
749 $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
750 "GEN","$@")
752 ifdef CONFIG_GCOV
753 .PHONY: clean-coverage
754 clean-coverage:
755 $(call quiet-command, \
756 find . \( -name '*.gcda' -o -name '*.gcov' \) -type f -exec rm {} +, \
757 "CLEAN", "coverage files")
758 endif
760 clean: recurse-clean
761 # avoid old build problems by removing potentially incorrect old files
762 rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
763 rm -f qemu-options.def
764 rm -f *.msi
765 find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
766 ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
767 ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
768 ! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
769 -exec rm {} +
770 rm -f $(edk2-decompressed)
771 rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~ */*~
772 rm -f fsdev/*.pod scsi/*.pod
773 rm -f qemu-img-cmds.h
774 rm -f ui/shader/*-vert.h ui/shader/*-frag.h
775 @# May not be present in generated-files-y
776 rm -f trace/generated-tracers-dtrace.dtrace*
777 rm -f trace/generated-tracers-dtrace.h*
778 rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
779 rm -f qapi-gen-timestamp
780 rm -f storage-daemon/qapi/qapi-gen-timestamp
781 rm -rf qga/qapi-generated
782 rm -f config-all-devices.mak
784 VERSION ?= $(shell cat VERSION)
786 dist: qemu-$(VERSION).tar.bz2
788 qemu-%.tar.bz2:
789 $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
791 define clean-manual =
792 rm -rf $(MANUAL_BUILDDIR)/$1/_static
793 rm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html
794 endef
796 distclean: clean
797 rm -f config-host.mak config-host.h* $(DOCS)
798 rm -f tests/tcg/config-*.mak
799 rm -f config-all-devices.mak config-all-disas.mak config.status
800 rm -f $(SUBDIR_DEVICES_MAK)
801 rm -f po/*.mo tests/qemu-iotests/common.env
802 rm -f roms/seabios/config.mak roms/vgabios/config.mak
803 rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
804 rm -f config.log
805 rm -f linux-headers/asm
806 rm -f docs/version.texi
807 rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi
808 rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7
809 rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
810 rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
811 rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
812 rm -rf .doctrees
813 $(call clean-manual,devel)
814 $(call clean-manual,interop)
815 $(call clean-manual,specs)
816 $(call clean-manual,system)
817 $(call clean-manual,tools)
818 $(call clean-manual,user)
819 for d in $(TARGET_DIRS); do \
820 rm -rf $$d || exit 1 ; \
821 done
822 rm -Rf .sdk
823 if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
825 KEYMAPS=da en-gb et fr fr-ch is lt no pt-br sv \
826 ar de en-us fi fr-be hr it lv nl pl ru th \
827 de-ch es fo fr-ca hu ja mk pt sl tr \
828 bepo cz
830 ifdef INSTALL_BLOBS
831 BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
832 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
833 vgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \
834 openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
835 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
836 pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
837 efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
838 efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
839 efi-e1000e.rom efi-vmxnet3.rom \
840 qemu-nsis.bmp \
841 bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
842 multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
843 s390-ccw.img s390-netboot.img \
844 slof.bin skiboot.lid \
845 palcode-clipper \
846 u-boot.e500 u-boot-sam460-20100605.bin \
847 qemu_vga.ndrv \
848 edk2-licenses.txt \
849 hppa-firmware.img \
850 opensbi-riscv32-sifive_u-fw_jump.bin opensbi-riscv32-virt-fw_jump.bin \
851 opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin
854 DESCS=50-edk2-i386-secure.json 50-edk2-x86_64-secure.json \
855 60-edk2-aarch64.json 60-edk2-arm.json 60-edk2-i386.json 60-edk2-x86_64.json
856 else
857 BLOBS=
858 DESCS=
859 endif
861 # Note that we manually filter-out the non-Sphinx documentation which
862 # is currently built into the docs/interop directory in the build tree,
863 # and also any sphinx-built manpages.
864 define install-manual =
865 for d in $$(cd $(MANUAL_BUILDDIR) && find $1 -type d); do $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/$$d"; done
866 for 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
867 endef
869 # Note that we deliberately do not install the "devel" manual: it is
870 # for QEMU developers, and not interesting to our users.
871 .PHONY: install-sphinxdocs
872 install-sphinxdocs: sphinxdocs
873 $(call install-manual,interop)
874 $(call install-manual,specs)
875 $(call install-manual,system)
876 $(call install-manual,tools)
877 $(call install-manual,user)
879 install-doc: $(DOCS) install-sphinxdocs
880 $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
881 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)"
882 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)"
883 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)"
884 ifdef CONFIG_POSIX
885 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
886 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1"
887 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
888 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
889 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7"
890 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7"
891 ifeq ($(CONFIG_TOOLS),y)
892 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-img.1 "$(DESTDIR)$(mandir)/man1"
893 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
894 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
895 endif
896 ifdef CONFIG_TRACE_SYSTEMTAP
897 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1"
898 endif
899 ifneq (,$(findstring qemu-ga,$(TOOLS)))
900 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
901 $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
902 $(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
903 $(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
904 endif
905 endif
906 ifdef CONFIG_VIRTFS
907 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
908 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
909 endif
910 ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
911 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtiofsd.1 "$(DESTDIR)$(mandir)/man1"
912 endif
914 install-datadir:
915 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
917 install-localstatedir:
918 ifdef CONFIG_POSIX
919 ifneq (,$(findstring qemu-ga,$(TOOLS)))
920 $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
921 endif
922 endif
924 ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
926 install-includedir:
927 $(INSTALL_DIR) "$(DESTDIR)$(includedir)"
929 install: all $(if $(BUILD_DOCS),install-doc) \
930 install-datadir install-localstatedir install-includedir \
931 $(if $(INSTALL_BLOBS),$(edk2-decompressed)) \
932 recurse-install
933 ifneq ($(TOOLS),)
934 $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
935 endif
936 ifneq ($(CONFIG_MODULES),)
937 $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
938 for s in $(modules-m:.mo=$(DSOSUF)); do \
939 t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
940 $(INSTALL_LIB) $$s "$$t"; \
941 test -z "$(STRIP)" || $(STRIP) "$$t"; \
942 done
943 endif
944 ifneq ($(HELPERS-y),)
945 $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
946 endif
947 ifneq ($(vhost-user-json-y),)
948 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/vhost-user/"
949 for x in $(vhost-user-json-y); do \
950 $(INSTALL_DATA) $$x "$(DESTDIR)$(qemu_datadir)/vhost-user/"; \
951 done
952 endif
953 ifdef CONFIG_TRACE_SYSTEMTAP
954 $(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
955 endif
956 ifneq ($(BLOBS),)
957 set -e; for x in $(BLOBS); do \
958 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
959 done
960 endif
961 ifdef INSTALL_BLOBS
962 set -e; for x in $(edk2-decompressed); do \
963 $(INSTALL_DATA) $$x "$(DESTDIR)$(qemu_datadir)"; \
964 done
965 endif
966 ifneq ($(DESCS),)
967 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/firmware"
968 set -e; tmpf=$$(mktemp); trap 'rm -f -- "$$tmpf"' EXIT; \
969 for x in $(DESCS); do \
970 sed -e 's,@DATADIR@,$(qemu_datadir),' \
971 "$(SRC_PATH)/pc-bios/descriptors/$$x" > "$$tmpf"; \
972 $(INSTALL_DATA) "$$tmpf" \
973 "$(DESTDIR)$(qemu_datadir)/firmware/$$x"; \
974 done
975 endif
976 for s in $(ICON_SIZES); do \
977 mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
978 $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
979 "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
980 done; \
981 mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \
982 $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \
983 "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
984 mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \
985 $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
986 "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
987 mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
988 $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
989 "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
990 ifdef CONFIG_GTK
991 $(MAKE) -C po $@
992 endif
993 ifeq ($(CONFIG_PLUGIN),y)
994 $(INSTALL_DATA) $(SRC_PATH)/include/qemu/qemu-plugin.h "$(DESTDIR)$(includedir)/qemu-plugin.h"
995 endif
996 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
997 set -e; for x in $(KEYMAPS); do \
998 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
999 done
1000 $(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all"
1002 .PHONY: ctags
1003 ctags:
1004 rm -f tags
1005 find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
1007 .PHONY: TAGS
1008 TAGS:
1009 rm -f TAGS
1010 find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
1012 cscope:
1013 rm -f "$(SRC_PATH)"/cscope.*
1014 find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files"
1015 cscope -b -i"$(SRC_PATH)/cscope.files"
1017 # opengl shader programs
1018 ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
1019 @mkdir -p $(dir $@)
1020 $(call quiet-command,\
1021 perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
1022 "VERT","$@")
1024 ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl
1025 @mkdir -p $(dir $@)
1026 $(call quiet-command,\
1027 perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
1028 "FRAG","$@")
1030 ui/shader.o: $(SRC_PATH)/ui/shader.c \
1031 ui/shader/texture-blit-vert.h \
1032 ui/shader/texture-blit-flip-vert.h \
1033 ui/shader/texture-blit-frag.h
1035 # documentation
1036 MAKEINFO=makeinfo
1037 MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
1038 MAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES)
1039 TEXI2PODFLAGS=$(MAKEINFOINCLUDES) -DVERSION="$(VERSION)" -DCONFDIR="$(qemu_confdir)"
1040 TEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES)
1042 docs/version.texi: $(SRC_PATH)/VERSION config-host.mak
1043 $(call quiet-command,(\
1044 echo "@set VERSION $(VERSION)" && \
1045 echo "@set CONFDIR $(qemu_confdir)" \
1046 )> $@,"GEN","$@")
1048 %.html: %.texi docs/version.texi
1049 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
1050 --html $< -o $@,"GEN","$@")
1052 %.info: %.texi docs/version.texi
1053 $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@")
1055 %.txt: %.texi docs/version.texi
1056 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
1057 --plaintext $< -o $@,"GEN","$@")
1059 %.pdf: %.texi docs/version.texi
1060 $(call quiet-command,texi2pdf $(TEXI2PDFFLAGS) $< -o $@,"GEN","$@")
1062 # Sphinx builds all its documentation at once in one invocation
1063 # and handles "don't rebuild things unless necessary" itself.
1064 # The '.doctrees' files are cached information to speed this up.
1065 .PHONY: sphinxdocs
1066 sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \
1067 $(MANUAL_BUILDDIR)/interop/index.html \
1068 $(MANUAL_BUILDDIR)/specs/index.html \
1069 $(MANUAL_BUILDDIR)/system/index.html \
1070 $(MANUAL_BUILDDIR)/tools/index.html \
1071 $(MANUAL_BUILDDIR)/user/index.html
1073 # Canned command to build a single manual
1074 # Arguments: $1 = manual name, $2 = Sphinx builder ('html' or 'man')
1075 # Note the use of different doctree for each (manual, builder) tuple;
1076 # this works around Sphinx not handling parallel invocation on
1077 # a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946
1078 build-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")
1079 # We assume all RST files in the manual's directory are used in it
1080 manual-deps = $(wildcard $(SRC_PATH)/docs/$1/*.rst $(SRC_PATH)/docs/$1/*/*.rst) \
1081 $(SRC_PATH)/docs/defs.rst.inc \
1082 $(SRC_PATH)/docs/$1/conf.py $(SRC_PATH)/docs/conf.py \
1083 $(SRC_PATH)/docs/sphinx/*.py
1084 # Macro to write out the rule and dependencies for building manpages
1085 # Usage: $(call define-manpage-rule,manualname,manpage1 manpage2...[,extradeps])
1086 # 'extradeps' is optional, and specifies extra files (eg .hx files) that
1087 # the manual page depends on.
1088 define define-manpage-rule
1089 $(call atomic,$(foreach manpage,$2,$(MANUAL_BUILDDIR)/$1/$(manpage)),$(call manual-deps,$1) $3)
1090 $(call build-manual,$1,man)
1091 endef
1093 $(MANUAL_BUILDDIR)/devel/index.html: $(call manual-deps,devel)
1094 $(call build-manual,devel,html)
1096 $(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop)
1097 $(call build-manual,interop,html)
1099 $(MANUAL_BUILDDIR)/specs/index.html: $(call manual-deps,specs)
1100 $(call build-manual,specs,html)
1102 $(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
1103 $(call build-manual,system,html)
1105 $(MANUAL_BUILDDIR)/tools/index.html: $(call manual-deps,tools) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc
1106 $(call build-manual,tools,html)
1108 $(MANUAL_BUILDDIR)/user/index.html: $(call manual-deps,user)
1109 $(call build-manual,user,html)
1111 $(call define-manpage-rule,interop,qemu-ga.8)
1113 $(call define-manpage-rule,system,qemu.1 qemu-block-drivers.7 qemu-cpu-models.7)
1115 $(call define-manpage-rule,tools,\
1116 qemu-img.1 qemu-nbd.8 qemu-trace-stap.1\
1117 virtiofsd.1 virtfs-proxy-helper.1,\
1118 $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc)
1120 $(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h
1121 @mkdir -p "$(MANUAL_BUILDDIR)"
1122 $(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \
1123 "GEN","$@")
1125 docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi
1126 @cp -p $< $@
1128 docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi
1129 @cp -p $< $@
1131 html: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs
1132 info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
1133 pdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
1134 txt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
1136 docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \
1137 docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \
1138 docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \
1139 docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi
1141 docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \
1142 docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \
1143 docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \
1144 docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi
1146 $(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl
1148 # Reports/Analysis
1150 %/coverage-report.html:
1151 @mkdir -p $*
1152 $(call quiet-command,\
1153 gcovr -r $(SRC_PATH) \
1154 $(foreach t, $(TARGET_DIRS), --object-directory $(BUILD_DIR)/$(t)) \
1155 --object-directory $(BUILD_DIR) \
1156 -p --html --html-details -o $@, \
1157 "GEN", "coverage-report.html")
1159 .PHONY: coverage-report
1160 coverage-report: $(CURDIR)/reports/coverage/coverage-report.html
1162 ifdef CONFIG_WIN32
1164 INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
1166 nsisflags = -V2 -NOCD
1168 ifneq ($(wildcard $(SRC_PATH)/dll),)
1169 ifeq ($(ARCH),x86_64)
1170 # 64 bit executables
1171 DLL_PATH = $(SRC_PATH)/dll/w64
1172 nsisflags += -DW64
1173 else
1174 # 32 bit executables
1175 DLL_PATH = $(SRC_PATH)/dll/w32
1176 endif
1177 endif
1179 .PHONY: installer
1180 installer: $(INSTALLER)
1182 INSTDIR=/tmp/qemu-nsis
1184 $(INSTALLER): install-doc $(SRC_PATH)/qemu.nsi
1185 $(MAKE) install prefix=${INSTDIR}
1186 ifdef SIGNCODE
1187 (cd ${INSTDIR}; \
1188 for i in *.exe; do \
1189 $(SIGNCODE) $${i}; \
1190 done \
1192 endif # SIGNCODE
1193 (cd ${INSTDIR}; \
1194 for i in qemu-system-*.exe; do \
1195 arch=$${i%.exe}; \
1196 arch=$${arch#qemu-system-}; \
1197 echo Section \"$$arch\" Section_$$arch; \
1198 echo SetOutPath \"\$$INSTDIR\"; \
1199 echo File \"\$${BINDIR}\\$$i\"; \
1200 echo SectionEnd; \
1201 done \
1202 ) >${INSTDIR}/system-emulations.nsh
1203 makensis $(nsisflags) \
1204 $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
1205 $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
1206 -DBINDIR="${INSTDIR}" \
1207 $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
1208 -DSRCDIR="$(SRC_PATH)" \
1209 -DOUTFILE="$(INSTALLER)" \
1210 -DDISPLAYVERSION="$(VERSION)" \
1211 $(SRC_PATH)/qemu.nsi
1212 rm -r ${INSTDIR}
1213 ifdef SIGNCODE
1214 $(SIGNCODE) $(INSTALLER)
1215 endif # SIGNCODE
1216 endif # CONFIG_WIN
1218 # Add a dependency on the generated files, so that they are always
1219 # rebuilt before other object files
1220 ifneq ($(wildcard config-host.mak),)
1221 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
1222 Makefile: $(generated-files-y)
1223 endif
1224 endif
1226 .SECONDARY: $(TRACE_HEADERS) $(TRACE_HEADERS:%=%-timestamp) \
1227 $(TRACE_SOURCES) $(TRACE_SOURCES:%=%-timestamp) \
1228 $(TRACE_DTRACE) $(TRACE_DTRACE:%=%-timestamp)
1230 # Include automatically generated dependency files
1231 # Dependencies in Makefile.objs files come from our recursive subdir rules
1232 -include $(wildcard *.d tests/*.d)
1234 include $(SRC_PATH)/tests/docker/Makefile.include
1235 include $(SRC_PATH)/tests/vm/Makefile.include
1237 print-help-run = printf " %-30s - %s\\n" "$1" "$2"
1238 print-help = $(quiet-@)$(call print-help-run,$1,$2)
1240 .PHONY: help
1241 help:
1242 @echo 'Generic targets:'
1243 $(call print-help,all,Build all)
1244 ifdef CONFIG_MODULES
1245 $(call print-help,modules,Build all modules)
1246 endif
1247 $(call print-help,dir/file.o,Build specified target only)
1248 $(call print-help,install,Install QEMU, documentation and tools)
1249 $(call print-help,ctags/TAGS,Generate tags file for editors)
1250 $(call print-help,cscope,Generate cscope index)
1251 @echo ''
1252 @$(if $(TARGET_DIRS), \
1253 echo 'Architecture specific targets:'; \
1254 $(foreach t, $(TARGET_DIRS), \
1255 $(call print-help-run,$(t)/all,Build for $(t)); \
1256 $(if $(CONFIG_FUZZ), \
1257 $(if $(findstring softmmu,$(t)), \
1258 $(call print-help-run,$(t)/fuzz,Build fuzzer for $(t)); \
1259 ))) \
1260 echo '')
1261 @$(if $(HELPERS-y), \
1262 echo 'Helper targets:'; \
1263 $(foreach t, $(HELPERS-y), \
1264 $(call print-help-run,$(t),Build $(shell basename $(t)));) \
1265 echo '')
1266 @$(if $(TOOLS), \
1267 echo 'Tools targets:'; \
1268 $(foreach t, $(TOOLS), \
1269 $(call print-help-run,$(t),Build $(shell basename $(t)) tool);) \
1270 echo '')
1271 @echo 'Cleaning targets:'
1272 $(call print-help,clean,Remove most generated files but keep the config)
1273 ifdef CONFIG_GCOV
1274 $(call print-help,clean-coverage,Remove coverage files)
1275 endif
1276 $(call print-help,distclean,Remove all generated files)
1277 $(call print-help,dist,Build a distributable tarball)
1278 @echo ''
1279 @echo 'Test targets:'
1280 $(call print-help,check,Run all tests (check-help for details))
1281 $(call print-help,docker,Help about targets running tests inside containers)
1282 $(call print-help,vm-help,Help about targets running tests inside VM)
1283 @echo ''
1284 @echo 'Documentation targets:'
1285 $(call print-help,html info pdf txt,Build documentation in specified format)
1286 ifdef CONFIG_GCOV
1287 $(call print-help,coverage-report,Create code coverage report)
1288 endif
1289 @echo ''
1290 ifdef CONFIG_WIN32
1291 @echo 'Windows targets:'
1292 $(call print-help,installer,Build NSIS-based installer for QEMU)
1293 ifdef QEMU_GA_MSI_ENABLED
1294 $(call print-help,msi,Build MSI-based installer for qemu-ga)
1295 endif
1296 @echo ''
1297 endif
1298 $(call print-help,$(MAKE) [targets],(quiet build, default))
1299 $(call print-help,$(MAKE) V=1 [targets],(verbose build))