xref: /openbmc/qemu/Makefile (revision ae5fdc81)
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
9*ae5fdc81SFam ZhengUNCHECKED_GOALS := %clean TAGS cscope ctags
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
3317759187Saliguoriinclude $(SRC_PATH)/rules.mak
3459bc10eeSPaolo Bonziniconfig-host.mak: $(SRC_PATH)/configure
35e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
36bdf523e6SStefan Weil	@# TODO: The next lines include code which supports a smooth
37bdf523e6SStefan Weil	@# transition from old configurations without config.status.
38bdf523e6SStefan Weil	@# This code can be removed after QEMU 1.7.
39bdf523e6SStefan Weil	@if test -x config.status; then \
40bdf523e6SStefan Weil	    ./config.status; \
41bdf523e6SStefan Weil        else \
42bdf523e6SStefan Weil	    sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh; \
43bdf523e6SStefan Weil	fi
4455d7e8f6Saurel32else
4555d7e8f6Saurel32config-host.mak:
46eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
4755d7e8f6Saurel32	@echo "Please call configure before running make!"
4855d7e8f6Saurel32	@exit 1
4955d7e8f6Saurel32endif
507748b8cbSMike Frysingerendif
51766a487aSbellard
52eac236eaSLluís VilanovaGENERATED_HEADERS = config-host.h qemu-options.def
5321cd70dfSWenchao XiaGENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
5421cd70dfSWenchao XiaGENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
55eac236eaSLluís Vilanova
5645be2f5dSLluís VilanovaGENERATED_HEADERS += trace/generated-events.h
5745be2f5dSLluís VilanovaGENERATED_SOURCES += trace/generated-events.c
5845be2f5dSLluí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
76d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
77d9ace8b3SJuan Quintela# We don't generate any of them
78d9ace8b3SJuan QuintelaMakefile: ;
79d9ace8b3SJuan Quintelaconfigure: ;
80d9ace8b3SJuan Quintela
81818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
829dacf32dSYossi Hindin	pdf recurse-all speed test dist msi
830cb3fb1eSpbrook
84fec90ff0SPaolo Bonzini$(call set-vpath, $(SRC_PATH))
858c462f8fSpbrook
863e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
8767c0f08dSJuan Quintela
887b93fadfSCorey BryantHELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
897b93fadfSCorey Bryant
90cc8ae6deSpbrookifdef BUILD_DOCS
91d076a2adSLuiz CapitulinoDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
92811c5727SStefan Hajnocziifdef CONFIG_LINUX
93811c5727SStefan HajnocziDOCS+=kvm_stat.1
94811c5727SStefan Hajnocziendif
95983eef5aSMeador Ingeifdef CONFIG_VIRTFS
96a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1
97983eef5aSMeador Ingeendif
98cc8ae6deSpbrookelse
99cc8ae6deSpbrookDOCS=
100cc8ae6deSpbrookendif
1017d13299dSbellard
102388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
1031f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
10488070801SAndreas FärberSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
1051f3d3c8fSJuan Quintela
1068bdd3d49SStefan Weilifeq ($(SUBDIR_DEVICES_MAK),)
1078bdd3d49SStefan Weilconfig-all-devices.mak:
1088bdd3d49SStefan Weil	$(call quiet-command,echo '# no devices' > $@,"  GEN   $@")
1098bdd3d49SStefan Weilelse
1101f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
111bb585a78SPaolo Bonzini	$(call quiet-command, sed -n \
112bb585a78SPaolo Bonzini             's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
113bb585a78SPaolo Bonzini             $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
114bb585a78SPaolo Bonzini             "  GEN   $@")
1158bdd3d49SStefan Weilendif
1161f3d3c8fSJuan Quintela
117bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
118bd9141bbSPaul Brook
119a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
12015564d85SPaolo Bonzini	$(call quiet-command, \
12115564d85SPaolo Bonzini            $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp, "  GEN   $@.tmp")
12212ccfec9SMichael S. Tsirkin	$(call quiet-command, if test -f $@; then \
123904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
124012f0879SStefan Weil	    mv $@.tmp $@; \
125012f0879SStefan Weil	    cp -p $@ $@.old; \
126012f0879SStefan Weil	  else \
127012f0879SStefan Weil	    if test -f $@.old; then \
128012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
129012f0879SStefan Weil	    else \
130a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
131012f0879SStefan Weil	    fi; \
13263e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
133a992fe3dSPaul Brook	    rm $@.tmp; \
134012f0879SStefan Weil	  fi; \
135a992fe3dSPaul Brook	 else \
136a992fe3dSPaul Brook	  mv $@.tmp $@; \
137012f0879SStefan Weil	  cp -p $@ $@.old; \
13812ccfec9SMichael S. Tsirkin	 fi, "  GEN  $@");
139a992fe3dSPaul Brook
140a992fe3dSPaul Brookdefconfig:
141a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
142a992fe3dSPaul Brook
143992aeb8eSPaolo Bonziniifneq ($(wildcard config-host.mak),)
144992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/Makefile.objs
145ba1183daSFam Zhengendif
146ba1183daSFam Zheng
147ba1183daSFam Zhengdummy := $(call unnest-vars,, \
148ba1183daSFam Zheng                stub-obj-y \
149ba1183daSFam Zheng                util-obj-y \
150ba1183daSFam Zheng                qga-obj-y \
151577a6723STomoki Sekiyama                qga-vss-dll-obj-y \
152ba1183daSFam Zheng                block-obj-y \
153cc475698SFam Zheng                block-obj-m \
154cc475698SFam Zheng                common-obj-y \
155cc475698SFam Zheng                common-obj-m)
156ba1183daSFam Zheng
157ba1183daSFam Zhengifneq ($(wildcard config-host.mak),)
158992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/tests/Makefile
159992aeb8eSPaolo Bonziniendif
160992aeb8eSPaolo Bonziniifeq ($(CONFIG_SMARTCARD_NSS),y)
161992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/libcacard/Makefile
162992aeb8eSPaolo Bonziniendif
163992aeb8eSPaolo Bonzini
16417969268SFam Zhengall: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
165b9dea4fbSpbrook
1661215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
1671215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
168e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
1694c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
1701215c6e7SJuan Quintela
171cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
172916359f6SAndreas FärberSOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
173916359f6SAndreas Färber
17457f45b62SStefan Weil$(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
175916359f6SAndreas Färber$(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
176cec7d0b6Spbrook
1774115852bSPaolo Bonzinisubdir-%:
1780087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
1794aa42531Spbrook
180e2134eb9SGerd Hoffmannsubdir-pixman: pixman/Makefile
181e2134eb9SGerd Hoffmann	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
182e2134eb9SGerd Hoffmann
183e2134eb9SGerd Hoffmannpixman/Makefile: $(SRC_PATH)/pixman/configure
184f9943cd5SGerd Hoffmann	(cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
185e2134eb9SGerd Hoffmann
186e2134eb9SGerd Hoffmann$(SRC_PATH)/pixman/configure:
187e2134eb9SGerd Hoffmann	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
188e2134eb9SGerd Hoffmann
189a540f158SPeter CrosthwaiteDTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
190965f486cSPeter MaydellDTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
191965f486cSPeter MaydellDTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
192a540f158SPeter Crosthwaite
193a540f158SPeter Crosthwaitesubdir-dtc:dtc/libfdt dtc/tests
194965f486cSPeter 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,)
195a540f158SPeter Crosthwaite
196a540f158SPeter Crosthwaitedtc/%:
197a540f158SPeter Crosthwaite	mkdir -p $@
198a540f158SPeter Crosthwaite
19982cb6b04SPaolo Bonzini$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
200add16157SBlue Swirl
201c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
202c05ac895SPaul Brookromsubdir-%:
203c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
204c05ac895SPaul Brook
205c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
206c05ac895SPaul Brook
207c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
2084aa42531Spbrook
20923cab7b7SVasily Efimov$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h | $(BUILD_DIR)/version.lo
2107e75e33eSStefan Weil	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
21123cab7b7SVasily Efimov$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc config-host.h
2127e75e33eSStefan Weil	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.lo")
2135354e4d2SMarc-André Lureau
214fba90ac1SPaolo BonziniMakefile: $(version-obj-y) $(version-lobj-y)
2153bc2f570SPaolo Bonzini
2163bc2f570SPaolo Bonzini######################################################################
2178a090705SPaolo Bonzini# Build libraries
2183bc2f570SPaolo Bonzini
2193bc2f570SPaolo Bonzinilibqemustub.a: $(stub-obj-y)
220169a24aeSFam Zhenglibqemuutil.a: $(util-obj-y)
2213bc2f570SPaolo Bonzini
222e26110cfSFam Zhengblock-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
223e26110cfSFam Zhengutil/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
224e26110cfSFam Zheng
2254fb240a4Sbellard######################################################################
2264fb240a4Sbellard
2273c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
228153859beSStuart Brady
229ff667e2eSPaolo Bonziniqemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
230ff667e2eSPaolo Bonziniqemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
231587da2c3SKevin Wolfqemu-io$(EXESUF): qemu-io.o $(block-obj-y) libqemuutil.a libqemustub.a
2320a8e1acdSaliguori
2337b93fadfSCorey Bryantqemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
2347b93fadfSCorey Bryant
235ff667e2eSPaolo Bonzinifsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a
23617bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
23717bff52bSM. Mohan Kumar
238153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
2394c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
240153859beSStuart Brady
241957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
24254c2e502SDunrong Huangqemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
243640e5404SMichael Roth
24419bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@))
2458d3bc517SAvi Kivity
2460521d375SStefan Hajnocziqapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
2470521d375SStefan Hajnoczi
24854c2e502SDunrong Huangqga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
2492870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
2500a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
25116d80f61SMarkus Armbruster		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
2520a607749SLluís Vilanova		"  GEN   $@")
25354c2e502SDunrong Huangqga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
2542870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
2550a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
25616d80f61SMarkus Armbruster		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
2570a607749SLluís Vilanova		"  GEN   $@")
25854c2e502SDunrong Huangqga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
2592870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
2600a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
26116d80f61SMarkus Armbruster		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
2620a607749SLluís Vilanova		"  GEN   $@")
263e3d4d252SMichael Roth
264be13d46dSMax Reitzqapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
265f668470fSWenchao Xia               $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
26682d72d9dSWenchao Xia               $(SRC_PATH)/qapi/event.json
267be13d46dSMax Reitz
268599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\
269be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
2700a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
27116d80f61SMarkus Armbruster		$(gen-out-type) -o "." -b $<, \
2720a607749SLluís Vilanova		"  GEN   $@")
273599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\
274be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
2750a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
27616d80f61SMarkus Armbruster		$(gen-out-type) -o "." -b $<, \
2770a607749SLluís Vilanova		"  GEN   $@")
27821cd70dfSWenchao Xiaqapi-event.c qapi-event.h :\
27921cd70dfSWenchao Xia$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
28021cd70dfSWenchao Xia	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
28116d80f61SMarkus Armbruster		$(gen-out-type) -o "." $<, \
28221cd70dfSWenchao Xia		"  GEN   $@")
283599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\
284be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
2850a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
28616d80f61SMarkus Armbruster		$(gen-out-type) -o "." -m $<, \
2870a607749SLluís Vilanova		"  GEN   $@")
288e3193601SAnthony Liguori
28954c2e502SDunrong HuangQGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
2904115852bSPaolo Bonzini$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
291957f1f99SMichael Roth
292ff667e2eSPaolo Bonziniqemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
2932870dc34SPaolo Bonzini	$(call LINK, $^)
29448ff7a62SMichael Roth
2959dacf32dSYossi Hindinifdef QEMU_GA_MSI_ENABLED
2969dacf32dSYossi HindinQEMU_GA_MSI=qemu-ga-$(ARCH).msi
2979dacf32dSYossi Hindin
2989dacf32dSYossi Hindinmsi: ${QEMU_GA_MSI}
2999dacf32dSYossi Hindin
3009dacf32dSYossi Hindin$(QEMU_GA_MSI): qemu-ga.exe
3019dacf32dSYossi Hindin
3029dacf32dSYossi Hindinifdef QEMU_GA_MSI_WITH_VSS
3039dacf32dSYossi Hindin$(QEMU_GA_MSI): qga/vss-win32/qga-vss.dll
3049dacf32dSYossi Hindinendif
3059dacf32dSYossi Hindin
3069dacf32dSYossi Hindin$(QEMU_GA_MSI): config-host.mak
3079dacf32dSYossi Hindin
3089dacf32dSYossi Hindin$(QEMU_GA_MSI):  qga/installer/qemu-ga.wxs
3099dacf32dSYossi Hindin	$(call quiet-command,QEMU_GA_VERSION="$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER="$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO="$(QEMU_GA_DISTRO)" \
3109dacf32dSYossi Hindin	wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<, "  WIXL  $@")
3119dacf32dSYossi Hindinelse
3129dacf32dSYossi Hindinmsi:
3139dacf32dSYossi Hindin	@echo MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)
3149dacf32dSYossi Hindinendif
3159dacf32dSYossi Hindin
31631e31b8aSbellardclean:
3172d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
31825be210fSJuan 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
319df2943baSMichael S. Tsirkin	rm -f qemu-options.def
3209dacf32dSYossi Hindin	rm -f *.msi
321f4b11eeeSFam Zheng	find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
322b39297aeSTomoki Sekiyama	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
3238b6bfc77SStefan Weil	rm -f fsdev/*.pod
3248b6bfc77SStefan Weil	rm -rf .libs */.libs
32507b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
326d98bc0b6SGerd Hoffmann	rm -f ui/shader/*-vert.h ui/shader/*-frag.h
32719ac36b5SLluís Vilanova	@# May not be present in GENERATED_HEADERS
328eac236eaSLluís Vilanova	rm -f trace/generated-tracers-dtrace.dtrace*
329eac236eaSLluís Vilanova	rm -f trace/generated-tracers-dtrace.h*
33019ac36b5SLluís Vilanova	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
33119ac36b5SLluís Vilanova	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
3328f0e5c6bSStefan Weil	rm -rf qapi-generated
33354c2e502SDunrong Huang	rm -rf qga/qapi-generated
334781c0c33SStefan Hajnoczi	for d in $(ALL_SUBDIRS); do \
335fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
336df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
337626df76aSbellard        done
33831e31b8aSbellard
33934bb443eSAnthony LiguoriVERSION ?= $(shell cat VERSION)
34034bb443eSAnthony Liguori
34134bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2
34234bb443eSAnthony Liguori
34334bb443eSAnthony Liguoriqemu-%.tar.bz2:
34434bb443eSAnthony Liguori	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
34534bb443eSAnthony Liguori
3467d13299dSbellarddistclean: clean
347fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
348ae219359SThomas Huth	rm -f config-all-devices.mak config-all-disas.mak config.status
349ae219359SThomas Huth	rm -f po/*.mo tests/qemu-iotests/common.env
350fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
3517a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
3527a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
3537a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
3547a734b8fSBrad Hards	rm -f qemu-doc.vr
355793553acSAlexandre Raymond	rm -f config.log
35667ed96f9SPeter Maydell	rm -f linux-headers/asm
357e1a068b2SHidetoshi Seto	rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
3588e98e2e8SPaolo Bonzini	for d in $(TARGET_DIRS); do \
359bc1b050dSbellard	rm -rf $$d || exit 1 ; \
36076bc6838Sbellard        done
361d9840e25STomoki Sekiyama	rm -Rf .sdk
362fb8597bbSEd Maste	if test -f pixman/config.log; then $(MAKE) -C pixman distclean; fi
363fb8597bbSEd Maste	if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
3647d13299dSbellard
365fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
366fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
367471fbf4aSFrédéric Boiteuxcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
3683751e722SJan Krupabepo    cz
369fed4a9adSbellard
37077755340Sthsifdef INSTALL_BLOBS
371bf2eaf71SEduardo HabkostBLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
3727a4dfd1eSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
3737e973bb2SLaszlo Ersekacpi-dsdt.aml q35-acpi-dsdt.aml \
3749eb08a43SMark Cave-Aylandppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
3755ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
3765ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
3779fd02979SSander Eikelenboomefi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
3789fd02979SSander Eikelenboomefi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
379f7da9c17SAnthony Liguoriqemu-icon.bmp qemu_logo_no_text.svg \
38000914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
3812a2af967SJan Kiszkamultiboot.bin linuxboot.bin kvmvapic.bin \
38239ac8455SDavid Gibsons390-zipl.rom \
3830c1fecddSAlexander Grafs390-ccw.img \
384753d11f2SRichard Hendersonspapr-rtas.bin slof.bin \
3850c6ab8c9SCole Robinsonpalcode-clipper \
3860c6ab8c9SCole Robinsonu-boot.e500
38777755340Sthselse
38877755340SthsBLOBS=
38977755340Sthsendif
39077755340Sths
39138954dcaSpbrookinstall-doc: $(DOCS)
392d7dd65baSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
393d7dd65baSEduardo Habkost	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
394d076a2adSLuiz Capitulino	$(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
39596d409ebSJuan Quintelaifdef CONFIG_POSIX
39658f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
3978a3e8f7fSAndreas Färber	$(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
3988a3e8f7fSAndreas Färberifneq ($(TOOLS),)
3998a3e8f7fSAndreas Färber	$(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1"
40058f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
40158f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
40238954dcaSpbrookendif
4038a3e8f7fSAndreas Färberendif
404a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
405a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
406a2d8f1beSM. Mohan Kumar	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
407a2d8f1beSM. Mohan Kumarendif
408b5ec5ce0Sjohn cooper
409e2d87bffSEduardo Habkostinstall-datadir:
410e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
411e2d87bffSEduardo Habkost
412f2e3978bSLaszlo Ersekinstall-localstatedir:
413f2e3978bSLaszlo Ersekifdef CONFIG_POSIX
414f2e3978bSLaszlo Ersekifneq (,$(findstring qemu-ga,$(TOOLS)))
415f2e3978bSLaszlo Ersek	$(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
416f2e3978bSLaszlo Ersekendif
417f2e3978bSLaszlo Ersekendif
418f2e3978bSLaszlo Ersek
419e2d87bffSEduardo Habkost
4201b93c9a1SIkey Dohertyinstall: all $(if $(BUILD_DOCS),install-doc) \
421f2e3978bSLaszlo Ersekinstall-datadir install-localstatedir
422932a79dfSthsifneq ($(TOOLS),)
4230d659426SMichael Tokarev	$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
424932a79dfSthsendif
425e3be6f0eSFam Zhengifneq ($(CONFIG_MODULES),)
426e3be6f0eSFam Zheng	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
4272115182fSMichael Tokarev	for s in $(modules-m:.mo=$(DSOSUF)); do \
4282115182fSMichael Tokarev		t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
429264f8b4fSMichael Tokarev		$(INSTALL_LIB) $$s "$$t"; \
4302115182fSMichael Tokarev		test -z "$(STRIP)" || $(STRIP) "$$t"; \
431e3be6f0eSFam Zheng	done
432e3be6f0eSFam Zhengendif
4337b93fadfSCorey Bryantifneq ($(HELPERS-y),)
4340d659426SMichael Tokarev	$(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
4357b93fadfSCorey Bryantendif
43677755340Sthsifneq ($(BLOBS),)
43777755340Sths	set -e; for x in $(BLOBS); do \
4386aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
439ad064840Spbrook	done
44077755340Sthsendif
441834574eaSAnthony Liguoriifeq ($(CONFIG_GTK),y)
442834574eaSAnthony Liguori	$(MAKE) -C po $@
443834574eaSAnthony Liguoriendif
4446aae2a2eSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
44518be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
4466aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
447ad064840Spbrook	done
44889ae5831SStefan Hajnoczi	$(INSTALL_DATA) $(SRC_PATH)/trace-events "$(DESTDIR)$(qemu_datadir)/trace-events"
449626df76aSbellard	for d in $(TARGET_DIRS); do \
4506570025eSLluís Vilanova	$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
451626df76aSbellard        done
452612384d7Sbellard
453367e86e8Sbellard# various test targets
4549b0b8203Sbellardtest speed: all
455c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg $@
45631e31b8aSbellard
457*ae5fdc81SFam Zheng.PHONY: ctags
458*ae5fdc81SFam Zhengctags:
459*ae5fdc81SFam Zheng	rm -f $@
460*ae5fdc81SFam Zheng	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
461*ae5fdc81SFam Zheng
46221d4e8e3SAlexandre Bique.PHONY: TAGS
463367e86e8SbellardTAGS:
464b1999e87SDavid Gibson	rm -f $@
465b1999e87SDavid Gibson	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
46631e31b8aSbellard
4676688bc6dSbellardcscope:
468eaa2ddbbSFam Zheng	rm -f "$(SRC_PATH)"/cscope.*
469eaa2ddbbSFam Zheng	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files"
470eaa2ddbbSFam Zheng	cscope -b -i"$(SRC_PATH)/cscope.files"
4716688bc6dSbellard
472d98bc0b6SGerd Hoffmann# opengl shader programs
473d98bc0b6SGerd Hoffmannui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
474d98bc0b6SGerd Hoffmann	@mkdir -p $(dir $@)
475d98bc0b6SGerd Hoffmann	$(call quiet-command,\
476d98bc0b6SGerd Hoffmann		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
477d98bc0b6SGerd Hoffmann		"  VERT  $@")
478d98bc0b6SGerd Hoffmann
479d98bc0b6SGerd Hoffmannui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl
480d98bc0b6SGerd Hoffmann	@mkdir -p $(dir $@)
481d98bc0b6SGerd Hoffmann	$(call quiet-command,\
482d98bc0b6SGerd Hoffmann		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
483d98bc0b6SGerd Hoffmann		"  FRAG  $@")
484d98bc0b6SGerd Hoffmann
485cd2bc889SGerd Hoffmannui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \
486cd2bc889SGerd Hoffmann	ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h
487cd2bc889SGerd Hoffmann
4883ef693a0Sbellard# documentation
48901668d98SStefan WeilMAKEINFO=makeinfo
49001668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
49120cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
49220cc9997SStefan Weil%.dvi: %.texi
49320cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
49420cc9997SStefan Weil
4951f673135Sbellard%.html: %.texi
496952ef67cSStefan Weil	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
49701668d98SStefan Weil	"  GEN   $@")
4983ef693a0Sbellard
499f3548328Sbellard%.info: %.texi
50001668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
501f3548328Sbellard
50220cc9997SStefan Weil%.pdf: %.texi
50320cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
5045824d651Sblueswir1
5055824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
5064c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
507f3548328Sbellard
508acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
5094c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
5102313086aSBlue Swirl
511d076a2adSLuiz Capitulinoqmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
5124c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
513b40292e7SJan Kiszka
514153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
5154c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
516153859beSStuart Brady
5172313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
5180d00e563Saliguori	$(call quiet-command, \
5194c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
5203179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
5210d00e563Saliguori	  "  GEN   $@")
5225a67135aSbellard
523153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
5240d00e563Saliguori	$(call quiet-command, \
5254c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
5263179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
5270d00e563Saliguori	  "  GEN   $@")
528acd935efSbellard
529a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
530a2d8f1beSM. Mohan Kumar	$(call quiet-command, \
531a2d8f1beSM. Mohan Kumar	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
5323179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
533a2d8f1beSM. Mohan Kumar	  "  GEN   $@")
534a2d8f1beSM. Mohan Kumar
5357a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
5360d00e563Saliguori	$(call quiet-command, \
5374c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
5383179d694SMichael Tokarev	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
5390d00e563Saliguori	  "  GEN   $@")
5407a5ca864Sbellard
541811c5727SStefan Hajnoczikvm_stat.1: scripts/kvm/kvm_stat.texi
542811c5727SStefan Hajnoczi	$(call quiet-command, \
543811c5727SStefan Hajnoczi	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< kvm_stat.pod && \
544811c5727SStefan Hajnoczi	  $(POD2MAN) --section=1 --center=" " --release=" " kvm_stat.pod > $@, \
545811c5727SStefan Hajnoczi	  "  GEN   $@")
546811c5727SStefan Hajnoczi
5470cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
5480cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
54920cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
55020cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
5510cb3fb1eSpbrook
55220cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
55320cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
55420cc9997SStefan Weil	qemu-monitor.texi qemu-img-cmds.texi
555818220f5Saliguori
556f53ec699SStefan Weilifdef CONFIG_WIN32
557f53ec699SStefan Weil
558f53ec699SStefan WeilINSTALLER = qemu-setup-$(VERSION)$(EXESUF)
559f53ec699SStefan Weil
560f53ec699SStefan Weilnsisflags = -V2 -NOCD
561f53ec699SStefan Weil
562f53ec699SStefan Weilifneq ($(wildcard $(SRC_PATH)/dll),)
563f53ec699SStefan Weilifeq ($(ARCH),x86_64)
564f53ec699SStefan Weil# 64 bit executables
565f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w64
566f53ec699SStefan Weilnsisflags += -DW64
567f53ec699SStefan Weilelse
568f53ec699SStefan Weil# 32 bit executables
569f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w32
570f53ec699SStefan Weilendif
571f53ec699SStefan Weilendif
572f53ec699SStefan Weil
573f53ec699SStefan Weil.PHONY: installer
574f53ec699SStefan Weilinstaller: $(INSTALLER)
575f53ec699SStefan Weil
576f53ec699SStefan WeilINSTDIR=/tmp/qemu-nsis
577f53ec699SStefan Weil
578f53ec699SStefan Weil$(INSTALLER): $(SRC_PATH)/qemu.nsi
579fb8597bbSEd Maste	$(MAKE) install prefix=${INSTDIR}
580f53ec699SStefan Weilifdef SIGNCODE
581f53ec699SStefan Weil	(cd ${INSTDIR}; \
582f53ec699SStefan Weil         for i in *.exe; do \
583f53ec699SStefan Weil           $(SIGNCODE) $${i}; \
584f53ec699SStefan Weil         done \
585f53ec699SStefan Weil        )
586f53ec699SStefan Weilendif # SIGNCODE
587f53ec699SStefan Weil	(cd ${INSTDIR}; \
588f53ec699SStefan Weil         for i in qemu-system-*.exe; do \
589f53ec699SStefan Weil           arch=$${i%.exe}; \
590f53ec699SStefan Weil           arch=$${arch#qemu-system-}; \
591f53ec699SStefan Weil           echo Section \"$$arch\" Section_$$arch; \
592f53ec699SStefan Weil           echo SetOutPath \"\$$INSTDIR\"; \
593f53ec699SStefan Weil           echo File \"\$${BINDIR}\\$$i\"; \
594f53ec699SStefan Weil           echo SectionEnd; \
595f53ec699SStefan Weil         done \
596f53ec699SStefan Weil        ) >${INSTDIR}/system-emulations.nsh
597f53ec699SStefan Weil	makensis $(nsisflags) \
598f53ec699SStefan Weil                $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
599f53ec699SStefan Weil                $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
600f53ec699SStefan Weil                -DBINDIR="${INSTDIR}" \
601f53ec699SStefan Weil                $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
602f53ec699SStefan Weil                -DSRCDIR="$(SRC_PATH)" \
603f53ec699SStefan Weil                -DOUTFILE="$(INSTALLER)" \
604f53ec699SStefan Weil                $(SRC_PATH)/qemu.nsi
605f53ec699SStefan Weil	rm -r ${INSTDIR}
606f53ec699SStefan Weilifdef SIGNCODE
607f53ec699SStefan Weil	$(SIGNCODE) $(INSTALLER)
608f53ec699SStefan Weilendif # SIGNCODE
609f53ec699SStefan Weilendif # CONFIG_WIN
610f53ec699SStefan Weil
611cb5fc67dSAnthony Liguori# Add a dependency on the generated files, so that they are always
612cb5fc67dSAnthony Liguori# rebuilt before other object files
613eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
614cb5fc67dSAnthony LiguoriMakefile: $(GENERATED_HEADERS)
6157748b8cbSMike Frysingerendif
616cb5fc67dSAnthony Liguori
6174fb240a4Sbellard# Include automatically generated dependency files
6181435ddb8SPaolo Bonzini# Dependencies in Makefile.objs files come from our recursive subdir rules
6191435ddb8SPaolo Bonzini-include $(wildcard *.d tests/*.d)
620