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