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