xref: /openbmc/qemu/Makefile (revision 68aa262a)
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
9ae5fdc81SFam 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
5539a18158SMarkus ArmbrusterGENERATED_HEADERS += qmp-introspect.h
5639a18158SMarkus ArmbrusterGENERATED_SOURCES += qmp-introspect.c
57eac236eaSLluís Vilanova
5845be2f5dSLluís VilanovaGENERATED_HEADERS += trace/generated-events.h
5945be2f5dSLluís VilanovaGENERATED_SOURCES += trace/generated-events.c
6045be2f5dSLluís Vilanova
61eac236eaSLluís VilanovaGENERATED_HEADERS += trace/generated-tracers.h
625b808275SLluís Vilanovaifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
63eac236eaSLluís VilanovaGENERATED_HEADERS += trace/generated-tracers-dtrace.h
64eac236eaSLluís Vilanovaendif
65eac236eaSLluís VilanovaGENERATED_SOURCES += trace/generated-tracers.c
66250b086eSLluís Vilanova
67465830fbSLluís VilanovaGENERATED_HEADERS += trace/generated-tcg-tracers.h
68465830fbSLluís Vilanova
69f4654226SLluís VilanovaGENERATED_HEADERS += trace/generated-helpers-wrappers.h
70707c8a98SLluís VilanovaGENERATED_HEADERS += trace/generated-helpers.h
71341ea691SLluís VilanovaGENERATED_SOURCES += trace/generated-helpers.c
72707c8a98SLluís Vilanova
735b808275SLluís Vilanovaifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
74e6bf23f8SMohamad GebaiGENERATED_HEADERS += trace/generated-ust-provider.h
75e6bf23f8SMohamad GebaiGENERATED_SOURCES += trace/generated-ust.c
76e6bf23f8SMohamad Gebaiendif
77e6bf23f8SMohamad Gebai
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
83818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
849dacf32dSYossi Hindin	pdf recurse-all speed test dist msi
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
93665b5d0dSMarc-André LureauDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
94665b5d0dSMarc-André LureauDOCS+=qmp-commands.txt
95811c5727SStefan Hajnocziifdef CONFIG_LINUX
96811c5727SStefan HajnocziDOCS+=kvm_stat.1
97811c5727SStefan Hajnocziendif
98983eef5aSMeador Ingeifdef CONFIG_VIRTFS
99a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1
100983eef5aSMeador Ingeendif
101cc8ae6deSpbrookelse
102cc8ae6deSpbrookDOCS=
103cc8ae6deSpbrookendif
1047d13299dSbellard
105388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
1061f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
10788070801SAndreas FärberSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
1081f3d3c8fSJuan Quintela
1098bdd3d49SStefan Weilifeq ($(SUBDIR_DEVICES_MAK),)
1108bdd3d49SStefan Weilconfig-all-devices.mak:
1118bdd3d49SStefan Weil	$(call quiet-command,echo '# no devices' > $@,"  GEN   $@")
1128bdd3d49SStefan Weilelse
1131f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
114bb585a78SPaolo Bonzini	$(call quiet-command, sed -n \
115bb585a78SPaolo Bonzini             's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
116bb585a78SPaolo Bonzini             $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
117bb585a78SPaolo Bonzini             "  GEN   $@")
1188bdd3d49SStefan Weilendif
1191f3d3c8fSJuan Quintela
120bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
121bd9141bbSPaul Brook
122a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
12315564d85SPaolo Bonzini	$(call quiet-command, \
12415564d85SPaolo Bonzini            $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp, "  GEN   $@.tmp")
12512ccfec9SMichael S. Tsirkin	$(call quiet-command, if test -f $@; then \
126904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
127012f0879SStefan Weil	    mv $@.tmp $@; \
128012f0879SStefan Weil	    cp -p $@ $@.old; \
129012f0879SStefan Weil	  else \
130012f0879SStefan Weil	    if test -f $@.old; then \
131012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
132012f0879SStefan Weil	    else \
133a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
134012f0879SStefan Weil	    fi; \
13563e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
136a992fe3dSPaul Brook	    rm $@.tmp; \
137012f0879SStefan Weil	  fi; \
138a992fe3dSPaul Brook	 else \
139a992fe3dSPaul Brook	  mv $@.tmp $@; \
140012f0879SStefan Weil	  cp -p $@ $@.old; \
14112ccfec9SMichael S. Tsirkin	 fi, "  GEN   $@");
142a992fe3dSPaul Brook
143a992fe3dSPaul Brookdefconfig:
144a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
145a992fe3dSPaul Brook
146992aeb8eSPaolo Bonziniifneq ($(wildcard config-host.mak),)
147992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/Makefile.objs
148ba1183daSFam Zhengendif
149ba1183daSFam Zheng
150ba1183daSFam Zhengdummy := $(call unnest-vars,, \
151ba1183daSFam Zheng                stub-obj-y \
152ba1183daSFam Zheng                util-obj-y \
153ba1183daSFam Zheng                qga-obj-y \
154a75eb03bSDavid Marchand                ivshmem-client-obj-y \
155a75eb03bSDavid Marchand                ivshmem-server-obj-y \
156577a6723STomoki Sekiyama                qga-vss-dll-obj-y \
157ba1183daSFam Zheng                block-obj-y \
158cc475698SFam Zheng                block-obj-m \
159fb37726dSDaniel P. Berrange                crypto-obj-y \
160fb37726dSDaniel P. Berrange                crypto-aes-obj-y \
1610c7012e0SDaniel P. Berrange                qom-obj-y \
162cc475698SFam Zheng                common-obj-y \
163cc475698SFam Zheng                common-obj-m)
164ba1183daSFam Zheng
165ba1183daSFam Zhengifneq ($(wildcard config-host.mak),)
166992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/tests/Makefile
167992aeb8eSPaolo Bonziniendif
168992aeb8eSPaolo Bonzini
16917969268SFam Zhengall: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
170b9dea4fbSpbrook
1711215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
1721215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
173e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
1744c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
1751215c6e7SJuan Quintela
176cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
177916359f6SAndreas FärberSOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
178916359f6SAndreas Färber
17957f45b62SStefan Weil$(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
180fb37726dSDaniel P. Berrange$(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)
181916359f6SAndreas Färber$(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
182cec7d0b6Spbrook
1834115852bSPaolo Bonzinisubdir-%:
1840087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
1854aa42531Spbrook
186e2134eb9SGerd Hoffmannsubdir-pixman: pixman/Makefile
187e2134eb9SGerd Hoffmann	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
188e2134eb9SGerd Hoffmann
189e2134eb9SGerd Hoffmannpixman/Makefile: $(SRC_PATH)/pixman/configure
190f9943cd5SGerd Hoffmann	(cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
191e2134eb9SGerd Hoffmann
192e2134eb9SGerd Hoffmann$(SRC_PATH)/pixman/configure:
193e2134eb9SGerd Hoffmann	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
194e2134eb9SGerd Hoffmann
195a540f158SPeter CrosthwaiteDTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
196965f486cSPeter MaydellDTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
197965f486cSPeter MaydellDTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
198a540f158SPeter Crosthwaite
199a540f158SPeter Crosthwaitesubdir-dtc:dtc/libfdt dtc/tests
200965f486cSPeter 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,)
201a540f158SPeter Crosthwaite
202a540f158SPeter Crosthwaitedtc/%:
203a540f158SPeter Crosthwaite	mkdir -p $@
204a540f158SPeter Crosthwaite
20557f54629SDaniel P. Berrange$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
206add16157SBlue Swirl
207c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
208c05ac895SPaul Brookromsubdir-%:
209c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
210c05ac895SPaul Brook
211c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
212c05ac895SPaul Brook
213c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
2144aa42531Spbrook
21523cab7b7SVasily Efimov$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h | $(BUILD_DIR)/version.lo
2167e75e33eSStefan Weil	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
21723cab7b7SVasily Efimov$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc config-host.h
2187e75e33eSStefan Weil	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.lo")
2195354e4d2SMarc-André Lureau
220fba90ac1SPaolo BonziniMakefile: $(version-obj-y) $(version-lobj-y)
2213bc2f570SPaolo Bonzini
2223bc2f570SPaolo Bonzini######################################################################
2238a090705SPaolo Bonzini# Build libraries
2243bc2f570SPaolo Bonzini
2253bc2f570SPaolo Bonzinilibqemustub.a: $(stub-obj-y)
226169a24aeSFam Zhenglibqemuutil.a: $(util-obj-y)
2273bc2f570SPaolo Bonzini
228e26110cfSFam Zhengblock-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
229e26110cfSFam Zhengutil/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
230e26110cfSFam Zheng
2314fb240a4Sbellard######################################################################
2324fb240a4Sbellard
2333c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
234153859beSStuart Brady
2350c7012e0SDaniel P. Berrangeqemu-img$(EXESUF): qemu-img.o $(block-obj-y) $(crypto-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a
2360c7012e0SDaniel P. Berrangeqemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) $(crypto-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a
2370c7012e0SDaniel P. Berrangeqemu-io$(EXESUF): qemu-io.o $(block-obj-y) $(crypto-obj-y) $(qom-obj-y) libqemuutil.a libqemustub.a
2380a8e1acdSaliguori
2397b93fadfSCorey Bryantqemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
2407b93fadfSCorey Bryant
241ff667e2eSPaolo Bonzinifsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a
24217bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
24317bff52bSM. Mohan Kumar
244153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
2454c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
246153859beSStuart Brady
247957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
24854c2e502SDunrong Huangqemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
249640e5404SMichael Roth
25019bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@))
2518d3bc517SAvi Kivity
2520521d375SStefan Hajnocziqapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
2530521d375SStefan Hajnoczi
25454c2e502SDunrong Huangqga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
2552870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
2560a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
25716d80f61SMarkus Armbruster		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
2580a607749SLluís Vilanova		"  GEN   $@")
25954c2e502SDunrong Huangqga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
2602870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
2610a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
26216d80f61SMarkus Armbruster		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
2630a607749SLluís Vilanova		"  GEN   $@")
26454c2e502SDunrong Huangqga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
2652870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
2660a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
26716d80f61SMarkus Armbruster		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
2680a607749SLluís Vilanova		"  GEN   $@")
269e3d4d252SMichael Roth
270be13d46dSMax Reitzqapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
271f668470fSWenchao Xia               $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
27239a18158SMarkus Armbruster               $(SRC_PATH)/qapi/event.json $(SRC_PATH)/qapi/introspect.json
273be13d46dSMax Reitz
274599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\
275be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
2760a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
27716d80f61SMarkus Armbruster		$(gen-out-type) -o "." -b $<, \
2780a607749SLluís Vilanova		"  GEN   $@")
279599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\
280be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
2810a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
28216d80f61SMarkus Armbruster		$(gen-out-type) -o "." -b $<, \
2830a607749SLluís Vilanova		"  GEN   $@")
28421cd70dfSWenchao Xiaqapi-event.c qapi-event.h :\
28521cd70dfSWenchao Xia$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
28621cd70dfSWenchao Xia	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
28716d80f61SMarkus Armbruster		$(gen-out-type) -o "." $<, \
28821cd70dfSWenchao Xia		"  GEN   $@")
289599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\
290be13d46dSMax Reitz$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
2910a607749SLluís Vilanova	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
29216d80f61SMarkus Armbruster		$(gen-out-type) -o "." -m $<, \
2930a607749SLluís Vilanova		"  GEN   $@")
29439a18158SMarkus Armbrusterqmp-introspect.h qmp-introspect.c :\
29539a18158SMarkus Armbruster$(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
29639a18158SMarkus Armbruster	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
29739a18158SMarkus Armbruster		$(gen-out-type) -o "." $<, \
29839a18158SMarkus Armbruster		"  GEN   $@")
299e3193601SAnthony Liguori
30054c2e502SDunrong HuangQGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
3014115852bSPaolo Bonzini$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
302957f1f99SMichael Roth
303fafcaf1dSMichael Rothqemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
304fafcaf1dSMichael Roth	$(call LINK, $^)
30548ff7a62SMichael Roth
3069dacf32dSYossi Hindinifdef QEMU_GA_MSI_ENABLED
3079dacf32dSYossi HindinQEMU_GA_MSI=qemu-ga-$(ARCH).msi
3089dacf32dSYossi Hindin
3090a18750fSLeonid Blochmsi: $(QEMU_GA_MSI)
3109dacf32dSYossi Hindin
311fafcaf1dSMichael Roth$(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER)
3129dacf32dSYossi Hindin
3139dacf32dSYossi Hindin$(QEMU_GA_MSI): config-host.mak
3149dacf32dSYossi Hindin
315decdfbd2SLeonid Bloch$(QEMU_GA_MSI):  $(SRC_PATH)/qga/installer/qemu-ga.wxs
316decdfbd2SLeonid 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)" \
3179dacf32dSYossi Hindin	wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<, "  WIXL  $@")
3189dacf32dSYossi Hindinelse
3199dacf32dSYossi Hindinmsi:
32015b19ed8SMichael Roth	@echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)"
3219dacf32dSYossi Hindinendif
3229dacf32dSYossi Hindin
323fafcaf1dSMichael Rothifneq ($(EXESUF),)
324fafcaf1dSMichael Roth.PHONY: qemu-ga
325fafcaf1dSMichael Rothqemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI)
326fafcaf1dSMichael Rothendif
327fafcaf1dSMichael Roth
328a75eb03bSDavid Marchandivshmem-client$(EXESUF): $(ivshmem-client-obj-y)
329a75eb03bSDavid Marchand	$(call LINK, $^)
330a75eb03bSDavid Marchandivshmem-server$(EXESUF): $(ivshmem-server-obj-y) libqemuutil.a libqemustub.a
331a75eb03bSDavid Marchand	$(call LINK, $^)
332a75eb03bSDavid Marchand
33331e31b8aSbellardclean:
3342d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
33525be210fSJuan 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
336df2943baSMichael S. Tsirkin	rm -f qemu-options.def
3379dacf32dSYossi Hindin	rm -f *.msi
338f4b11eeeSFam Zheng	find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
339b39297aeSTomoki Sekiyama	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
3408b6bfc77SStefan Weil	rm -f fsdev/*.pod
3418b6bfc77SStefan Weil	rm -rf .libs */.libs
34207b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
343d98bc0b6SGerd Hoffmann	rm -f ui/shader/*-vert.h ui/shader/*-frag.h
34419ac36b5SLluís Vilanova	@# May not be present in GENERATED_HEADERS
345eac236eaSLluís Vilanova	rm -f trace/generated-tracers-dtrace.dtrace*
346eac236eaSLluís Vilanova	rm -f trace/generated-tracers-dtrace.h*
34719ac36b5SLluís Vilanova	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
34819ac36b5SLluís Vilanova	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
3498f0e5c6bSStefan Weil	rm -rf qapi-generated
35054c2e502SDunrong Huang	rm -rf qga/qapi-generated
351781c0c33SStefan Hajnoczi	for d in $(ALL_SUBDIRS); do \
352fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
353df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
354626df76aSbellard        done
35531e31b8aSbellard
35634bb443eSAnthony LiguoriVERSION ?= $(shell cat VERSION)
35734bb443eSAnthony Liguori
35834bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2
35934bb443eSAnthony Liguori
36034bb443eSAnthony Liguoriqemu-%.tar.bz2:
36134bb443eSAnthony Liguori	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
36234bb443eSAnthony Liguori
3637d13299dSbellarddistclean: clean
3642cd8af2dSPavel 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
365ae219359SThomas Huth	rm -f config-all-devices.mak config-all-disas.mak config.status
366ae219359SThomas Huth	rm -f po/*.mo tests/qemu-iotests/common.env
367fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
3687a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
3697a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
3707a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
3717a734b8fSBrad Hards	rm -f qemu-doc.vr
372793553acSAlexandre Raymond	rm -f config.log
37367ed96f9SPeter Maydell	rm -f linux-headers/asm
374e1a068b2SHidetoshi 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
3758e98e2e8SPaolo Bonzini	for d in $(TARGET_DIRS); do \
376bc1b050dSbellard	rm -rf $$d || exit 1 ; \
37776bc6838Sbellard        done
378d9840e25STomoki Sekiyama	rm -Rf .sdk
379fb8597bbSEd Maste	if test -f pixman/config.log; then $(MAKE) -C pixman distclean; fi
380fb8597bbSEd Maste	if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
3817d13299dSbellard
382fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
383fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
384471fbf4aSFrédéric Boiteuxcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
3853751e722SJan Krupabepo    cz
386fed4a9adSbellard
38777755340Sthsifdef INSTALL_BLOBS
388bf2eaf71SEduardo HabkostBLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
3897a4dfd1eSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
3907e973bb2SLaszlo Ersekacpi-dsdt.aml q35-acpi-dsdt.aml \
3919eb08a43SMark Cave-Aylandppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
3925ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
3935ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
3949fd02979SSander Eikelenboomefi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
3959fd02979SSander Eikelenboomefi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
396f7da9c17SAnthony Liguoriqemu-icon.bmp qemu_logo_no_text.svg \
39700914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
3982a2af967SJan Kiszkamultiboot.bin linuxboot.bin kvmvapic.bin \
39939ac8455SDavid Gibsons390-zipl.rom \
4000c1fecddSAlexander Grafs390-ccw.img \
401753d11f2SRichard Hendersonspapr-rtas.bin slof.bin \
4020c6ab8c9SCole Robinsonpalcode-clipper \
4030c6ab8c9SCole Robinsonu-boot.e500
40477755340Sthselse
40577755340SthsBLOBS=
40677755340Sthsendif
40777755340Sths
40838954dcaSpbrookinstall-doc: $(DOCS)
409d7dd65baSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
410d7dd65baSEduardo Habkost	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
411d076a2adSLuiz Capitulino	$(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
41296d409ebSJuan Quintelaifdef CONFIG_POSIX
41358f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
4148a3e8f7fSAndreas Färber	$(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
4158a3e8f7fSAndreas Färberifneq ($(TOOLS),)
4168a3e8f7fSAndreas Färber	$(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1"
41758f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
41858f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
41938954dcaSpbrookendif
420665b5d0dSMarc-André Lureauifneq (,$(findstring qemu-ga,$(TOOLS)))
421665b5d0dSMarc-André Lureau	$(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
422665b5d0dSMarc-André Lureauendif
4238a3e8f7fSAndreas Färberendif
424a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
425a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
426a2d8f1beSM. Mohan Kumar	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
427a2d8f1beSM. Mohan Kumarendif
428b5ec5ce0Sjohn cooper
429e2d87bffSEduardo Habkostinstall-datadir:
430e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
431e2d87bffSEduardo Habkost
432f2e3978bSLaszlo Ersekinstall-localstatedir:
433f2e3978bSLaszlo Ersekifdef CONFIG_POSIX
434f2e3978bSLaszlo Ersekifneq (,$(findstring qemu-ga,$(TOOLS)))
435f2e3978bSLaszlo Ersek	$(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
436f2e3978bSLaszlo Ersekendif
437f2e3978bSLaszlo Ersekendif
438f2e3978bSLaszlo Ersek
439e2d87bffSEduardo Habkost
4401b93c9a1SIkey Dohertyinstall: all $(if $(BUILD_DOCS),install-doc) \
441f2e3978bSLaszlo Ersekinstall-datadir install-localstatedir
442932a79dfSthsifneq ($(TOOLS),)
443*68aa262aSMichael Roth	$(call install-prog,$(subst qemu-ga,qemu-ga$(EXESUF),$(TOOLS)),$(DESTDIR)$(bindir))
444932a79dfSthsendif
445e3be6f0eSFam Zhengifneq ($(CONFIG_MODULES),)
446e3be6f0eSFam Zheng	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
4472115182fSMichael Tokarev	for s in $(modules-m:.mo=$(DSOSUF)); do \
4482115182fSMichael Tokarev		t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
449264f8b4fSMichael Tokarev		$(INSTALL_LIB) $$s "$$t"; \
4502115182fSMichael Tokarev		test -z "$(STRIP)" || $(STRIP) "$$t"; \
451e3be6f0eSFam Zheng	done
452e3be6f0eSFam Zhengendif
4537b93fadfSCorey Bryantifneq ($(HELPERS-y),)
4540d659426SMichael Tokarev	$(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
4557b93fadfSCorey Bryantendif
45677755340Sthsifneq ($(BLOBS),)
45777755340Sths	set -e; for x in $(BLOBS); do \
4586aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
459ad064840Spbrook	done
46077755340Sthsendif
461834574eaSAnthony Liguoriifeq ($(CONFIG_GTK),y)
462834574eaSAnthony Liguori	$(MAKE) -C po $@
463834574eaSAnthony Liguoriendif
4646aae2a2eSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
46518be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
4666aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
467ad064840Spbrook	done
46889ae5831SStefan Hajnoczi	$(INSTALL_DATA) $(SRC_PATH)/trace-events "$(DESTDIR)$(qemu_datadir)/trace-events"
469626df76aSbellard	for d in $(TARGET_DIRS); do \
4706570025eSLluís Vilanova	$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
471626df76aSbellard        done
472612384d7Sbellard
473367e86e8Sbellard# various test targets
4749b0b8203Sbellardtest speed: all
475c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg $@
47631e31b8aSbellard
477ae5fdc81SFam Zheng.PHONY: ctags
478ae5fdc81SFam Zhengctags:
479ae5fdc81SFam Zheng	rm -f $@
480ae5fdc81SFam Zheng	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
481ae5fdc81SFam Zheng
48221d4e8e3SAlexandre Bique.PHONY: TAGS
483367e86e8SbellardTAGS:
484b1999e87SDavid Gibson	rm -f $@
485b1999e87SDavid Gibson	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
48631e31b8aSbellard
4876688bc6dSbellardcscope:
488eaa2ddbbSFam Zheng	rm -f "$(SRC_PATH)"/cscope.*
489eaa2ddbbSFam Zheng	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files"
490eaa2ddbbSFam Zheng	cscope -b -i"$(SRC_PATH)/cscope.files"
4916688bc6dSbellard
492d98bc0b6SGerd Hoffmann# opengl shader programs
493d98bc0b6SGerd Hoffmannui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
494d98bc0b6SGerd Hoffmann	@mkdir -p $(dir $@)
495d98bc0b6SGerd Hoffmann	$(call quiet-command,\
496d98bc0b6SGerd Hoffmann		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
497d98bc0b6SGerd Hoffmann		"  VERT  $@")
498d98bc0b6SGerd Hoffmann
499d98bc0b6SGerd Hoffmannui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl
500d98bc0b6SGerd Hoffmann	@mkdir -p $(dir $@)
501d98bc0b6SGerd Hoffmann	$(call quiet-command,\
502d98bc0b6SGerd Hoffmann		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
503d98bc0b6SGerd Hoffmann		"  FRAG  $@")
504d98bc0b6SGerd Hoffmann
505cd2bc889SGerd Hoffmannui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \
506cd2bc889SGerd Hoffmann	ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h
507cd2bc889SGerd Hoffmann
5083ef693a0Sbellard# documentation
50901668d98SStefan WeilMAKEINFO=makeinfo
51001668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
51120cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
51220cc9997SStefan Weil%.dvi: %.texi
51320cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
51420cc9997SStefan Weil
5151f673135Sbellard%.html: %.texi
516952ef67cSStefan Weil	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
51701668d98SStefan Weil	"  GEN   $@")
5183ef693a0Sbellard
519f3548328Sbellard%.info: %.texi
52001668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
521f3548328Sbellard
52220cc9997SStefan Weil%.pdf: %.texi
52320cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
5245824d651Sblueswir1
5255824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
5264c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
527f3548328Sbellard
528acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
5294c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
5302313086aSBlue Swirl
5312cd8af2dSPavel Butsykinqemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx
5322cd8af2dSPavel Butsykin	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
5332cd8af2dSPavel Butsykin
534d076a2adSLuiz Capitulinoqmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
5354c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
536b40292e7SJan Kiszka
537153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
5384c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
539153859beSStuart Brady
5402cd8af2dSPavel Butsykinqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
5410d00e563Saliguori	$(call quiet-command, \
5424c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
5433179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
5440d00e563Saliguori	  "  GEN   $@")
5455a67135aSbellard
546153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
5470d00e563Saliguori	$(call quiet-command, \
5484c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
5493179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
5500d00e563Saliguori	  "  GEN   $@")
551acd935efSbellard
552a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
553a2d8f1beSM. Mohan Kumar	$(call quiet-command, \
554a2d8f1beSM. Mohan Kumar	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
5553179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
556a2d8f1beSM. Mohan Kumar	  "  GEN   $@")
557a2d8f1beSM. Mohan Kumar
5587a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
5590d00e563Saliguori	$(call quiet-command, \
5604c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
5613179d694SMichael Tokarev	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
5620d00e563Saliguori	  "  GEN   $@")
5637a5ca864Sbellard
564665b5d0dSMarc-André Lureauqemu-ga.8: qemu-ga.texi
565665b5d0dSMarc-André Lureau	$(call quiet-command, \
566665b5d0dSMarc-André Lureau	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-ga.pod && \
567665b5d0dSMarc-André Lureau	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-ga.pod > $@, \
568665b5d0dSMarc-André Lureau	  "  GEN   $@")
569665b5d0dSMarc-André Lureau
570811c5727SStefan Hajnoczikvm_stat.1: scripts/kvm/kvm_stat.texi
571811c5727SStefan Hajnoczi	$(call quiet-command, \
572811c5727SStefan Hajnoczi	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< kvm_stat.pod && \
573811c5727SStefan Hajnoczi	  $(POD2MAN) --section=1 --center=" " --release=" " kvm_stat.pod > $@, \
574811c5727SStefan Hajnoczi	  "  GEN   $@")
575811c5727SStefan Hajnoczi
5760cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
5770cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
57820cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
57920cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
5800cb3fb1eSpbrook
58120cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
58220cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
5832cd8af2dSPavel Butsykin	qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \
5842cd8af2dSPavel Butsykin	qemu-monitor-info.texi
585818220f5Saliguori
586f53ec699SStefan Weilifdef CONFIG_WIN32
587f53ec699SStefan Weil
588f53ec699SStefan WeilINSTALLER = qemu-setup-$(VERSION)$(EXESUF)
589f53ec699SStefan Weil
590f53ec699SStefan Weilnsisflags = -V2 -NOCD
591f53ec699SStefan Weil
592f53ec699SStefan Weilifneq ($(wildcard $(SRC_PATH)/dll),)
593f53ec699SStefan Weilifeq ($(ARCH),x86_64)
594f53ec699SStefan Weil# 64 bit executables
595f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w64
596f53ec699SStefan Weilnsisflags += -DW64
597f53ec699SStefan Weilelse
598f53ec699SStefan Weil# 32 bit executables
599f53ec699SStefan WeilDLL_PATH = $(SRC_PATH)/dll/w32
600f53ec699SStefan Weilendif
601f53ec699SStefan Weilendif
602f53ec699SStefan Weil
603f53ec699SStefan Weil.PHONY: installer
604f53ec699SStefan Weilinstaller: $(INSTALLER)
605f53ec699SStefan Weil
606f53ec699SStefan WeilINSTDIR=/tmp/qemu-nsis
607f53ec699SStefan Weil
608f53ec699SStefan Weil$(INSTALLER): $(SRC_PATH)/qemu.nsi
609fb8597bbSEd Maste	$(MAKE) install prefix=${INSTDIR}
610f53ec699SStefan Weilifdef SIGNCODE
611f53ec699SStefan Weil	(cd ${INSTDIR}; \
612f53ec699SStefan Weil         for i in *.exe; do \
613f53ec699SStefan Weil           $(SIGNCODE) $${i}; \
614f53ec699SStefan Weil         done \
615f53ec699SStefan Weil        )
616f53ec699SStefan Weilendif # SIGNCODE
617f53ec699SStefan Weil	(cd ${INSTDIR}; \
618f53ec699SStefan Weil         for i in qemu-system-*.exe; do \
619f53ec699SStefan Weil           arch=$${i%.exe}; \
620f53ec699SStefan Weil           arch=$${arch#qemu-system-}; \
621f53ec699SStefan Weil           echo Section \"$$arch\" Section_$$arch; \
622f53ec699SStefan Weil           echo SetOutPath \"\$$INSTDIR\"; \
623f53ec699SStefan Weil           echo File \"\$${BINDIR}\\$$i\"; \
624f53ec699SStefan Weil           echo SectionEnd; \
625f53ec699SStefan Weil         done \
626f53ec699SStefan Weil        ) >${INSTDIR}/system-emulations.nsh
627f53ec699SStefan Weil	makensis $(nsisflags) \
628f53ec699SStefan Weil                $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
629f53ec699SStefan Weil                $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
630f53ec699SStefan Weil                -DBINDIR="${INSTDIR}" \
631f53ec699SStefan Weil                $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
632f53ec699SStefan Weil                -DSRCDIR="$(SRC_PATH)" \
633f53ec699SStefan Weil                -DOUTFILE="$(INSTALLER)" \
634805d8a67SStefan Weil                -DDISPLAYVERSION="$(VERSION)" \
635f53ec699SStefan Weil                $(SRC_PATH)/qemu.nsi
636f53ec699SStefan Weil	rm -r ${INSTDIR}
637f53ec699SStefan Weilifdef SIGNCODE
638f53ec699SStefan Weil	$(SIGNCODE) $(INSTALLER)
639f53ec699SStefan Weilendif # SIGNCODE
640f53ec699SStefan Weilendif # CONFIG_WIN
641f53ec699SStefan Weil
642cb5fc67dSAnthony Liguori# Add a dependency on the generated files, so that they are always
643cb5fc67dSAnthony Liguori# rebuilt before other object files
644eaa2ddbbSFam Zhengifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
645cb5fc67dSAnthony LiguoriMakefile: $(GENERATED_HEADERS)
6467748b8cbSMike Frysingerendif
647cb5fc67dSAnthony Liguori
6484fb240a4Sbellard# Include automatically generated dependency files
6491435ddb8SPaolo Bonzini# Dependencies in Makefile.objs files come from our recursive subdir rules
6501435ddb8SPaolo Bonzini-include $(wildcard *.d tests/*.d)
651