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