]> git.proxmox.com Git - mirror_qemu.git/blame - Makefile
trace: [tcg] Declare TCG tracing helper routines
[mirror_qemu.git] / Makefile
CommitLineData
0cb3fb1e
PB
1# Makefile for QEMU.
2
519e1693
SW
3# Always point to the root of the build tree (needs GNU make).
4BUILD_DIR=$(CURDIR)
388d4758 5
250b086e 6# All following code might depend on configuration variables
55d7e8f6 7ifneq ($(wildcard config-host.mak),)
1ad2134f 8# Put the all: rule here so that config-host.mak can contain dependencies.
8f67aa82 9all:
ad064840 10include config-host.mak
d1bd2423
PM
11
12# Check that we're not trying to do an out-of-tree build from
13# a tree that's been used for an in-tree build.
14ifneq ($(realpath $(SRC_PATH)),$(realpath .))
15ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
16$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
17seems to have been used for an in-tree build. You can fix this by running \
18"make distclean && rm -rf *-linux-user *-softmmu" in your source tree)
19endif
20endif
21
f3aa844b
PB
22CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
23CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
24CONFIG_ALL=y
25-include config-all-devices.mak
26-include config-all-disas.mak
27
17759187 28include $(SRC_PATH)/rules.mak
59bc10ee 29config-host.mak: $(SRC_PATH)/configure
e5efe7f5 30 @echo $@ is out-of-date, running configure
bdf523e6
SW
31 @# TODO: The next lines include code which supports a smooth
32 @# transition from old configurations without config.status.
33 @# This code can be removed after QEMU 1.7.
34 @if test -x config.status; then \
35 ./config.status; \
36 else \
37 sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh; \
38 fi
55d7e8f6
AJ
39else
40config-host.mak:
7748b8cb 41ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
55d7e8f6
AJ
42 @echo "Please call configure before running make!"
43 @exit 1
44endif
7748b8cb 45endif
766a487a 46
eac236ea 47GENERATED_HEADERS = config-host.h qemu-options.def
21cd70df
WX
48GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
49GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
eac236ea 50
45be2f5d
LV
51GENERATED_HEADERS += trace/generated-events.h
52GENERATED_SOURCES += trace/generated-events.c
53
eac236ea 54GENERATED_HEADERS += trace/generated-tracers.h
5b808275 55ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
eac236ea 56GENERATED_HEADERS += trace/generated-tracers-dtrace.h
250b086e 57endif
eac236ea 58GENERATED_SOURCES += trace/generated-tracers.c
250b086e 59
707c8a98
LV
60GENERATED_HEADERS += trace/generated-helpers.h
61
5b808275 62ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
e6bf23f8
MG
63GENERATED_HEADERS += trace/generated-ust-provider.h
64GENERATED_SOURCES += trace/generated-ust.c
65endif
66
d9ace8b3
JQ
67# Don't try to regenerate Makefile or configure
68# We don't generate any of them
69Makefile: ;
70configure: ;
71
818220f5 72.PHONY: all clean cscope distclean dvi html info install install-doc \
34bb443e 73 pdf recurse-all speed test dist
0cb3fb1e 74
fec90ff0 75$(call set-vpath, $(SRC_PATH))
8c462f8f 76
3e2e0e6b 77LIBS+=-lz $(LIBS_TOOLS)
67c0f08d 78
7b93fadf
CB
79HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
80
cc8ae6de 81ifdef BUILD_DOCS
d076a2ad 82DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
983eef5a 83ifdef CONFIG_VIRTFS
a2d8f1be 84DOCS+=fsdev/virtfs-proxy-helper.1
983eef5a 85endif
cc8ae6de
PB
86else
87DOCS=
88endif
aa05ae6f 89
388d4758 90SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
1f3d3c8f 91SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
88070801 92SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
1f3d3c8f 93
8bdd3d49
SW
94ifeq ($(SUBDIR_DEVICES_MAK),)
95config-all-devices.mak:
96 $(call quiet-command,echo '# no devices' > $@," GEN $@")
97else
1f3d3c8f 98config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
bb585a78
PB
99 $(call quiet-command, sed -n \
100 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
101 $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
102 " GEN $@")
8bdd3d49 103endif
1f3d3c8f 104
bd9141bb
PB
105-include $(SUBDIR_DEVICES_MAK_DEP)
106
a992fe3d 107%/config-devices.mak: default-configs/%.mak
4c3b5a48 108 $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, " GEN $@")
012f0879 109 @if test -f $@; then \
904fe1fb 110 if cmp -s $@.old $@; then \
bd9141bb
PB
111 mv $@.tmp $@; \
112 cp -p $@ $@.old; \
012f0879
SW
113 else \
114 if test -f $@.old; then \
115 echo "WARNING: $@ (user modified) out of date.";\
116 else \
117 echo "WARNING: $@ out of date.";\
118 fi; \
119 echo "Run \"make defconfig\" to regenerate."; \
120 rm $@.tmp; \
121 fi; \
a992fe3d 122 else \
012f0879
SW
123 mv $@.tmp $@; \
124 cp -p $@ $@.old; \
a992fe3d
PB
125 fi
126
127defconfig:
128 rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
129
992aeb8e
PB
130ifneq ($(wildcard config-host.mak),)
131include $(SRC_PATH)/Makefile.objs
ba1183da
FZ
132endif
133
134dummy := $(call unnest-vars,, \
135 stub-obj-y \
136 util-obj-y \
137 qga-obj-y \
577a6723 138 qga-vss-dll-obj-y \
ba1183da 139 block-obj-y \
cc475698
FZ
140 block-obj-m \
141 common-obj-y \
142 common-obj-m)
ba1183da
FZ
143
144ifneq ($(wildcard config-host.mak),)
992aeb8e
PB
145include $(SRC_PATH)/tests/Makefile
146endif
147ifeq ($(CONFIG_SMARTCARD_NSS),y)
148include $(SRC_PATH)/libcacard/Makefile
149endif
150
17969268 151all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
b9dea4fb 152
1215c6e7
JQ
153config-host.h: config-host.h-timestamp
154config-host.h-timestamp: config-host.mak
e14056ad 155qemu-options.def: $(SRC_PATH)/qemu-options.hx
4c3b5a48 156 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@")
1215c6e7 157
cec7d0b6 158SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
916359f6
AF
159SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
160
57f45b62 161$(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
916359f6 162$(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
cec7d0b6 163
4115852b 164subdir-%:
0087375e 165 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
4aa42531 166
e2134eb9
GH
167subdir-pixman: pixman/Makefile
168 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
169
170pixman/Makefile: $(SRC_PATH)/pixman/configure
f9943cd5 171 (cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
e2134eb9
GH
172
173$(SRC_PATH)/pixman/configure:
174 (cd $(SRC_PATH)/pixman; autoreconf -v --install)
175
a540f158 176DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
965f486c
PM
177DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
178DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
a540f158
PC
179
180subdir-dtc:dtc/libfdt dtc/tests
965f486c 181 $(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,)
a540f158
PC
182
183dtc/%:
184 mkdir -p $@
185
82cb6b04 186$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
add16157 187
c05ac895
PB
188ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
189romsubdir-%:
190 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
191
192ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
193
194recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
83f64091 195
0b516ef0 196$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
7e75e33e 197 $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<," RC version.o")
0b516ef0 198$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
7e75e33e 199 $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<," RC version.lo")
5354e4d2 200
fba90ac1 201Makefile: $(version-obj-y) $(version-lobj-y)
3bc2f570
PB
202
203######################################################################
8a090705 204# Build libraries
3bc2f570
PB
205
206libqemustub.a: $(stub-obj-y)
21cd70df 207libqemuutil.a: $(util-obj-y) qapi-types.o qapi-visit.o qapi-event.o
3bc2f570 208
e26110cf
FZ
209block-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
210util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
211
44dc0ca3 212######################################################################
4fb240a4 213
3c089e15 214qemu-img.o: qemu-img-cmds.h
153859be 215
ff667e2e
PB
216qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
217qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
587da2c3 218qemu-io$(EXESUF): qemu-io.o $(block-obj-y) libqemuutil.a libqemustub.a
0a8e1acd 219
7b93fadf
CB
220qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
221
ff667e2e 222fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a
17bff52b
MK
223fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
224
153859be 225qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
4c3b5a48 226 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@")
153859be 227
957f1f99 228qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
54c2e502 229qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
640e5404 230
19bf7c87 231gen-out-type = $(subst .,-,$(suffix $@))
8d3bc517 232
0521d375
SH
233qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
234
54c2e502 235qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
2870dc34 236$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
0a607749 237 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
33aaad52 238 $(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
0a607749 239 " GEN $@")
54c2e502 240qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
2870dc34 241$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
0a607749 242 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
33aaad52 243 $(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
0a607749 244 " GEN $@")
54c2e502 245qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
2870dc34 246$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
0a607749 247 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
33aaad52 248 $(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
0a607749 249 " GEN $@")
e3d4d252 250
be13d46d 251qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
f668470f 252 $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
82d72d9d 253 $(SRC_PATH)/qapi/event.json
be13d46d 254
599825c5 255qapi-types.c qapi-types.h :\
be13d46d 256$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
0a607749 257 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
33aaad52 258 $(gen-out-type) -o "." -b -i $<, \
0a607749 259 " GEN $@")
599825c5 260qapi-visit.c qapi-visit.h :\
be13d46d 261$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
0a607749 262 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
33aaad52 263 $(gen-out-type) -o "." -b -i $<, \
0a607749 264 " GEN $@")
21cd70df
WX
265qapi-event.c qapi-event.h :\
266$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
267 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
268 $(gen-out-type) -o "." -b -i $<, \
269 " GEN $@")
599825c5 270qmp-commands.h qmp-marshal.c :\
be13d46d 271$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
0a607749 272 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
33aaad52 273 $(gen-out-type) -o "." -m -i $<, \
0a607749 274 " GEN $@")
e3193601 275
54c2e502 276QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
4115852b 277$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
957f1f99 278
ff667e2e 279qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
2870dc34 280 $(call LINK, $^)
48ff7a62 281
31e31b8a 282clean:
2d80ae89 283# avoid old build problems by removing potentially incorrect old files
25be210f 284 rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
df2943ba 285 rm -f qemu-options.def
f4b11eee 286 find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
b39297ae 287 rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
8b6bfc77
SW
288 rm -f fsdev/*.pod
289 rm -rf .libs */.libs
07b44ce9 290 rm -f qemu-img-cmds.h
19ac36b5 291 @# May not be present in GENERATED_HEADERS
eac236ea
LV
292 rm -f trace/generated-tracers-dtrace.dtrace*
293 rm -f trace/generated-tracers-dtrace.h*
19ac36b5
LV
294 rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
295 rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
8f0e5c6b 296 rm -rf qapi-generated
54c2e502 297 rm -rf qga/qapi-generated
781c0c33 298 for d in $(ALL_SUBDIRS); do \
fc8e320e 299 if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
df2943ba 300 rm -f $$d/qemu-options.def; \
626df76a 301 done
31e31b8a 302
34bb443e
AL
303VERSION ?= $(shell cat VERSION)
304
305dist: qemu-$(VERSION).tar.bz2
306
34bb443e
AL
307qemu-%.tar.bz2:
308 $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
309
7d13299d 310distclean: clean
fc8e320e 311 rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
76cad711 312 rm -f config-all-devices.mak config-all-disas.mak
8b6bfc77 313 rm -f po/*.mo
fc8e320e 314 rm -f roms/seabios/config.mak roms/vgabios/config.mak
7a734b8f
BH
315 rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
316 rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
317 rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
318 rm -f qemu-doc.vr
793553ac 319 rm -f config.log
67ed96f9 320 rm -f linux-headers/asm
e1a068b2 321 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
8e98e2e8 322 for d in $(TARGET_DIRS); do \
bc1b050d 323 rm -rf $$d || exit 1 ; \
76bc6838 324 done
d9840e25 325 rm -Rf .sdk
a85903ff 326 if test -f pixman/config.log; then make -C pixman distclean; fi
a540f158 327 if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
7d13299d 328
fed4a9ad
FB
329KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
330ar de en-us fi fr-be hr it lv nl pl ru th \
471fbf4a 331common de-ch es fo fr-ca hu ja mk nl-be pt sl tr \
3751e722 332bepo cz
fed4a9ad 333
77755340 334ifdef INSTALL_BLOBS
bf2eaf71 335BLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
7943a2fa 336vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
7e973bb2 337acpi-dsdt.aml q35-acpi-dsdt.aml \
9eb08a43 338ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
5ee8ad71
AW
339pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
340pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
9fd02979
SE
341efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
342efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
f7da9c17 343qemu-icon.bmp qemu_logo_no_text.svg \
00914b7d 344bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
2a2af967 345multiboot.bin linuxboot.bin kvmvapic.bin \
39ac8455 346s390-zipl.rom \
0c1fecdd 347s390-ccw.img \
753d11f2 348spapr-rtas.bin slof.bin \
0c6ab8c9
CR
349palcode-clipper \
350u-boot.e500
77755340
TS
351else
352BLOBS=
353endif
354
38954dca 355install-doc: $(DOCS)
d7dd65ba
EH
356 $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
357 $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
d076a2ad 358 $(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
96d409eb 359ifdef CONFIG_POSIX
58f8aead 360 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
8a3e8f7f
AF
361 $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
362ifneq ($(TOOLS),)
363 $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1"
58f8aead
AL
364 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
365 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
38954dca 366endif
8a3e8f7f 367endif
a2d8f1be
MK
368ifdef CONFIG_VIRTFS
369 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
370 $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
371endif
e2d87bff
EH
372
373install-datadir:
374 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
375
f2e3978b
LE
376install-localstatedir:
377ifdef CONFIG_POSIX
378ifneq (,$(findstring qemu-ga,$(TOOLS)))
379 $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
380endif
381endif
382
e2d87bff 383install-confdir:
80465e80 384 $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
e2d87bff
EH
385
386install-sysconfig: install-datadir install-confdir
80465e80 387 $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
b5ec5ce0 388
f2e3978b
LE
389install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
390install-datadir install-localstatedir
932a79df 391ifneq ($(TOOLS),)
0d659426 392 $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
932a79df 393endif
e3be6f0e
FZ
394ifneq ($(CONFIG_MODULES),)
395 $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
2115182f
MT
396 for s in $(modules-m:.mo=$(DSOSUF)); do \
397 t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
264f8b4f 398 $(INSTALL_LIB) $$s "$$t"; \
2115182f 399 test -z "$(STRIP)" || $(STRIP) "$$t"; \
e3be6f0e
FZ
400 done
401endif
7b93fadf 402ifneq ($(HELPERS-y),)
0d659426 403 $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
7b93fadf 404endif
77755340 405ifneq ($(BLOBS),)
77755340 406 set -e; for x in $(BLOBS); do \
6aae2a2e 407 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
ad064840 408 done
834574ea
AL
409endif
410ifeq ($(CONFIG_GTK),y)
411 $(MAKE) -C po $@
77755340 412endif
6aae2a2e 413 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
18be8d77 414 set -e; for x in $(KEYMAPS); do \
6aae2a2e 415 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
ad064840 416 done
626df76a 417 for d in $(TARGET_DIRS); do \
6570025e 418 $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
626df76a 419 done
612384d7 420
367e86e8 421# various test targets
9b0b8203 422test speed: all
c09015dd 423 $(MAKE) -C tests/tcg $@
31e31b8a 424
21d4e8e3 425.PHONY: TAGS
5fafdf24 426TAGS:
b1999e87
DG
427 rm -f $@
428 find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
31e31b8a 429
6688bc6d
FB
430cscope:
431 rm -f ./cscope.*
45b75ae4 432 find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
6688bc6d
FB
433 cscope -b
434
3ef693a0 435# documentation
01668d98
SW
436MAKEINFO=makeinfo
437MAKEINFOFLAGS=--no-headers --no-split --number-sections
20cc9997
SW
438TEXIFLAG=$(if $(V),,--quiet)
439%.dvi: %.texi
440 $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@")
441
1f673135 442%.html: %.texi
952ef67c 443 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
01668d98 444 " GEN $@")
3ef693a0 445
f3548328 446%.info: %.texi
01668d98 447 $(call quiet-command,$(MAKEINFO) $< -o $@," GEN $@")
f3548328 448
20cc9997
SW
449%.pdf: %.texi
450 $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<," GEN $@")
5824d651
BS
451
452qemu-options.texi: $(SRC_PATH)/qemu-options.hx
4c3b5a48 453 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
f3548328 454
acd0a093 455qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
4c3b5a48 456 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
2313086a 457
d076a2ad 458qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
4c3b5a48 459 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@," GEN $@")
b40292e7 460
153859be 461qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
4c3b5a48 462 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
153859be 463
2313086a 464qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
0d00e563 465 $(call quiet-command, \
4c3b5a48 466 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
3179d694 467 $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
0d00e563 468 " GEN $@")
5a67135a 469
153859be 470qemu-img.1: qemu-img.texi qemu-img-cmds.texi
0d00e563 471 $(call quiet-command, \
4c3b5a48 472 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
3179d694 473 $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
0d00e563 474 " GEN $@")
acd935ef 475
a2d8f1be
MK
476fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
477 $(call quiet-command, \
478 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
3179d694 479 $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
a2d8f1be
MK
480 " GEN $@")
481
7a5ca864 482qemu-nbd.8: qemu-nbd.texi
0d00e563 483 $(call quiet-command, \
4c3b5a48 484 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
3179d694 485 $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
0d00e563 486 " GEN $@")
7a5ca864 487
0cb3fb1e 488dvi: qemu-doc.dvi qemu-tech.dvi
0cb3fb1e 489html: qemu-doc.html qemu-tech.html
20cc9997
SW
490info: qemu-doc.info qemu-tech.info
491pdf: qemu-doc.pdf qemu-tech.pdf
0cb3fb1e 492
20cc9997
SW
493qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
494 qemu-img.texi qemu-nbd.texi qemu-options.texi \
495 qemu-monitor.texi qemu-img-cmds.texi
818220f5 496
f53ec699
SW
497ifdef CONFIG_WIN32
498
499INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
500
501nsisflags = -V2 -NOCD
502
503ifneq ($(wildcard $(SRC_PATH)/dll),)
504ifeq ($(ARCH),x86_64)
505# 64 bit executables
506DLL_PATH = $(SRC_PATH)/dll/w64
507nsisflags += -DW64
508else
509# 32 bit executables
510DLL_PATH = $(SRC_PATH)/dll/w32
511endif
512endif
513
514.PHONY: installer
515installer: $(INSTALLER)
516
517INSTDIR=/tmp/qemu-nsis
518
519$(INSTALLER): $(SRC_PATH)/qemu.nsi
520 make install prefix=${INSTDIR}
521ifdef SIGNCODE
522 (cd ${INSTDIR}; \
523 for i in *.exe; do \
524 $(SIGNCODE) $${i}; \
525 done \
526 )
527endif # SIGNCODE
528 (cd ${INSTDIR}; \
529 for i in qemu-system-*.exe; do \
530 arch=$${i%.exe}; \
531 arch=$${arch#qemu-system-}; \
532 echo Section \"$$arch\" Section_$$arch; \
533 echo SetOutPath \"\$$INSTDIR\"; \
534 echo File \"\$${BINDIR}\\$$i\"; \
535 echo SectionEnd; \
536 done \
537 ) >${INSTDIR}/system-emulations.nsh
538 makensis $(nsisflags) \
539 $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
540 $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
541 -DBINDIR="${INSTDIR}" \
542 $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
543 -DSRCDIR="$(SRC_PATH)" \
544 -DOUTFILE="$(INSTALLER)" \
545 $(SRC_PATH)/qemu.nsi
546 rm -r ${INSTDIR}
547ifdef SIGNCODE
548 $(SIGNCODE) $(INSTALLER)
549endif # SIGNCODE
550endif # CONFIG_WIN
551
cb5fc67d
AL
552# Add a dependency on the generated files, so that they are always
553# rebuilt before other object files
7748b8cb 554ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
cb5fc67d 555Makefile: $(GENERATED_HEADERS)
7748b8cb 556endif
cb5fc67d 557
4fb240a4 558# Include automatically generated dependency files
1435ddb8
PB
559# Dependencies in Makefile.objs files come from our recursive subdir rules
560-include $(wildcard *.d tests/*.d)