Merge remote-tracking branch 'qemu/master'
[qemu/ar7.git] / Makefile
blobc1ccde1a2fe4121b06944c3842249734d36f5567
1 # Makefile for QEMU.
3 # Always point to the root of the build tree (needs GNU make).
4 BUILD_DIR=$(CURDIR)
6 # All following code might depend on configuration variables
7 ifneq ($(wildcard config-host.mak),)
8 # Put the all: rule here so that config-host.mak can contain dependencies.
9 all:
10 include config-host.mak
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.
14 ifneq ($(realpath $(SRC_PATH)),$(realpath .))
15 ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
16 $(error This is an out of tree build but your source tree ($(SRC_PATH)) \
17 seems 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)
19 endif
20 endif
22 CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
23 CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
24 CONFIG_ALL=y
25 -include config-all-devices.mak
26 -include config-all-disas.mak
28 include $(SRC_PATH)/rules.mak
29 config-host.mak: $(SRC_PATH)/configure
30 @echo $@ is out-of-date, running configure
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; \
39 else
40 config-host.mak:
41 ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
42 @echo "Please call configure before running make!"
43 @exit 1
44 endif
45 endif
47 GENERATED_HEADERS = config-host.h qemu-options.def
48 GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
49 GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
51 GENERATED_HEADERS += trace/generated-events.h
52 GENERATED_SOURCES += trace/generated-events.c
54 GENERATED_HEADERS += trace/generated-tracers.h
55 ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
56 GENERATED_HEADERS += trace/generated-tracers-dtrace.h
57 endif
58 GENERATED_SOURCES += trace/generated-tracers.c
60 ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
61 GENERATED_HEADERS += trace/generated-ust-provider.h
62 GENERATED_SOURCES += trace/generated-ust.c
63 endif
65 # Don't try to regenerate Makefile or configure
66 # We don't generate any of them
67 Makefile: ;
68 configure: ;
70 .PHONY: all clean cscope dist distclean doc dvi html \
71 info install install-doc install-tools \
72 pdf recurse-all speed test tools
74 $(call set-vpath, $(SRC_PATH))
76 LIBS+=-lz $(LIBS_TOOLS)
78 HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
80 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
81 ifdef CONFIG_VIRTFS
82 DOCS+=fsdev/virtfs-proxy-helper.1
83 endif
85 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
86 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
87 SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
89 ifeq ($(SUBDIR_DEVICES_MAK),)
90 config-all-devices.mak:
91 $(call quiet-command,echo '# no devices' > $@," GEN $@")
92 else
93 config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
94 $(call quiet-command, sed -n \
95 's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
96 $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
97 " GEN $@")
98 endif
100 -include $(SUBDIR_DEVICES_MAK_DEP)
102 %/config-devices.mak: default-configs/%.mak
103 $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, " GEN $@")
104 @if test -f $@; then \
105 if cmp -s $@.old $@; then \
106 mv $@.tmp $@; \
107 cp -p $@ $@.old; \
108 else \
109 if test -f $@.old; then \
110 echo "WARNING: $@ (user modified) out of date.";\
111 else \
112 echo "WARNING: $@ out of date.";\
113 fi; \
114 echo "Run \"make defconfig\" to regenerate."; \
115 rm $@.tmp; \
116 fi; \
117 else \
118 mv $@.tmp $@; \
119 cp -p $@ $@.old; \
122 defconfig:
123 rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
125 ifneq ($(wildcard config-host.mak),)
126 include $(SRC_PATH)/Makefile.objs
127 endif
129 dummy := $(call unnest-vars,, \
130 stub-obj-y \
131 util-obj-y \
132 qga-obj-y \
133 qga-vss-dll-obj-y \
134 block-obj-y \
135 block-obj-m \
136 common-obj-y \
137 common-obj-m)
139 ifneq ($(wildcard config-host.mak),)
140 include $(SRC_PATH)/tests/Makefile
141 endif
142 ifeq ($(CONFIG_SMARTCARD_NSS),y)
143 include $(SRC_PATH)/libcacard/Makefile
144 endif
146 all: recurse-all
148 ifdef BUILD_DOCS
149 all: doc
150 endif
152 ifdef BUILD_TOOLS
153 all: tools
154 endif
156 all: $(HELPERS-y)
157 all: modules
159 doc: $(DOCS)
160 tools: $(TOOLS)
162 config-host.h: config-host.h-timestamp
163 config-host.h-timestamp: config-host.mak
164 qemu-options.def: $(SRC_PATH)/qemu-options.hx
165 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@")
167 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
168 SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
170 $(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
171 $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
173 subdir-%:
174 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
176 subdir-pixman: pixman/Makefile
177 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
179 pixman/Makefile: $(SRC_PATH)/pixman/configure
180 (cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
182 $(SRC_PATH)/pixman/configure:
183 (cd $(SRC_PATH)/pixman; autoreconf -v --install)
185 DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
186 DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
187 DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
189 subdir-dtc:dtc/libfdt dtc/tests
190 $(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,)
192 dtc/%:
193 mkdir -p $@
195 $(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
197 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
198 romsubdir-%:
199 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
201 ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
203 recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
205 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
206 $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<," RC version.o")
207 $(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
208 $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<," RC version.lo")
210 Makefile: $(version-obj-y) $(version-lobj-y)
212 ######################################################################
213 # Build libraries
215 libqemustub.a: $(stub-obj-y)
216 libqemuutil.a: $(util-obj-y) qapi-types.o qapi-visit.o qapi-event.o
218 block-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
219 util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
221 ######################################################################
223 qemu-img.o: qemu-img-cmds.h
225 qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
226 qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
227 qemu-io$(EXESUF): qemu-io.o $(block-obj-y) libqemuutil.a libqemustub.a
229 qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
231 fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a
232 fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
234 qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
235 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@")
237 qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
238 qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
240 gen-out-type = $(subst .,-,$(suffix $@))
242 qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
244 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
245 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
246 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
247 $(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
248 " GEN $@")
249 qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
250 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
251 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
252 $(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
253 " GEN $@")
254 qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
255 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
256 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
257 $(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
258 " GEN $@")
260 qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
261 $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
262 $(SRC_PATH)/qapi/event.json
264 qapi-types.c qapi-types.h :\
265 $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
266 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
267 $(gen-out-type) -o "." -b -i $<, \
268 " GEN $@")
269 qapi-visit.c qapi-visit.h :\
270 $(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
271 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
272 $(gen-out-type) -o "." -b -i $<, \
273 " GEN $@")
274 qapi-event.c qapi-event.h :\
275 $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
276 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
277 $(gen-out-type) -o "." -b -i $<, \
278 " GEN $@")
279 qmp-commands.h qmp-marshal.c :\
280 $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
281 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
282 $(gen-out-type) -o "." -m -i $<, \
283 " GEN $@")
285 QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
286 $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
288 qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
289 $(call LINK, $^)
291 clean:
292 # avoid old build problems by removing potentially incorrect old files
293 rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
294 rm -f qemu-options.def
295 find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
296 rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
297 rm -f fsdev/*.pod
298 rm -rf .libs */.libs
299 rm -f qemu-img-cmds.h
300 @# May not be present in GENERATED_HEADERS
301 rm -f trace/generated-tracers-dtrace.dtrace*
302 rm -f trace/generated-tracers-dtrace.h*
303 rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
304 rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
305 rm -rf qapi-generated
306 rm -rf qga/qapi-generated
307 for d in $(ALL_SUBDIRS); do \
308 if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
309 rm -f $$d/qemu-options.def; \
310 done
312 VERSION ?= $(shell cat VERSION)
314 dist: qemu-$(VERSION).tar.bz2
316 qemu-%.tar.bz2:
317 $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
319 distclean: clean
320 rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
321 rm -f config-all-devices.mak config-all-disas.mak
322 rm -f po/*.mo
323 rm -f roms/seabios/config.mak roms/vgabios/config.mak
324 rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
325 rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
326 rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
327 rm -f qemu-doc.vr
328 rm -f config.log
329 rm -f linux-headers/asm
330 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
331 for d in $(TARGET_DIRS); do \
332 rm -rf $$d || exit 1 ; \
333 done
334 rm -Rf .sdk
335 if test -f pixman/config.log; then make -C pixman distclean; fi
336 if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
338 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
339 ar de en-us fi fr-be hr it lv nl pl ru th \
340 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr \
341 bepo cz
343 ifdef INSTALL_BLOBS
344 BLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
345 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
346 acpi-dsdt.aml q35-acpi-dsdt.aml \
347 ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
348 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
349 pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
350 efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
351 efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
352 qemu-icon.bmp qemu_logo_no_text.svg \
353 bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
354 multiboot.bin linuxboot.bin kvmvapic.bin \
355 s390-zipl.rom \
356 s390-ccw.img \
357 spapr-rtas.bin slof.bin \
358 palcode-clipper \
359 u-boot.e500
360 else
361 BLOBS=
362 endif
364 install-doc: doc
365 $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
366 $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
367 $(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
368 ifdef CONFIG_POSIX
369 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
370 $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
371 ifneq ($(TOOLS),)
372 $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1"
373 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
374 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
375 endif
376 endif
377 ifdef CONFIG_VIRTFS
378 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
379 $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
380 endif
382 install-datadir:
383 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
385 install-localstatedir:
386 ifdef CONFIG_POSIX
387 ifneq (,$(findstring qemu-ga,$(TOOLS)))
388 $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
389 endif
390 endif
392 install-confdir:
393 $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
395 install-sysconfig: install-datadir install-confdir
396 $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
398 install-tools: tools
400 install: all $(if $(BUILD_DOCS),install-doc) $(if $(BUILD_TOOLS),install-tools) install-sysconfig \
401 install-datadir install-localstatedir
402 ifneq ($(TOOLS),)
403 $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
404 endif
405 ifneq ($(CONFIG_MODULES),)
406 $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
407 for s in $(modules-m:.mo=$(DSOSUF)); do \
408 t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
409 $(INSTALL_LIB) $$s "$$t"; \
410 test -z "$(STRIP)" || $(STRIP) "$$t"; \
411 done
412 endif
413 ifneq ($(HELPERS-y),)
414 $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
415 endif
416 ifneq ($(BLOBS),)
417 set -e; for x in $(BLOBS); do \
418 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
419 done
420 endif
421 ifeq ($(CONFIG_GTK),y)
422 $(MAKE) -C po $@
423 endif
424 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
425 set -e; for x in $(KEYMAPS); do \
426 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
427 done
428 for d in $(TARGET_DIRS); do \
429 $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
430 done
432 # various test targets
433 test speed: all
434 $(MAKE) -C tests/tcg $@
436 .PHONY: TAGS
437 TAGS:
438 rm -f $@
439 find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
441 cscope:
442 rm -f ./cscope.*
443 find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
444 cscope -b
446 # documentation
447 MAKEINFO=makeinfo
448 MAKEINFOFLAGS=--no-headers --no-split --number-sections
449 TEXIFLAG=$(if $(V),,--quiet)
450 %.dvi: %.texi
451 $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@")
453 %.html: %.texi
454 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
455 " GEN $@")
457 %.info: %.texi
458 $(call quiet-command,$(MAKEINFO) $< -o $@," GEN $@")
460 %.pdf: %.texi
461 $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<," GEN $@")
463 qemu-options.texi: $(SRC_PATH)/qemu-options.hx
464 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
466 qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
467 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
469 qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
470 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@," GEN $@")
472 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
473 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
475 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
476 $(call quiet-command, \
477 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
478 $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
479 " GEN $@")
481 qemu-img.1: qemu-img.texi qemu-img-cmds.texi
482 $(call quiet-command, \
483 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
484 $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
485 " GEN $@")
487 fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
488 $(call quiet-command, \
489 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
490 $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
491 " GEN $@")
493 qemu-nbd.8: qemu-nbd.texi
494 $(call quiet-command, \
495 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
496 $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
497 " GEN $@")
499 dvi: qemu-doc.dvi qemu-tech.dvi
500 html: qemu-doc.html qemu-tech.html
501 info: qemu-doc.info qemu-tech.info
502 pdf: qemu-doc.pdf qemu-tech.pdf
504 qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
505 qemu-img.texi qemu-nbd.texi qemu-options.texi \
506 qemu-monitor.texi qemu-img-cmds.texi
508 ifdef CONFIG_WIN32
510 INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
512 nsisflags = -V2 -NOCD
514 ifneq ($(wildcard $(SRC_PATH)/dll),)
515 ifeq ($(ARCH),x86_64)
516 # 64 bit executables
517 DLL_PATH = $(SRC_PATH)/dll/w64
518 nsisflags += -DW64
519 else
520 # 32 bit executables
521 DLL_PATH = $(SRC_PATH)/dll/w32
522 endif
523 endif
525 .PHONY: installer
526 installer: $(INSTALLER)
528 INSTDIR=/tmp/qemu-nsis
530 $(INSTALLER): $(SRC_PATH)/qemu.nsi
531 make install prefix=${INSTDIR}
532 ifdef SIGNCODE
533 (cd ${INSTDIR}; \
534 for i in *.exe; do \
535 $(SIGNCODE) $${i}; \
536 done \
538 endif # SIGNCODE
539 (cd ${INSTDIR}; \
540 for i in qemu-system-*.exe; do \
541 arch=$${i%.exe}; \
542 arch=$${arch#qemu-system-}; \
543 echo Section \"$$arch\" Section_$$arch; \
544 echo SetOutPath \"\$$INSTDIR\"; \
545 echo File \"\$${BINDIR}\\$$i\"; \
546 echo SectionEnd; \
547 done \
548 ) >${INSTDIR}/system-emulations.nsh
549 makensis $(nsisflags) \
550 $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
551 $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
552 -DBINDIR="${INSTDIR}" \
553 $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
554 -DSRCDIR="$(SRC_PATH)" \
555 -DOUTFILE="$(INSTALLER)" \
556 $(SRC_PATH)/qemu.nsi
557 rm -r ${INSTDIR}
558 ifdef SIGNCODE
559 $(SIGNCODE) $(INSTALLER)
560 endif # SIGNCODE
561 endif # CONFIG_WIN
563 # Add a dependency on the generated files, so that they are always
564 # rebuilt before other object files
565 ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
566 Makefile: $(GENERATED_HEADERS)
567 endif
569 # Include automatically generated dependency files
570 # Dependencies in Makefile.objs files come from our recursive subdir rules
571 -include $(wildcard *.d tests/*.d)