pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type
[qemu/ericb.git] / Makefile
blobd86ecd2dd4e8b3009c62153f9a415fa3b5970029
1 # Makefile for QEMU.
3 # Always point to the root of the build tree (needs GNU make).
4 BUILD_DIR=$(CURDIR)
6 # Before including a proper config-host.mak, assume we are in the source tree
7 SRC_PATH=.
9 UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
10 html info pdf txt \
11 help check-help \
12 docker docker-% vm-test vm-build-%
14 # All following code might depend on configuration variables
15 ifneq ($(wildcard config-host.mak),)
16 # Put the all: rule here so that config-host.mak can contain dependencies.
17 all:
18 include config-host.mak
20 git-submodule-update:
22 .PHONY: git-submodule-update
24 git_module_status := $(shell \
25 cd '$(SRC_PATH)' && \
26 GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
27 echo $$?; \
30 ifeq (1,$(git_module_status))
31 ifeq (no,$(GIT_UPDATE))
32 git-submodule-update:
33 $(call quiet-command, \
34 echo && \
35 echo "GIT submodule checkout is out of date. Please run" && \
36 echo " scripts/git-submodule.sh update $(GIT_SUBMODULES)" && \
37 echo "from the source directory checkout $(SRC_PATH)" && \
38 echo && \
39 exit 1)
40 else
41 git-submodule-update:
42 $(call quiet-command, \
43 (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
44 "GIT","$(GIT_SUBMODULES)")
45 endif
46 endif
48 .git-submodule-status: git-submodule-update config-host.mak
50 # Check that we're not trying to do an out-of-tree build from
51 # a tree that's been used for an in-tree build.
52 ifneq ($(realpath $(SRC_PATH)),$(realpath .))
53 ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
54 $(error This is an out of tree build but your source tree ($(SRC_PATH)) \
55 seems to have been used for an in-tree build. You can fix this by running \
56 "$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
57 endif
58 endif
60 CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
61 CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
62 CONFIG_XEN := $(CONFIG_XEN_BACKEND)
63 CONFIG_ALL=y
64 -include config-all-devices.mak
65 -include config-all-disas.mak
67 config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios
68 @echo $@ is out-of-date, running configure
69 @# TODO: The next lines include code which supports a smooth
70 @# transition from old configurations without config.status.
71 @# This code can be removed after QEMU 1.7.
72 @if test -x config.status; then \
73 ./config.status; \
74 else \
75 sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh; \
77 else
78 config-host.mak:
79 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
80 @echo "Please call configure before running make!"
81 @exit 1
82 endif
83 endif
85 include $(SRC_PATH)/rules.mak
87 GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
88 GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
89 GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
90 GENERATED_FILES += qmp-introspect.h
91 GENERATED_FILES += qmp-introspect.c
93 GENERATED_FILES += trace/generated-tcg-tracers.h
95 GENERATED_FILES += trace/generated-helpers-wrappers.h
96 GENERATED_FILES += trace/generated-helpers.h
97 GENERATED_FILES += trace/generated-helpers.c
99 ifdef CONFIG_TRACE_UST
100 GENERATED_FILES += trace-ust-all.h
101 GENERATED_FILES += trace-ust-all.c
102 endif
104 GENERATED_FILES += module_block.h
106 TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h)
107 TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c)
108 TRACE_DTRACE =
109 ifdef CONFIG_TRACE_DTRACE
110 TRACE_HEADERS += trace-dtrace-root.h $(trace-events-subdirs:%=%/trace-dtrace.h)
111 TRACE_DTRACE += trace-dtrace-root.dtrace $(trace-events-subdirs:%=%/trace-dtrace.dtrace)
112 endif
113 ifdef CONFIG_TRACE_UST
114 TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h)
115 endif
117 GENERATED_FILES += $(TRACE_HEADERS)
118 GENERATED_FILES += $(TRACE_SOURCES)
119 GENERATED_FILES += $(BUILD_DIR)/trace-events-all
120 GENERATED_FILES += .git-submodule-status
122 trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
124 tracetool-y = $(SRC_PATH)/scripts/tracetool.py
125 tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
127 %/trace.h: %/trace.h-timestamp
128 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
129 %/trace.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y)
130 $(call quiet-command,$(TRACETOOL) \
131 --group=$(call trace-group-name,$@) \
132 --format=h \
133 --backends=$(TRACE_BACKENDS) \
134 $< > $@,"GEN","$(@:%-timestamp=%)")
136 %/trace.c: %/trace.c-timestamp
137 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
138 %/trace.c-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y)
139 $(call quiet-command,$(TRACETOOL) \
140 --group=$(call trace-group-name,$@) \
141 --format=c \
142 --backends=$(TRACE_BACKENDS) \
143 $< > $@,"GEN","$(@:%-timestamp=%)")
145 %/trace-ust.h: %/trace-ust.h-timestamp
146 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
147 %/trace-ust.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y)
148 $(call quiet-command,$(TRACETOOL) \
149 --group=$(call trace-group-name,$@) \
150 --format=ust-events-h \
151 --backends=$(TRACE_BACKENDS) \
152 $< > $@,"GEN","$(@:%-timestamp=%)")
154 %/trace-dtrace.dtrace: %/trace-dtrace.dtrace-timestamp
155 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
156 %/trace-dtrace.dtrace-timestamp: $(SRC_PATH)/%/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
157 $(call quiet-command,$(TRACETOOL) \
158 --group=$(call trace-group-name,$@) \
159 --format=d \
160 --backends=$(TRACE_BACKENDS) \
161 $< > $@,"GEN","$(@:%-timestamp=%)")
163 %/trace-dtrace.h: %/trace-dtrace.dtrace $(tracetool-y)
164 $(call quiet-command,dtrace -o $@ -h -s $<, "GEN","$@")
166 %/trace-dtrace.o: %/trace-dtrace.dtrace $(tracetool-y)
169 trace-root.h: trace-root.h-timestamp
170 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
171 trace-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y)
172 $(call quiet-command,$(TRACETOOL) \
173 --group=root \
174 --format=h \
175 --backends=$(TRACE_BACKENDS) \
176 $< > $@,"GEN","$(@:%-timestamp=%)")
178 trace-root.c: trace-root.c-timestamp
179 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
180 trace-root.c-timestamp: $(SRC_PATH)/trace-events $(tracetool-y)
181 $(call quiet-command,$(TRACETOOL) \
182 --group=root \
183 --format=c \
184 --backends=$(TRACE_BACKENDS) \
185 $< > $@,"GEN","$(@:%-timestamp=%)")
187 trace-ust-root.h: trace-ust-root.h-timestamp
188 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
189 trace-ust-root.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y)
190 $(call quiet-command,$(TRACETOOL) \
191 --group=root \
192 --format=ust-events-h \
193 --backends=$(TRACE_BACKENDS) \
194 $< > $@,"GEN","$(@:%-timestamp=%)")
196 trace-ust-all.h: trace-ust-all.h-timestamp
197 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
198 trace-ust-all.h-timestamp: $(trace-events-files) $(tracetool-y)
199 $(call quiet-command,$(TRACETOOL) \
200 --group=all \
201 --format=ust-events-h \
202 --backends=$(TRACE_BACKENDS) \
203 $(trace-events-files) > $@,"GEN","$(@:%-timestamp=%)")
205 trace-ust-all.c: trace-ust-all.c-timestamp
206 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
207 trace-ust-all.c-timestamp: $(trace-events-files) $(tracetool-y)
208 $(call quiet-command,$(TRACETOOL) \
209 --group=all \
210 --format=ust-events-c \
211 --backends=$(TRACE_BACKENDS) \
212 $(trace-events-files) > $@,"GEN","$(@:%-timestamp=%)")
214 trace-dtrace-root.dtrace: trace-dtrace-root.dtrace-timestamp
215 @cmp $< $@ >/dev/null 2>&1 || cp $< $@
216 trace-dtrace-root.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
217 $(call quiet-command,$(TRACETOOL) \
218 --group=root \
219 --format=d \
220 --backends=$(TRACE_BACKENDS) \
221 $< > $@,"GEN","$(@:%-timestamp=%)")
223 trace-dtrace-root.h: trace-dtrace-root.dtrace
224 $(call quiet-command,dtrace -o $@ -h -s $<, "GEN","$@")
226 trace-dtrace-root.o: trace-dtrace-root.dtrace
228 KEYCODEMAP_GEN = $(SRC_PATH)/ui/keycodemapdb/tools/keymap-gen
229 KEYCODEMAP_CSV = $(SRC_PATH)/ui/keycodemapdb/data/keymaps.csv
231 KEYCODEMAP_FILES = \
232 ui/input-keymap-linux-to-qcode.c \
233 ui/input-keymap-qcode-to-qnum.c \
234 ui/input-keymap-qnum-to-qcode.c \
235 ui/input-keymap-qcode-to-linux.c \
236 $(NULL)
238 GENERATED_FILES += $(KEYCODEMAP_FILES)
240 ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
241 $(call quiet-command,\
242 src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
243 dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
244 test -e $(KEYCODEMAP_GEN) && \
245 $(PYTHON) $(KEYCODEMAP_GEN) \
246 --lang glib2 \
247 --varname qemu_input_map_$${src}_to_$${dst} \
248 code-map $(KEYCODEMAP_CSV) $${src} $${dst} \
249 > $@ || rm -f $@, "GEN", "$@")
251 $(KEYCODEMAP_GEN): .git-submodule-status
252 $(KEYCODEMAP_CSV): .git-submodule-status
254 # Don't try to regenerate Makefile or configure
255 # We don't generate any of them
256 Makefile: ;
257 configure: ;
259 .PHONY: all clean cscope distclean html info install install-doc \
260 pdf txt recurse-all dist msi FORCE
262 $(call set-vpath, $(SRC_PATH))
264 LIBS+=-lz $(LIBS_TOOLS)
266 HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
268 ifdef BUILD_DOCS
269 DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
270 DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
271 DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
272 DOCS+=docs/qemu-block-drivers.7
273 ifdef CONFIG_VIRTFS
274 DOCS+=fsdev/virtfs-proxy-helper.1
275 endif
276 else
277 DOCS=
278 endif
280 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
281 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
282 SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
284 ifeq ($(SUBDIR_DEVICES_MAK),)
285 config-all-devices.mak:
286 $(call quiet-command,echo '# no devices' > $@,"GEN","$@")
287 else
288 config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
289 $(call quiet-command, sed -n \
290 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
291 $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
292 "GEN","$@")
293 endif
295 -include $(SUBDIR_DEVICES_MAK_DEP)
297 %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/scripts/make_device_config.sh
298 $(call quiet-command, \
299 $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp,"GEN","$@.tmp")
300 $(call quiet-command, if test -f $@; then \
301 if cmp -s $@.old $@; then \
302 mv $@.tmp $@; \
303 cp -p $@ $@.old; \
304 else \
305 if test -f $@.old; then \
306 echo "WARNING: $@ (user modified) out of date.";\
307 else \
308 echo "WARNING: $@ out of date.";\
309 fi; \
310 echo "Run \"$(MAKE) defconfig\" to regenerate."; \
311 rm $@.tmp; \
312 fi; \
313 else \
314 mv $@.tmp $@; \
315 cp -p $@ $@.old; \
316 fi,"GEN","$@");
318 defconfig:
319 rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
321 ifneq ($(wildcard config-host.mak),)
322 include $(SRC_PATH)/Makefile.objs
323 endif
325 dummy := $(call unnest-vars,, \
326 stub-obj-y \
327 chardev-obj-y \
328 util-obj-y \
329 qga-obj-y \
330 ivshmem-client-obj-y \
331 ivshmem-server-obj-y \
332 libvhost-user-obj-y \
333 vhost-user-scsi-obj-y \
334 qga-vss-dll-obj-y \
335 block-obj-y \
336 block-obj-m \
337 crypto-obj-y \
338 crypto-aes-obj-y \
339 qom-obj-y \
340 io-obj-y \
341 common-obj-y \
342 common-obj-m \
343 trace-obj-y)
345 include $(SRC_PATH)/tests/Makefile.include
347 all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
349 qemu-version.h: FORCE
350 $(call quiet-command, \
351 (cd $(SRC_PATH); \
352 printf '#define QEMU_PKGVERSION '; \
353 if test -n "$(PKGVERSION)"; then \
354 printf '"$(PKGVERSION)"\n'; \
355 else \
356 if test -d .git; then \
357 printf '" ('; \
358 git describe --match 'v*' 2>/dev/null | tr -d '\n'; \
359 if ! git diff-index --quiet HEAD &>/dev/null; then \
360 printf -- '-dirty'; \
361 fi; \
362 printf ')"\n'; \
363 else \
364 printf '""\n'; \
365 fi; \
366 fi) > $@.tmp)
367 $(call quiet-command, if ! cmp -s $@ $@.tmp; then \
368 mv $@.tmp $@; \
369 else \
370 rm $@.tmp; \
373 config-host.h: config-host.h-timestamp
374 config-host.h-timestamp: config-host.mak
375 qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool
376 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@")
378 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
379 SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
381 $(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
382 $(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)
383 $(SOFTMMU_SUBDIR_RULES): $(io-obj-y)
384 $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
386 subdir-%:
387 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
389 DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
390 DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
391 DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
393 subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests
394 $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
396 dtc/%: .git-submodule-status
397 mkdir -p $@
399 # Overriding CFLAGS causes us to lose defines added in the sub-makefile.
400 # Not overriding CFLAGS leads to mis-matches between compilation modes.
401 # Therefore we replicate some of the logic in the sub-makefile.
402 # Remove all the extra -Warning flags that QEMU uses that Capstone doesn't;
403 # no need to annoy QEMU developers with such things.
404 CAP_CFLAGS = $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS))
405 CAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
406 CAP_CFLAGS += -DCAPSTONE_HAS_ARM
407 CAP_CFLAGS += -DCAPSTONE_HAS_ARM64
408 CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
409 CAP_CFLAGS += -DCAPSTONE_HAS_X86
411 subdir-capstone: .git-submodule-status
412 $(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))
414 $(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \
415 $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
417 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
418 # Only keep -O and -g cflags
419 romsubdir-%:
420 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/" CFLAGS="$(filter -O% -g%,$(CFLAGS))",)
422 ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
424 recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
426 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h
427 $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o")
429 Makefile: $(version-obj-y)
431 ######################################################################
432 # Build libraries
434 libqemuutil.a: $(util-obj-y) $(trace-obj-y) $(stub-obj-y)
435 libvhost-user.a: $(libvhost-user-obj-y)
437 ######################################################################
439 COMMON_LDADDS = libqemuutil.a
441 qemu-img.o: qemu-img-cmds.h
443 qemu-img$(EXESUF): qemu-img.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
444 qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
445 qemu-io$(EXESUF): qemu-io.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
447 qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
449 qemu-keymap$(EXESUF): qemu-keymap.o ui/input-keymap.o $(COMMON_LDADDS)
451 fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS)
452 fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
454 scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
455 ifdef CONFIG_MPATH
456 scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
457 endif
459 qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
460 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@")
462 qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
463 qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
465 qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS)
466 qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS)
468 gen-out-type = $(subst .,-,$(suffix $@))
470 qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
472 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
473 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
474 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
475 $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
476 "GEN","$@")
477 qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
478 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
479 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
480 $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
481 "GEN","$@")
482 qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
483 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
484 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
485 $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
486 "GEN","$@")
488 qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
489 $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
490 $(SRC_PATH)/qapi/char.json \
491 $(SRC_PATH)/qapi/crypto.json \
492 $(SRC_PATH)/qapi/introspect.json \
493 $(SRC_PATH)/qapi/migration.json \
494 $(SRC_PATH)/qapi/net.json \
495 $(SRC_PATH)/qapi/rocker.json \
496 $(SRC_PATH)/qapi/run-state.json \
497 $(SRC_PATH)/qapi/sockets.json \
498 $(SRC_PATH)/qapi/tpm.json \
499 $(SRC_PATH)/qapi/trace.json \
500 $(SRC_PATH)/qapi/transaction.json \
501 $(SRC_PATH)/qapi/ui.json
503 qapi-types.c qapi-types.h :\
504 $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
505 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
506 $(gen-out-type) -o "." -b $<, \
507 "GEN","$@")
508 qapi-visit.c qapi-visit.h :\
509 $(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
510 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
511 $(gen-out-type) -o "." -b $<, \
512 "GEN","$@")
513 qapi-event.c qapi-event.h :\
514 $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
515 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
516 $(gen-out-type) -o "." $<, \
517 "GEN","$@")
518 qmp-commands.h qmp-marshal.c :\
519 $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
520 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
521 $(gen-out-type) -o "." $<, \
522 "GEN","$@")
523 qmp-introspect.h qmp-introspect.c :\
524 $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
525 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
526 $(gen-out-type) -o "." $<, \
527 "GEN","$@")
529 QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
530 $(qga-obj-y): $(QGALIB_GEN)
532 qemu-ga$(EXESUF): $(qga-obj-y) $(COMMON_LDADDS)
533 $(call LINK, $^)
535 ifdef QEMU_GA_MSI_ENABLED
536 QEMU_GA_MSI=qemu-ga-$(ARCH).msi
538 msi: $(QEMU_GA_MSI)
540 $(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER)
542 $(QEMU_GA_MSI): config-host.mak
544 $(QEMU_GA_MSI): $(SRC_PATH)/qga/installer/qemu-ga.wxs
545 $(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)" \
546 wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<,"WIXL","$@")
547 else
548 msi:
549 @echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)"
550 endif
552 ifneq ($(EXESUF),)
553 .PHONY: qemu-ga
554 qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI)
555 endif
557 ifdef CONFIG_IVSHMEM
558 ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) $(COMMON_LDADDS)
559 $(call LINK, $^)
560 ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) $(COMMON_LDADDS)
561 $(call LINK, $^)
562 endif
563 vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) libvhost-user.a
564 $(call LINK, $^)
566 module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak
567 $(call quiet-command,$(PYTHON) $< $@ \
568 $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
569 "GEN","$@")
571 clean:
572 # avoid old build problems by removing potentially incorrect old files
573 rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
574 rm -f qemu-options.def
575 rm -f *.msi
576 find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
577 rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
578 rm -f fsdev/*.pod scsi/*.pod
579 rm -f qemu-img-cmds.h
580 rm -f ui/shader/*-vert.h ui/shader/*-frag.h
581 @# May not be present in GENERATED_FILES
582 rm -f trace/generated-tracers-dtrace.dtrace*
583 rm -f trace/generated-tracers-dtrace.h*
584 rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp)
585 rm -rf qapi-generated
586 rm -rf qga/qapi-generated
587 for d in $(ALL_SUBDIRS); do \
588 if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
589 rm -f $$d/qemu-options.def; \
590 done
591 rm -f $(SUBDIR_DEVICES_MAK) config-all-devices.mak
593 VERSION ?= $(shell cat VERSION)
595 dist: qemu-$(VERSION).tar.bz2
597 qemu-%.tar.bz2:
598 $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
600 distclean: clean
601 rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi qemu-monitor-info.texi
602 rm -f config-all-devices.mak config-all-disas.mak config.status
603 rm -f po/*.mo tests/qemu-iotests/common.env
604 rm -f roms/seabios/config.mak roms/vgabios/config.mak
605 rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps
606 rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
607 rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
608 rm -f qemu-doc.vr qemu-doc.txt
609 rm -f config.log
610 rm -f linux-headers/asm
611 rm -f docs/version.texi
612 rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi
613 rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7
614 rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
615 rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
616 rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
617 rm -f docs/qemu-block-drivers.7
618 for d in $(TARGET_DIRS); do \
619 rm -rf $$d || exit 1 ; \
620 done
621 rm -Rf .sdk
622 if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
624 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
625 ar de en-us fi fr-be hr it lv nl pl ru th \
626 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr \
627 bepo cz
629 ifdef INSTALL_BLOBS
630 BLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
631 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
632 acpi-dsdt.aml \
633 ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
634 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
635 pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
636 efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
637 efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
638 efi-e1000e.rom efi-vmxnet3.rom \
639 qemu-icon.bmp qemu_logo_no_text.svg \
640 bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
641 multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin \
642 s390-ccw.img s390-netboot.img \
643 spapr-rtas.bin slof.bin skiboot.lid \
644 palcode-clipper \
645 u-boot.e500 \
646 qemu_vga.ndrv
647 else
648 BLOBS=
649 endif
651 install-doc: $(DOCS)
652 $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
653 $(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)"
654 $(INSTALL_DATA) qemu-doc.txt "$(DESTDIR)$(qemu_docdir)"
655 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)"
656 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)"
657 ifdef CONFIG_POSIX
658 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
659 $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
660 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
661 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
662 $(INSTALL_DATA) docs/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7"
663 ifneq ($(TOOLS),)
664 $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1"
665 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
666 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
667 endif
668 ifneq (,$(findstring qemu-ga,$(TOOLS)))
669 $(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
670 $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
671 $(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
672 $(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
673 endif
674 endif
675 ifdef CONFIG_VIRTFS
676 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
677 $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
678 endif
680 install-datadir:
681 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
683 install-localstatedir:
684 ifdef CONFIG_POSIX
685 ifneq (,$(findstring qemu-ga,$(TOOLS)))
686 $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
687 endif
688 endif
691 install: all $(if $(BUILD_DOCS),install-doc) install-datadir install-localstatedir
692 ifneq ($(TOOLS),)
693 $(call install-prog,$(subst qemu-ga,qemu-ga$(EXESUF),$(TOOLS)),$(DESTDIR)$(bindir))
694 endif
695 ifneq ($(CONFIG_MODULES),)
696 $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
697 for s in $(modules-m:.mo=$(DSOSUF)); do \
698 t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
699 $(INSTALL_LIB) $$s "$$t"; \
700 test -z "$(STRIP)" || $(STRIP) "$$t"; \
701 done
702 endif
703 ifneq ($(HELPERS-y),)
704 $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
705 endif
706 ifneq ($(BLOBS),)
707 set -e; for x in $(BLOBS); do \
708 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
709 done
710 endif
711 ifeq ($(CONFIG_GTK),y)
712 $(MAKE) -C po $@
713 endif
714 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
715 set -e; for x in $(KEYMAPS); do \
716 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
717 done
718 $(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all"
719 for d in $(TARGET_DIRS); do \
720 $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
721 done
723 .PHONY: ctags
724 ctags:
725 rm -f tags
726 find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
728 .PHONY: TAGS
729 TAGS:
730 rm -f TAGS
731 find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
733 cscope:
734 rm -f "$(SRC_PATH)"/cscope.*
735 find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files"
736 cscope -b -i"$(SRC_PATH)/cscope.files"
738 # opengl shader programs
739 ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
740 @mkdir -p $(dir $@)
741 $(call quiet-command,\
742 perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
743 "VERT","$@")
745 ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl
746 @mkdir -p $(dir $@)
747 $(call quiet-command,\
748 perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
749 "FRAG","$@")
751 ui/shader.o: $(SRC_PATH)/ui/shader.c \
752 ui/shader/texture-blit-vert.h \
753 ui/shader/texture-blit-flip-vert.h \
754 ui/shader/texture-blit-frag.h
756 # documentation
757 MAKEINFO=makeinfo
758 MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
759 MAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES)
760 TEXI2PODFLAGS=$(MAKEINFOINCLUDES) "-DVERSION=$(VERSION)"
761 TEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES)
763 docs/version.texi: $(SRC_PATH)/VERSION
764 $(call quiet-command,echo "@set VERSION $(VERSION)" > $@,"GEN","$@")
766 %.html: %.texi docs/version.texi
767 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
768 --html $< -o $@,"GEN","$@")
770 %.info: %.texi docs/version.texi
771 $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@")
773 %.txt: %.texi docs/version.texi
774 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
775 --plaintext $< -o $@,"GEN","$@")
777 %.pdf: %.texi docs/version.texi
778 $(call quiet-command,texi2pdf $(TEXI2PDFFLAGS) $< -o $@,"GEN","$@")
780 qemu-options.texi: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool
781 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
783 qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool
784 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
786 qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool
787 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
789 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
790 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
792 docs/interop/qemu-qmp-qapi.texi docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
794 docs/interop/qemu-qmp-qapi.texi: $(qapi-modules)
795 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
797 docs/interop/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json
798 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
800 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
801 qemu.1: qemu-option-trace.texi
802 qemu-img.1: qemu-img.texi qemu-option-trace.texi qemu-img-cmds.texi
803 fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
804 qemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi
805 qemu-ga.8: qemu-ga.texi
806 docs/qemu-block-drivers.7: docs/qemu-block-drivers.texi
808 html: qemu-doc.html docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
809 info: qemu-doc.info docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
810 pdf: qemu-doc.pdf docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
811 txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
813 qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \
814 qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \
815 qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \
816 qemu-monitor-info.texi docs/qemu-block-drivers.texi
818 docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \
819 docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \
820 docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \
821 docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi
823 docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \
824 docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \
825 docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \
826 docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi
829 ifdef CONFIG_WIN32
831 INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
833 nsisflags = -V2 -NOCD
835 ifneq ($(wildcard $(SRC_PATH)/dll),)
836 ifeq ($(ARCH),x86_64)
837 # 64 bit executables
838 DLL_PATH = $(SRC_PATH)/dll/w64
839 nsisflags += -DW64
840 else
841 # 32 bit executables
842 DLL_PATH = $(SRC_PATH)/dll/w32
843 endif
844 endif
846 .PHONY: installer
847 installer: $(INSTALLER)
849 INSTDIR=/tmp/qemu-nsis
851 $(INSTALLER): $(SRC_PATH)/qemu.nsi
852 $(MAKE) install prefix=${INSTDIR}
853 ifdef SIGNCODE
854 (cd ${INSTDIR}; \
855 for i in *.exe; do \
856 $(SIGNCODE) $${i}; \
857 done \
859 endif # SIGNCODE
860 (cd ${INSTDIR}; \
861 for i in qemu-system-*.exe; do \
862 arch=$${i%.exe}; \
863 arch=$${arch#qemu-system-}; \
864 echo Section \"$$arch\" Section_$$arch; \
865 echo SetOutPath \"\$$INSTDIR\"; \
866 echo File \"\$${BINDIR}\\$$i\"; \
867 echo SectionEnd; \
868 done \
869 ) >${INSTDIR}/system-emulations.nsh
870 makensis $(nsisflags) \
871 $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
872 $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
873 -DBINDIR="${INSTDIR}" \
874 $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
875 -DSRCDIR="$(SRC_PATH)" \
876 -DOUTFILE="$(INSTALLER)" \
877 -DDISPLAYVERSION="$(VERSION)" \
878 $(SRC_PATH)/qemu.nsi
879 rm -r ${INSTDIR}
880 ifdef SIGNCODE
881 $(SIGNCODE) $(INSTALLER)
882 endif # SIGNCODE
883 endif # CONFIG_WIN
885 # Add a dependency on the generated files, so that they are always
886 # rebuilt before other object files
887 ifneq ($(wildcard config-host.mak),)
888 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
889 Makefile: $(GENERATED_FILES)
890 endif
891 endif
893 .SECONDARY: $(TRACE_HEADERS) $(TRACE_HEADERS:%=%-timestamp) \
894 $(TRACE_SOURCES) $(TRACE_SOURCES:%=%-timestamp) \
895 $(TRACE_DTRACE) $(TRACE_DTRACE:%=%-timestamp)
897 # Include automatically generated dependency files
898 # Dependencies in Makefile.objs files come from our recursive subdir rules
899 -include $(wildcard *.d tests/*.d)
901 include $(SRC_PATH)/tests/docker/Makefile.include
902 include $(SRC_PATH)/tests/vm/Makefile.include
904 .PHONY: help
905 help:
906 @echo 'Generic targets:'
907 @echo ' all - Build all'
908 @echo ' dir/file.o - Build specified target only'
909 @echo ' install - Install QEMU, documentation and tools'
910 @echo ' ctags/TAGS - Generate tags file for editors'
911 @echo ' cscope - Generate cscope index'
912 @echo ''
913 @$(if $(TARGET_DIRS), \
914 echo 'Architecture specific targets:'; \
915 $(foreach t, $(TARGET_DIRS), \
916 printf " %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \
917 echo '')
918 @echo 'Cleaning targets:'
919 @echo ' clean - Remove most generated files but keep the config'
920 @echo ' distclean - Remove all generated files'
921 @echo ' dist - Build a distributable tarball'
922 @echo ''
923 @echo 'Test targets:'
924 @echo ' check - Run all tests (check-help for details)'
925 @echo ' docker - Help about targets running tests inside Docker containers'
926 @echo ' vm-test - Help about targets running tests inside VM'
927 @echo ''
928 @echo 'Documentation targets:'
929 @echo ' html info pdf txt'
930 @echo ' - Build documentation in specified format'
931 @echo ''
932 ifdef CONFIG_WIN32
933 @echo 'Windows targets:'
934 @echo ' installer - Build NSIS-based installer for QEMU'
935 ifdef QEMU_GA_MSI_ENABLED
936 @echo ' msi - Build MSI-based installer for qemu-ga'
937 endif
938 @echo ''
939 endif
940 @echo ' $(MAKE) V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'