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