10cb3fb1eSpbrook# Makefile for QEMU. 20cb3fb1eSpbrook 3519e1693SStefan Weil# Always point to the root of the build tree (needs GNU make). 4519e1693SStefan WeilBUILD_DIR=$(CURDIR) 5388d4758SLluís Vilanova 6eaa2ddbbSFam Zheng# Before including a proper config-host.mak, assume we are in the source tree 7eaa2ddbbSFam ZhengSRC_PATH=. 8eaa2ddbbSFam Zheng 9324027c2SFam ZhengUNCHECKED_GOALS := %clean TAGS cscope ctags docker docker-% 10eaa2ddbbSFam Zheng 11250b086eSLluís Vilanova# All following code might depend on configuration variables 1255d7e8f6Saurel32ifneq ($(wildcard config-host.mak),) 131ad2134fSPaul Brook# Put the all: rule here so that config-host.mak can contain dependencies. 148f67aa82SStefan Weilall: 15ad064840Spbrookinclude config-host.mak 16d1bd2423SPeter Maydell 17d1bd2423SPeter Maydell# Check that we're not trying to do an out-of-tree build from 18d1bd2423SPeter Maydell# a tree that's been used for an in-tree build. 19d1bd2423SPeter Maydellifneq ($(realpath $(SRC_PATH)),$(realpath .)) 20d1bd2423SPeter Maydellifneq ($(wildcard $(SRC_PATH)/config-host.mak),) 21d1bd2423SPeter Maydell$(error This is an out of tree build but your source tree ($(SRC_PATH)) \ 22d1bd2423SPeter Maydellseems to have been used for an in-tree build. You can fix this by running \ 23d1bd2423SPeter Maydell"make distclean && rm -rf *-linux-user *-softmmu" in your source tree) 24d1bd2423SPeter Maydellendif 25d1bd2423SPeter Maydellendif 26d1bd2423SPeter Maydell 27f3aa844bSPaolo BonziniCONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y) 28f3aa844bSPaolo BonziniCONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y) 29f3aa844bSPaolo BonziniCONFIG_ALL=y 30f3aa844bSPaolo Bonzini-include config-all-devices.mak 31f3aa844bSPaolo Bonzini-include config-all-disas.mak 32f3aa844bSPaolo Bonzini 338df42d85SGerd Hoffmannconfig-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios 34e5efe7f5SJuan Quintela @echo $@ is out-of-date, running configure 35bdf523e6SStefan Weil @# TODO: The next lines include code which supports a smooth 36bdf523e6SStefan Weil @# transition from old configurations without config.status. 37bdf523e6SStefan Weil @# This code can be removed after QEMU 1.7. 38bdf523e6SStefan Weil @if test -x config.status; then \ 39bdf523e6SStefan Weil ./config.status; \ 40bdf523e6SStefan Weil else \ 41bdf523e6SStefan Weil sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh; \ 42bdf523e6SStefan Weil fi 4355d7e8f6Saurel32else 4455d7e8f6Saurel32config-host.mak: 45eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) 4655d7e8f6Saurel32 @echo "Please call configure before running make!" 4755d7e8f6Saurel32 @exit 1 4855d7e8f6Saurel32endif 497748b8cbSMike Frysingerendif 50766a487aSbellard 51fb57c881SFam Zhenginclude $(SRC_PATH)/rules.mak 52fb57c881SFam Zheng 5367a1de0dSFam ZhengGENERATED_HEADERS = qemu-version.h config-host.h qemu-options.def 5421cd70dfSWenchao XiaGENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h 5521cd70dfSWenchao XiaGENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c 5639a18158SMarkus ArmbrusterGENERATED_HEADERS += qmp-introspect.h 5739a18158SMarkus ArmbrusterGENERATED_SOURCES += qmp-introspect.c 58eac236eaSLluís Vilanova 59eac236eaSLluís VilanovaGENERATED_HEADERS += trace/generated-tracers.h 605b808275SLluís Vilanovaifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace) 61eac236eaSLluís VilanovaGENERATED_HEADERS += trace/generated-tracers-dtrace.h 62eac236eaSLluís Vilanovaendif 63eac236eaSLluís VilanovaGENERATED_SOURCES += trace/generated-tracers.c 64250b086eSLluís Vilanova 65465830fbSLluís VilanovaGENERATED_HEADERS += trace/generated-tcg-tracers.h 66465830fbSLluís Vilanova 67f4654226SLluís VilanovaGENERATED_HEADERS += trace/generated-helpers-wrappers.h 68707c8a98SLluís VilanovaGENERATED_HEADERS += trace/generated-helpers.h 69341ea691SLluís VilanovaGENERATED_SOURCES += trace/generated-helpers.c 70707c8a98SLluís Vilanova 715b808275SLluís Vilanovaifeq ($(findstring ust,$(TRACE_BACKENDS)),ust) 72e6bf23f8SMohamad GebaiGENERATED_HEADERS += trace/generated-ust-provider.h 73e6bf23f8SMohamad GebaiGENERATED_SOURCES += trace/generated-ust.c 74e6bf23f8SMohamad Gebaiendif 75e6bf23f8SMohamad Gebai 760c0c1fd9SMarc MariGENERATED_HEADERS += module_block.h 770c0c1fd9SMarc Mari 78d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure 79d9ace8b3SJuan Quintela# We don't generate any of them 80d9ace8b3SJuan QuintelaMakefile: ; 81d9ace8b3SJuan Quintelaconfigure: ; 82d9ace8b3SJuan Quintela 83bd3f5706SMarc-André Lureau.PHONY: all clean cscope distclean html info install install-doc \ 84f8bab10bSMarc-André Lureau pdf txt recurse-all speed test dist msi FORCE 850cb3fb1eSpbrook 86fec90ff0SPaolo Bonzini$(call set-vpath, $(SRC_PATH)) 878c462f8fSpbrook 883e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS) 8967c0f08dSJuan Quintela 907b93fadfSCorey BryantHELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) 917b93fadfSCorey Bryant 92cc8ae6deSpbrookifdef BUILD_DOCS 93f8bab10bSMarc-André LureauDOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 9456e8bdd4SMarc-André LureauDOCS+=docs/qemu-qmp-ref.html docs/qemu-qmp-ref.txt docs/qemu-qmp-ref.7 9556e8bdd4SMarc-André LureauDOCS+=docs/qemu-ga-ref.html docs/qemu-ga-ref.txt docs/qemu-ga-ref.7 96983eef5aSMeador Ingeifdef CONFIG_VIRTFS 97a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1 98983eef5aSMeador Ingeendif 99cc8ae6deSpbrookelse 100cc8ae6deSpbrookDOCS= 101cc8ae6deSpbrookendif 1027d13299dSbellard 103388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR) 1041f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS)) 10588070801SAndreas FärberSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS)) 1061f3d3c8fSJuan Quintela 1078bdd3d49SStefan Weilifeq ($(SUBDIR_DEVICES_MAK),) 1088bdd3d49SStefan Weilconfig-all-devices.mak: 1090bdb12c7SPeter Maydell $(call quiet-command,echo '# no devices' > $@,"GEN","$@") 1108bdd3d49SStefan Weilelse 1111f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK) 112bb585a78SPaolo Bonzini $(call quiet-command, sed -n \ 113bb585a78SPaolo Bonzini 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \ 114bb585a78SPaolo Bonzini $(SUBDIR_DEVICES_MAK) | sort -u > $@, \ 1150bdb12c7SPeter Maydell "GEN","$@") 1168bdd3d49SStefan Weilendif 1171f3d3c8fSJuan Quintela 118bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP) 119bd9141bbSPaul Brook 1200ab0c998SPaolo Bonzini%/config-devices.mak: default-configs/%.mak $(SRC_PATH)/scripts/make_device_config.sh 12115564d85SPaolo Bonzini $(call quiet-command, \ 1220bdb12c7SPeter Maydell $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp,"GEN","$@.tmp") 12312ccfec9SMichael S. Tsirkin $(call quiet-command, if test -f $@; then \ 124904fe1fbSBlue Swirl if cmp -s $@.old $@; then \ 125012f0879SStefan Weil mv $@.tmp $@; \ 126012f0879SStefan Weil cp -p $@ $@.old; \ 127012f0879SStefan Weil else \ 128012f0879SStefan Weil if test -f $@.old; then \ 129012f0879SStefan Weil echo "WARNING: $@ (user modified) out of date.";\ 130012f0879SStefan Weil else \ 131a992fe3dSPaul Brook echo "WARNING: $@ out of date.";\ 132012f0879SStefan Weil fi; \ 13363e86b2eSStefan Weil echo "Run \"make defconfig\" to regenerate."; \ 134a992fe3dSPaul Brook rm $@.tmp; \ 135012f0879SStefan Weil fi; \ 136a992fe3dSPaul Brook else \ 137a992fe3dSPaul Brook mv $@.tmp $@; \ 138012f0879SStefan Weil cp -p $@ $@.old; \ 1390bdb12c7SPeter Maydell fi,"GEN","$@"); 140a992fe3dSPaul Brook 141a992fe3dSPaul Brookdefconfig: 142a992fe3dSPaul Brook rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK) 143a992fe3dSPaul Brook 144992aeb8eSPaolo Bonziniifneq ($(wildcard config-host.mak),) 145992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/Makefile.objs 146ba1183daSFam Zhengendif 147ba1183daSFam Zheng 148ba1183daSFam Zhengdummy := $(call unnest-vars,, \ 149ba1183daSFam Zheng stub-obj-y \ 150ba1183daSFam Zheng util-obj-y \ 151ba1183daSFam Zheng qga-obj-y \ 152a75eb03bSDavid Marchand ivshmem-client-obj-y \ 153a75eb03bSDavid Marchand ivshmem-server-obj-y \ 1547b2e5c65SMarc-André Lureau libvhost-user-obj-y \ 155577a6723STomoki Sekiyama qga-vss-dll-obj-y \ 156ba1183daSFam Zheng block-obj-y \ 157cc475698SFam Zheng block-obj-m \ 158fb37726dSDaniel P. Berrange crypto-obj-y \ 159fb37726dSDaniel P. Berrange crypto-aes-obj-y \ 1600c7012e0SDaniel P. Berrange qom-obj-y \ 161666a3af9SDaniel P. Berrange io-obj-y \ 162cc475698SFam Zheng common-obj-y \ 163cc475698SFam Zheng common-obj-m) 164ba1183daSFam Zheng 165ba1183daSFam Zhengifneq ($(wildcard config-host.mak),) 16646e7b706SFam Zhenginclude $(SRC_PATH)/tests/Makefile.include 167992aeb8eSPaolo Bonziniendif 168992aeb8eSPaolo Bonzini 16917969268SFam Zhengall: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules 170b9dea4fbSpbrook 17167a1de0dSFam Zhengqemu-version.h: FORCE 17267a1de0dSFam Zheng $(call quiet-command, \ 17367a1de0dSFam Zheng (cd $(SRC_PATH); \ 17467a1de0dSFam Zheng printf '#define QEMU_PKGVERSION '; \ 17567a1de0dSFam Zheng if test -n "$(PKGVERSION)"; then \ 17667a1de0dSFam Zheng printf '"$(PKGVERSION)"\n'; \ 17767a1de0dSFam Zheng else \ 17867a1de0dSFam Zheng if test -d .git; then \ 17967a1de0dSFam Zheng printf '" ('; \ 18067a1de0dSFam Zheng git describe --match 'v*' 2>/dev/null | tr -d '\n'; \ 18167a1de0dSFam Zheng if ! git diff-index --quiet HEAD &>/dev/null; then \ 18267a1de0dSFam Zheng printf -- '-dirty'; \ 18367a1de0dSFam Zheng fi; \ 18467a1de0dSFam Zheng printf ')"\n'; \ 18567a1de0dSFam Zheng else \ 18667a1de0dSFam Zheng printf '""\n'; \ 18767a1de0dSFam Zheng fi; \ 18867a1de0dSFam Zheng fi) > $@.tmp) 189540aecd0SSean Bruno $(call quiet-command, cmp -s $@ $@.tmp || mv $@.tmp $@) 19067a1de0dSFam Zheng 1911215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp 1921215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak 193077de81aSPaolo Bonziniqemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool 1940bdb12c7SPeter Maydell $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") 1951215c6e7SJuan Quintela 196cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) 197916359f6SAndreas FärberSOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES)) 198916359f6SAndreas Färber 19957f45b62SStefan Weil$(SOFTMMU_SUBDIR_RULES): $(block-obj-y) 200fb37726dSDaniel P. Berrange$(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y) 201666a3af9SDaniel P. Berrange$(SOFTMMU_SUBDIR_RULES): $(io-obj-y) 202916359f6SAndreas Färber$(SOFTMMU_SUBDIR_RULES): config-all-devices.mak 203cec7d0b6Spbrook 2044115852bSPaolo Bonzinisubdir-%: 2050087375eSPaul Brook $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,) 2064aa42531Spbrook 207e2134eb9SGerd Hoffmannsubdir-pixman: pixman/Makefile 208e2134eb9SGerd Hoffmann $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,) 209e2134eb9SGerd Hoffmann 210e2134eb9SGerd Hoffmannpixman/Makefile: $(SRC_PATH)/pixman/configure 211f9943cd5SGerd Hoffmann (cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static) 212e2134eb9SGerd Hoffmann 213e2134eb9SGerd Hoffmann$(SRC_PATH)/pixman/configure: 214e2134eb9SGerd Hoffmann (cd $(SRC_PATH)/pixman; autoreconf -v --install) 215e2134eb9SGerd Hoffmann 216a540f158SPeter CrosthwaiteDTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt 217965f486cSPeter MaydellDTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS) 218965f486cSPeter MaydellDTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt 219a540f158SPeter Crosthwaite 220a540f158SPeter Crosthwaitesubdir-dtc:dtc/libfdt dtc/tests 221965f486cSPeter Maydell $(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,) 222a540f158SPeter Crosthwaite 223a540f158SPeter Crosthwaitedtc/%: 224a540f158SPeter Crosthwaite mkdir -p $@ 225a540f158SPeter Crosthwaite 22657f54629SDaniel P. Berrange$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) 227add16157SBlue Swirl 228c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) 229a9c87304SMarc-André Lureau# Only keep -O and -g cflags 230c05ac895SPaul Brookromsubdir-%: 231a9c87304SMarc-André Lureau $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/" CFLAGS="$(filter -O% -g%,$(CFLAGS))",) 232c05ac895SPaul Brook 233c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) 234c05ac895SPaul Brook 235c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) 2364aa42531Spbrook 237c17a18efSMarc-André Lureau$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h 2380bdb12c7SPeter Maydell $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o") 2395354e4d2SMarc-André Lureau 240c17a18efSMarc-André LureauMakefile: $(version-obj-y) 2413bc2f570SPaolo Bonzini 2423bc2f570SPaolo Bonzini###################################################################### 2438a090705SPaolo Bonzini# Build libraries 2443bc2f570SPaolo Bonzini 2453bc2f570SPaolo Bonzinilibqemustub.a: $(stub-obj-y) 246169a24aeSFam Zhenglibqemuutil.a: $(util-obj-y) 2473bc2f570SPaolo Bonzini 2484fb240a4Sbellard###################################################################### 2494fb240a4Sbellard 2503c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h 251153859beSStuart Brady 252064097d9SDaniel P. Berrangeqemu-img$(EXESUF): qemu-img.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a 253064097d9SDaniel P. Berrangeqemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a 254064097d9SDaniel P. Berrangeqemu-io$(EXESUF): qemu-io.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a 2550a8e1acdSaliguori 256a2d96af4SDaniel P. Berrangeqemu-bridge-helper$(EXESUF): qemu-bridge-helper.o libqemuutil.a libqemustub.a 2577b93fadfSCorey Bryant 2582209bd05SWei Liufsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o libqemuutil.a libqemustub.a 25917bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap 26017bff52bSM. Mohan Kumar 261077de81aSPaolo Bonziniqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool 2620bdb12c7SPeter Maydell $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") 263153859beSStuart Brady 264957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA) 26554c2e502SDunrong Huangqemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated 266640e5404SMichael Roth 26719bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@)) 2688d3bc517SAvi Kivity 2690521d375SStefan Hajnocziqapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py 27056e8bdd4SMarc-André Lureauqapi-py += $(SRC_PATH)/scripts/qapi2texi.py 2710521d375SStefan Hajnoczi 27254c2e502SDunrong Huangqga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ 2732870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) 2740a607749SLluís Vilanova $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ 27516d80f61SMarkus Armbruster $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ 2760bdb12c7SPeter Maydell "GEN","$@") 27754c2e502SDunrong Huangqga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\ 2782870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) 2790a607749SLluís Vilanova $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \ 28016d80f61SMarkus Armbruster $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ 2810bdb12c7SPeter Maydell "GEN","$@") 28254c2e502SDunrong Huangqga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\ 2832870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) 2840a607749SLluís Vilanova $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \ 28516d80f61SMarkus Armbruster $(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \ 2860bdb12c7SPeter Maydell "GEN","$@") 287e3d4d252SMichael Roth 288be13d46dSMax Reitzqapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ 289f668470fSWenchao Xia $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \ 29048befbc3SDaniel P. Berrange $(SRC_PATH)/qapi/event.json $(SRC_PATH)/qapi/introspect.json \ 291423aeaf2SLluís Vilanova $(SRC_PATH)/qapi/crypto.json $(SRC_PATH)/qapi/rocker.json \ 292423aeaf2SLluís Vilanova $(SRC_PATH)/qapi/trace.json 293be13d46dSMax Reitz 294599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\ 295be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) 2960a607749SLluís Vilanova $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \ 29716d80f61SMarkus Armbruster $(gen-out-type) -o "." -b $<, \ 2980bdb12c7SPeter Maydell "GEN","$@") 299599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\ 300be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) 3010a607749SLluís Vilanova $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \ 30216d80f61SMarkus Armbruster $(gen-out-type) -o "." -b $<, \ 3030bdb12c7SPeter Maydell "GEN","$@") 30421cd70dfSWenchao Xiaqapi-event.c qapi-event.h :\ 30521cd70dfSWenchao Xia$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py) 30621cd70dfSWenchao Xia $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \ 30716d80f61SMarkus Armbruster $(gen-out-type) -o "." $<, \ 3080bdb12c7SPeter Maydell "GEN","$@") 309599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\ 310be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) 3110a607749SLluís Vilanova $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \ 312c823501eSMarc-André Lureau $(gen-out-type) -o "." $<, \ 3130bdb12c7SPeter Maydell "GEN","$@") 31439a18158SMarkus Armbrusterqmp-introspect.h qmp-introspect.c :\ 31539a18158SMarkus Armbruster$(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py) 31639a18158SMarkus Armbruster $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \ 31739a18158SMarkus Armbruster $(gen-out-type) -o "." $<, \ 3180bdb12c7SPeter Maydell "GEN","$@") 319e3193601SAnthony Liguori 32054c2e502SDunrong HuangQGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) 3214115852bSPaolo Bonzini$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) 322957f1f99SMichael Roth 323fafcaf1dSMichael Rothqemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a 324fafcaf1dSMichael Roth $(call LINK, $^) 32548ff7a62SMichael Roth 3269dacf32dSYossi Hindinifdef QEMU_GA_MSI_ENABLED 3279dacf32dSYossi HindinQEMU_GA_MSI=qemu-ga-$(ARCH).msi 3289dacf32dSYossi Hindin 3290a18750fSLeonid Blochmsi: $(QEMU_GA_MSI) 3309dacf32dSYossi Hindin 331fafcaf1dSMichael Roth$(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER) 3329dacf32dSYossi Hindin 3339dacf32dSYossi Hindin$(QEMU_GA_MSI): config-host.mak 3349dacf32dSYossi Hindin 335decdfbd2SLeonid Bloch$(QEMU_GA_MSI): $(SRC_PATH)/qga/installer/qemu-ga.wxs 336decdfbd2SLeonid Bloch $(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)" \ 3370bdb12c7SPeter Maydell wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<,"WIXL","$@") 3389dacf32dSYossi Hindinelse 3399dacf32dSYossi Hindinmsi: 34015b19ed8SMichael Roth @echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)" 3419dacf32dSYossi Hindinendif 3429dacf32dSYossi Hindin 343fafcaf1dSMichael Rothifneq ($(EXESUF),) 344fafcaf1dSMichael Roth.PHONY: qemu-ga 345fafcaf1dSMichael Rothqemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI) 346fafcaf1dSMichael Rothendif 347fafcaf1dSMichael Roth 348a2d96af4SDaniel P. Berrangeivshmem-client$(EXESUF): $(ivshmem-client-obj-y) libqemuutil.a libqemustub.a 349a75eb03bSDavid Marchand $(call LINK, $^) 350a75eb03bSDavid Marchandivshmem-server$(EXESUF): $(ivshmem-server-obj-y) libqemuutil.a libqemustub.a 351a75eb03bSDavid Marchand $(call LINK, $^) 352a75eb03bSDavid Marchand 3530c0c1fd9SMarc Marimodule_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak 3540c0c1fd9SMarc Mari $(call quiet-command,$(PYTHON) $< $@ \ 3550c0c1fd9SMarc Mari $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \ 3560bdb12c7SPeter Maydell "GEN","$@") 3570c0c1fd9SMarc Mari 35831e31b8aSbellardclean: 3592d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files 36025be210fSJuan Quintela rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h 361df2943baSMichael S. Tsirkin rm -f qemu-options.def 3629dacf32dSYossi Hindin rm -f *.msi 363c17a18efSMarc-André Lureau find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} + 364b39297aeSTomoki Sekiyama rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~ 3658b6bfc77SStefan Weil rm -f fsdev/*.pod 36607b44ce9SBlue Swirl rm -f qemu-img-cmds.h 367d98bc0b6SGerd Hoffmann rm -f ui/shader/*-vert.h ui/shader/*-frag.h 36819ac36b5SLluís Vilanova @# May not be present in GENERATED_HEADERS 369eac236eaSLluís Vilanova rm -f trace/generated-tracers-dtrace.dtrace* 370eac236eaSLluís Vilanova rm -f trace/generated-tracers-dtrace.h* 37119ac36b5SLluís Vilanova rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp) 37219ac36b5SLluís Vilanova rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp) 3738f0e5c6bSStefan Weil rm -rf qapi-generated 37454c2e502SDunrong Huang rm -rf qga/qapi-generated 375781c0c33SStefan Hajnoczi for d in $(ALL_SUBDIRS); do \ 376fc8e320eSMagnus Damm if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \ 377df2943baSMichael S. Tsirkin rm -f $$d/qemu-options.def; \ 378626df76aSbellard done 379168340b6SPeter Maydell rm -f $(SUBDIR_DEVICES_MAK) config-all-devices.mak 38031e31b8aSbellard 38134bb443eSAnthony LiguoriVERSION ?= $(shell cat VERSION) 38234bb443eSAnthony Liguori 38334bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2 38434bb443eSAnthony Liguori 38534bb443eSAnthony Liguoriqemu-%.tar.bz2: 38634bb443eSAnthony Liguori $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)" 38734bb443eSAnthony Liguori 3887d13299dSbellarddistclean: clean 3892cd8af2dSPavel Butsykin 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 390ae219359SThomas Huth rm -f config-all-devices.mak config-all-disas.mak config.status 391ae219359SThomas Huth rm -f po/*.mo tests/qemu-iotests/common.env 392fc8e320eSMagnus Damm rm -f roms/seabios/config.mak roms/vgabios/config.mak 393bd3f5706SMarc-André Lureau rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps 3947a734b8fSBrad Hards rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys 3957a734b8fSBrad Hards rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp 396*d5e85105SPeter Maydell rm -f qemu-doc.vr qemu-doc.txt 397793553acSAlexandre Raymond rm -f config.log 39867ed96f9SPeter Maydell rm -f linux-headers/asm 39956e8bdd4SMarc-André Lureau rm -f qemu-ga-qapi.texi qemu-qapi.texi 40056e8bdd4SMarc-André Lureau rm -f docs/qemu-qmp-ref.7 docs/qemu-ga-ref.7 40156e8bdd4SMarc-André Lureau rm -f docs/qemu-qmp-ref.txt docs/qemu-ga-ref.txt 40256e8bdd4SMarc-André Lureau rm -f docs/qemu-qmp-ref.pdf docs/qemu-ga-ref.pdf 40356e8bdd4SMarc-André Lureau rm -f docs/qemu-qmp-ref.html docs/qemu-ga-ref.html 4048e98e2e8SPaolo Bonzini for d in $(TARGET_DIRS); do \ 405bc1b050dSbellard rm -rf $$d || exit 1 ; \ 40676bc6838Sbellard done 407d9840e25STomoki Sekiyama rm -Rf .sdk 408fb8597bbSEd Maste if test -f pixman/config.log; then $(MAKE) -C pixman distclean; fi 409fb8597bbSEd Maste if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi 4107d13299dSbellard 411fed4a9adSbellardKEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \ 412fed4a9adSbellardar de en-us fi fr-be hr it lv nl pl ru th \ 413471fbf4aSFrédéric Boiteuxcommon de-ch es fo fr-ca hu ja mk nl-be pt sl tr \ 4143751e722SJan Krupabepo cz 415fed4a9adSbellard 41677755340Sthsifdef INSTALL_BLOBS 4173b1154ffSGerd HoffmannBLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \ 4187a4dfd1eSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \ 41975fb3d28SEduardo Habkostacpi-dsdt.aml \ 4209eb08a43SMark Cave-Aylandppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \ 4215ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \ 4225ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \ 4239fd02979SSander Eikelenboomefi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \ 4249fd02979SSander Eikelenboomefi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \ 42545027808SGerd Hoffmannefi-e1000e.rom efi-vmxnet3.rom \ 426f7da9c17SAnthony Liguoriqemu-icon.bmp qemu_logo_no_text.svg \ 42700914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ 428b2a575a1SMarc Marímultiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin \ 4290c1fecddSAlexander Grafs390-ccw.img \ 430bcad45deSCédric Le Goaterspapr-rtas.bin slof.bin skiboot.lid \ 4310c6ab8c9SCole Robinsonpalcode-clipper \ 4320c6ab8c9SCole Robinsonu-boot.e500 43377755340Sthselse 43477755340SthsBLOBS= 43577755340Sthsendif 43677755340Sths 43738954dcaSpbrookinstall-doc: $(DOCS) 438d7dd65baSEduardo Habkost $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" 43978e87797SPaolo Bonzini $(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)" 440f8bab10bSMarc-André Lureau $(INSTALL_DATA) qemu-doc.txt "$(DESTDIR)$(qemu_docdir)" 44156e8bdd4SMarc-André Lureau $(INSTALL_DATA) docs/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)" 44256e8bdd4SMarc-André Lureau $(INSTALL_DATA) docs/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)" 44396d409ebSJuan Quintelaifdef CONFIG_POSIX 44458f8aeadSaliguori $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" 4458a3e8f7fSAndreas Färber $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" 44656e8bdd4SMarc-André Lureau $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7" 44756e8bdd4SMarc-André Lureau $(INSTALL_DATA) docs/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" 4488a3e8f7fSAndreas Färberifneq ($(TOOLS),) 4498a3e8f7fSAndreas Färber $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1" 45058f8aeadSaliguori $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" 45158f8aeadSaliguori $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" 45238954dcaSpbrookendif 453665b5d0dSMarc-André Lureauifneq (,$(findstring qemu-ga,$(TOOLS))) 454665b5d0dSMarc-André Lureau $(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8" 45556e8bdd4SMarc-André Lureau $(INSTALL_DATA) docs/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)" 45656e8bdd4SMarc-André Lureau $(INSTALL_DATA) docs/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)" 45756e8bdd4SMarc-André Lureau $(INSTALL_DATA) docs/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7" 458665b5d0dSMarc-André Lureauendif 4598a3e8f7fSAndreas Färberendif 460a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS 461a2d8f1beSM. Mohan Kumar $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" 462a2d8f1beSM. Mohan Kumar $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" 463a2d8f1beSM. Mohan Kumarendif 464b5ec5ce0Sjohn cooper 465e2d87bffSEduardo Habkostinstall-datadir: 466e2d87bffSEduardo Habkost $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" 467e2d87bffSEduardo Habkost 468f2e3978bSLaszlo Ersekinstall-localstatedir: 469f2e3978bSLaszlo Ersekifdef CONFIG_POSIX 470f2e3978bSLaszlo Ersekifneq (,$(findstring qemu-ga,$(TOOLS))) 471f2e3978bSLaszlo Ersek $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run 472f2e3978bSLaszlo Ersekendif 473f2e3978bSLaszlo Ersekendif 474f2e3978bSLaszlo Ersek 475e2d87bffSEduardo Habkost 4761b93c9a1SIkey Dohertyinstall: all $(if $(BUILD_DOCS),install-doc) \ 477f2e3978bSLaszlo Ersekinstall-datadir install-localstatedir 478932a79dfSthsifneq ($(TOOLS),) 47968aa262aSMichael Roth $(call install-prog,$(subst qemu-ga,qemu-ga$(EXESUF),$(TOOLS)),$(DESTDIR)$(bindir)) 480932a79dfSthsendif 481e3be6f0eSFam Zhengifneq ($(CONFIG_MODULES),) 482e3be6f0eSFam Zheng $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)" 4832115182fSMichael Tokarev for s in $(modules-m:.mo=$(DSOSUF)); do \ 4842115182fSMichael Tokarev t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \ 485264f8b4fSMichael Tokarev $(INSTALL_LIB) $$s "$$t"; \ 4862115182fSMichael Tokarev test -z "$(STRIP)" || $(STRIP) "$$t"; \ 487e3be6f0eSFam Zheng done 488e3be6f0eSFam Zhengendif 4897b93fadfSCorey Bryantifneq ($(HELPERS-y),) 4900d659426SMichael Tokarev $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir)) 4917b93fadfSCorey Bryantendif 49277755340Sthsifneq ($(BLOBS),) 49377755340Sths set -e; for x in $(BLOBS); do \ 4946aae2a2eSEduardo Habkost $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ 495ad064840Spbrook done 49677755340Sthsendif 497834574eaSAnthony Liguoriifeq ($(CONFIG_GTK),y) 498834574eaSAnthony Liguori $(MAKE) -C po $@ 499834574eaSAnthony Liguoriendif 5006aae2a2eSEduardo Habkost $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" 50118be8d77Sblueswir1 set -e; for x in $(KEYMAPS); do \ 5026aae2a2eSEduardo Habkost $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ 503ad064840Spbrook done 5041412cf58SDaniel P. Berrange $(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all" 505626df76aSbellard for d in $(TARGET_DIRS); do \ 5066570025eSLluís Vilanova $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \ 507626df76aSbellard done 508612384d7Sbellard 509367e86e8Sbellard# various test targets 5109b0b8203Sbellardtest speed: all 511c09015ddSAnthony Liguori $(MAKE) -C tests/tcg $@ 51231e31b8aSbellard 513ae5fdc81SFam Zheng.PHONY: ctags 514ae5fdc81SFam Zhengctags: 515ac99c624SSergey Fedorov rm -f tags 516ae5fdc81SFam Zheng find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} + 517ae5fdc81SFam Zheng 51821d4e8e3SAlexandre Bique.PHONY: TAGS 519367e86e8SbellardTAGS: 520ac99c624SSergey Fedorov rm -f TAGS 521b1999e87SDavid Gibson find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} + 52231e31b8aSbellard 5236688bc6dSbellardcscope: 524eaa2ddbbSFam Zheng rm -f "$(SRC_PATH)"/cscope.* 525eaa2ddbbSFam Zheng find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files" 526eaa2ddbbSFam Zheng cscope -b -i"$(SRC_PATH)/cscope.files" 5276688bc6dSbellard 528d98bc0b6SGerd Hoffmann# opengl shader programs 529d98bc0b6SGerd Hoffmannui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl 530d98bc0b6SGerd Hoffmann @mkdir -p $(dir $@) 531d98bc0b6SGerd Hoffmann $(call quiet-command,\ 532d98bc0b6SGerd Hoffmann perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\ 5330bdb12c7SPeter Maydell "VERT","$@") 534d98bc0b6SGerd Hoffmann 535d98bc0b6SGerd Hoffmannui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl 536d98bc0b6SGerd Hoffmann @mkdir -p $(dir $@) 537d98bc0b6SGerd Hoffmann $(call quiet-command,\ 538d98bc0b6SGerd Hoffmann perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\ 5390bdb12c7SPeter Maydell "FRAG","$@") 540d98bc0b6SGerd Hoffmann 541cd2bc889SGerd Hoffmannui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \ 542cd2bc889SGerd Hoffmann ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h 543cd2bc889SGerd Hoffmann 5443ef693a0Sbellard# documentation 54556e8bdd4SMarc-André LureauMAKEINFO=makeinfo -D 'VERSION $(VERSION)' 546e9ee06bdSMarc-André LureauMAKEINFOFLAGS=--no-split --number-sections 54756e8bdd4SMarc-André LureauTEXIFLAG=$(if $(V),,--quiet) --command='@set VERSION $(VERSION)' 54856e8bdd4SMarc-André Lureau 5491f673135Sbellard%.html: %.texi 550e9ee06bdSMarc-André Lureau $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \ 551e9ee06bdSMarc-André Lureau --html $< -o $@,"GEN","$@") 5523ef693a0Sbellard 553f3548328Sbellard%.info: %.texi 554e9ee06bdSMarc-André Lureau $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@") 555f3548328Sbellard 556f8bab10bSMarc-André Lureau%.txt: %.texi 557f8bab10bSMarc-André Lureau $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \ 558f8bab10bSMarc-André Lureau --plaintext $< -o $@,"GEN","$@") 559f8bab10bSMarc-André Lureau 56020cc9997SStefan Weil%.pdf: %.texi 56156e8bdd4SMarc-André Lureau $(call quiet-command,texi2pdf $(TEXIFLAG) -I $(SRC_PATH) -I . $< -o $@,"GEN","$@") 5625824d651Sblueswir1 563077de81aSPaolo Bonziniqemu-options.texi: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool 5640bdb12c7SPeter Maydell $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") 565f3548328Sbellard 566077de81aSPaolo Bonziniqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool 5670bdb12c7SPeter Maydell $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") 5682313086aSBlue Swirl 569077de81aSPaolo Bonziniqemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool 5700bdb12c7SPeter Maydell $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") 5712cd8af2dSPavel Butsykin 572077de81aSPaolo Bonziniqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool 5730bdb12c7SPeter Maydell $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") 574153859beSStuart Brady 57556e8bdd4SMarc-André Lureauqemu-qapi.texi: $(qapi-modules) $(qapi-py) 57656e8bdd4SMarc-André Lureau $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN" "$@") 57756e8bdd4SMarc-André Lureau 57856e8bdd4SMarc-André Lureauqemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) 57956e8bdd4SMarc-André Lureau $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@") 58056e8bdd4SMarc-André Lureau 5812cd8af2dSPavel Butsykinqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi 582eeb2b8f7SDenis V. Lunevqemu.1: qemu-option-trace.texi 58306a1e0c1SDenis V. Lunevqemu-img.1: qemu-img.texi qemu-option-trace.texi qemu-img-cmds.texi 584a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi 58539ca463eSDenis V. Lunevqemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi 586665b5d0dSMarc-André Lureauqemu-ga.8: qemu-ga.texi 587665b5d0dSMarc-André Lureau 58856e8bdd4SMarc-André Lureauhtml: qemu-doc.html docs/qemu-qmp-ref.html docs/qemu-ga-ref.html 58956e8bdd4SMarc-André Lureauinfo: qemu-doc.info docs/qemu-qmp-ref.info docs/qemu-ga-ref.info 59056e8bdd4SMarc-André Lureaupdf: qemu-doc.pdf docs/qemu-qmp-ref.pdf docs/qemu-ga-ref.pdf 59156e8bdd4SMarc-André Lureautxt: qemu-doc.txt docs/qemu-qmp-ref.txt docs/qemu-ga-ref.txt 5920cb3fb1eSpbrook 593*d5e85105SPeter Maydellqemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ 594eeb2b8f7SDenis V. Lunev qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ 5952cd8af2dSPavel Butsykin qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ 5962cd8af2dSPavel Butsykin qemu-monitor-info.texi 597818220f5Saliguori 59856e8bdd4SMarc-André Lureaudocs/qemu-ga-ref.dvi docs/qemu-ga-ref.html docs/qemu-ga-ref.info docs/qemu-ga-ref.pdf docs/qemu-ga-ref.txt docs/qemu-ga-ref.7: \ 59956e8bdd4SMarc-André Lureaudocs/qemu-ga-ref.texi qemu-ga-qapi.texi 60056e8bdd4SMarc-André Lureau 60156e8bdd4SMarc-André Lureaudocs/qemu-qmp-ref.dvi docs/qemu-qmp-ref.html docs/qemu-qmp-ref.info docs/qemu-qmp-ref.pdf docs/qemu-qmp-ref.txt docs/qemu-qmp-ref.7: \ 60256e8bdd4SMarc-André Lureaudocs/qemu-qmp-ref.texi qemu-qapi.texi 60356e8bdd4SMarc-André Lureau 60456e8bdd4SMarc-André Lureau 605f53ec699SStefan Weilifdef CONFIG_WIN32 606f53ec699SStefan Weil 607f53ec699SStefan WeilINSTALLER = qemu-setup-$(VERSION)$(EXESUF) 608f53ec699SStefan Weil 609f53ec699SStefan Weilnsisflags = -V2 -NOCD 610f53ec699SStefan Weil 611f53ec699SStefan Weilifneq ($(wildcard $(SRC_PATH)/dll),) 612f53ec699SStefan Weilifeq ($(ARCH),x86_64) 613f53ec699SStefan Weil# 64 bit executables 614f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w64 615f53ec699SStefan Weilnsisflags += -DW64 616f53ec699SStefan Weilelse 617f53ec699SStefan Weil# 32 bit executables 618f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w32 619f53ec699SStefan Weilendif 620f53ec699SStefan Weilendif 621f53ec699SStefan Weil 622f53ec699SStefan Weil.PHONY: installer 623f53ec699SStefan Weilinstaller: $(INSTALLER) 624f53ec699SStefan Weil 625f53ec699SStefan WeilINSTDIR=/tmp/qemu-nsis 626f53ec699SStefan Weil 627f53ec699SStefan Weil$(INSTALLER): $(SRC_PATH)/qemu.nsi 628fb8597bbSEd Maste $(MAKE) install prefix=${INSTDIR} 629f53ec699SStefan Weilifdef SIGNCODE 630f53ec699SStefan Weil (cd ${INSTDIR}; \ 631f53ec699SStefan Weil for i in *.exe; do \ 632f53ec699SStefan Weil $(SIGNCODE) $${i}; \ 633f53ec699SStefan Weil done \ 634f53ec699SStefan Weil ) 635f53ec699SStefan Weilendif # SIGNCODE 636f53ec699SStefan Weil (cd ${INSTDIR}; \ 637f53ec699SStefan Weil for i in qemu-system-*.exe; do \ 638f53ec699SStefan Weil arch=$${i%.exe}; \ 639f53ec699SStefan Weil arch=$${arch#qemu-system-}; \ 640f53ec699SStefan Weil echo Section \"$$arch\" Section_$$arch; \ 641f53ec699SStefan Weil echo SetOutPath \"\$$INSTDIR\"; \ 642f53ec699SStefan Weil echo File \"\$${BINDIR}\\$$i\"; \ 643f53ec699SStefan Weil echo SectionEnd; \ 644f53ec699SStefan Weil done \ 645f53ec699SStefan Weil ) >${INSTDIR}/system-emulations.nsh 646f53ec699SStefan Weil makensis $(nsisflags) \ 647f53ec699SStefan Weil $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \ 648f53ec699SStefan Weil $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \ 649f53ec699SStefan Weil -DBINDIR="${INSTDIR}" \ 650f53ec699SStefan Weil $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \ 651f53ec699SStefan Weil -DSRCDIR="$(SRC_PATH)" \ 652f53ec699SStefan Weil -DOUTFILE="$(INSTALLER)" \ 653805d8a67SStefan Weil -DDISPLAYVERSION="$(VERSION)" \ 654f53ec699SStefan Weil $(SRC_PATH)/qemu.nsi 655f53ec699SStefan Weil rm -r ${INSTDIR} 656f53ec699SStefan Weilifdef SIGNCODE 657f53ec699SStefan Weil $(SIGNCODE) $(INSTALLER) 658f53ec699SStefan Weilendif # SIGNCODE 659f53ec699SStefan Weilendif # CONFIG_WIN 660f53ec699SStefan Weil 661cb5fc67dSAnthony Liguori# Add a dependency on the generated files, so that they are always 662cb5fc67dSAnthony Liguori# rebuilt before other object files 663eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) 664cb5fc67dSAnthony LiguoriMakefile: $(GENERATED_HEADERS) 6657748b8cbSMike Frysingerendif 666cb5fc67dSAnthony Liguori 6674fb240a4Sbellard# Include automatically generated dependency files 6681435ddb8SPaolo Bonzini# Dependencies in Makefile.objs files come from our recursive subdir rules 6691435ddb8SPaolo Bonzini-include $(wildcard *.d tests/*.d) 670324027c2SFam Zheng 671324027c2SFam Zhenginclude $(SRC_PATH)/tests/docker/Makefile.include 6720d8e065fSMarc-André Lureau 6730d8e065fSMarc-André Lureau.PHONY: help 6740d8e065fSMarc-André Lureauhelp: 6750d8e065fSMarc-André Lureau @echo 'Generic targets:' 6760d8e065fSMarc-André Lureau @echo ' all - Build all' 6770d8e065fSMarc-André Lureau @echo ' dir/file.o - Build specified target only' 6780d8e065fSMarc-André Lureau @echo ' install - Install QEMU, documentation and tools' 6790d8e065fSMarc-André Lureau @echo ' ctags/TAGS - Generate tags file for editors' 6800d8e065fSMarc-André Lureau @echo ' cscope - Generate cscope index' 6810d8e065fSMarc-André Lureau @echo '' 6820d8e065fSMarc-André Lureau @$(if $(TARGET_DIRS), \ 6830d8e065fSMarc-André Lureau echo 'Architecture specific targets:'; \ 6840d8e065fSMarc-André Lureau $(foreach t, $(TARGET_DIRS), \ 6850d8e065fSMarc-André Lureau printf " %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \ 6860d8e065fSMarc-André Lureau echo '') 6870d8e065fSMarc-André Lureau @echo 'Cleaning targets:' 6880d8e065fSMarc-André Lureau @echo ' clean - Remove most generated files but keep the config' 6890d8e065fSMarc-André Lureau @echo ' distclean - Remove all generated files' 6900d8e065fSMarc-André Lureau @echo ' dist - Build a distributable tarball' 6910d8e065fSMarc-André Lureau @echo '' 6920d8e065fSMarc-André Lureau @echo 'Test targets:' 6930d8e065fSMarc-André Lureau @echo ' check - Run all tests (check-help for details)' 6940d8e065fSMarc-André Lureau @echo ' docker - Help about targets running tests inside Docker containers' 6950d8e065fSMarc-André Lureau @echo '' 6960d8e065fSMarc-André Lureau @echo 'Documentation targets:' 697f8bab10bSMarc-André Lureau @echo ' html info pdf txt' 6980d8e065fSMarc-André Lureau @echo ' - Build documentation in specified format' 6990d8e065fSMarc-André Lureau @echo '' 7000d8e065fSMarc-André Lureauifdef CONFIG_WIN32 7010d8e065fSMarc-André Lureau @echo 'Windows targets:' 7026bd67f89SStefan Weil @echo ' installer - Build NSIS-based installer for QEMU' 7030d8e065fSMarc-André Lureauifdef QEMU_GA_MSI_ENABLED 7040d8e065fSMarc-André Lureau @echo ' msi - Build MSI-based installer for qemu-ga' 7050d8e065fSMarc-André Lureauendif 7060d8e065fSMarc-André Lureau @echo '' 7070d8e065fSMarc-André Lureauendif 7080d8e065fSMarc-André Lureau @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' 709