Merge remote-tracking branch 'qemu/master'
[qemu/ar7.git] / Makefile
blob8f90011bd6f25874fb97da96c2a8fc44bb3f18ea
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 else
360 BLOBS=
361 endif
363 install-doc: doc
364 $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
365 $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
366 $(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
367 ifdef CONFIG_POSIX
368 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
369 $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
370 ifneq ($(TOOLS),)
371 $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1"
372 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
373 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
374 endif
375 endif
376 ifdef CONFIG_VIRTFS
377 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
378 $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
379 endif
381 install-datadir:
382 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
384 install-localstatedir:
385 ifdef CONFIG_POSIX
386 ifneq (,$(findstring qemu-ga,$(TOOLS)))
387 $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
388 endif
389 endif
391 install-confdir:
392 $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
394 install-sysconfig: install-datadir install-confdir
395 $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
397 install-tools: tools
399 install: all $(if $(BUILD_DOCS),install-doc) $(if $(BUILD_TOOLS),install-tools) install-sysconfig \
400 install-datadir install-localstatedir
401 ifneq ($(TOOLS),)
402 $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
403 endif
404 ifneq ($(CONFIG_MODULES),)
405 $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
406 for s in $(modules-m:.mo=$(DSOSUF)); do \
407 t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
408 $(INSTALL_LIB) $$s "$$t"; \
409 test -z "$(STRIP)" || $(STRIP) "$$t"; \
410 done
411 endif
412 ifneq ($(HELPERS-y),)
413 $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir))
414 endif
415 ifneq ($(BLOBS),)
416 set -e; for x in $(BLOBS); do \
417 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
418 done
419 endif
420 ifeq ($(CONFIG_GTK),y)
421 $(MAKE) -C po $@
422 endif
423 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
424 set -e; for x in $(KEYMAPS); do \
425 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
426 done
427 for d in $(TARGET_DIRS); do \
428 $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
429 done
431 # various test targets
432 test speed: all
433 $(MAKE) -C tests/tcg $@
435 .PHONY: TAGS
436 TAGS:
437 rm -f $@
438 find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
440 cscope:
441 rm -f ./cscope.*
442 find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
443 cscope -b
445 # documentation
446 MAKEINFO=makeinfo
447 MAKEINFOFLAGS=--no-headers --no-split --number-sections
448 TEXIFLAG=$(if $(V),,--quiet)
449 %.dvi: %.texi
450 $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@")
452 %.html: %.texi
453 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
454 " GEN $@")
456 %.info: %.texi
457 $(call quiet-command,$(MAKEINFO) $< -o $@," GEN $@")
459 %.pdf: %.texi
460 $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<," GEN $@")
462 qemu-options.texi: $(SRC_PATH)/qemu-options.hx
463 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
465 qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
466 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
468 qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
469 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@," GEN $@")
471 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
472 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")
474 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
475 $(call quiet-command, \
476 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
477 $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
478 " GEN $@")
480 qemu-img.1: qemu-img.texi qemu-img-cmds.texi
481 $(call quiet-command, \
482 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
483 $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
484 " GEN $@")
486 fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
487 $(call quiet-command, \
488 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
489 $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
490 " GEN $@")
492 qemu-nbd.8: qemu-nbd.texi
493 $(call quiet-command, \
494 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
495 $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
496 " GEN $@")
498 dvi: qemu-doc.dvi qemu-tech.dvi
499 html: qemu-doc.html qemu-tech.html
500 info: qemu-doc.info qemu-tech.info
501 pdf: qemu-doc.pdf qemu-tech.pdf
503 qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
504 qemu-img.texi qemu-nbd.texi qemu-options.texi \
505 qemu-monitor.texi qemu-img-cmds.texi
507 ifdef CONFIG_WIN32
509 INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
511 nsisflags = -V2 -NOCD
513 ifneq ($(wildcard $(SRC_PATH)/dll),)
514 ifeq ($(ARCH),x86_64)
515 # 64 bit executables
516 DLL_PATH = $(SRC_PATH)/dll/w64
517 nsisflags += -DW64
518 else
519 # 32 bit executables
520 DLL_PATH = $(SRC_PATH)/dll/w32
521 endif
522 endif
524 .PHONY: installer
525 installer: $(INSTALLER)
527 INSTDIR=/tmp/qemu-nsis
529 $(INSTALLER): $(SRC_PATH)/qemu.nsi
530 make install prefix=${INSTDIR}
531 ifdef SIGNCODE
532 (cd ${INSTDIR}; \
533 for i in *.exe; do \
534 $(SIGNCODE) $${i}; \
535 done \
537 endif # SIGNCODE
538 (cd ${INSTDIR}; \
539 for i in qemu-system-*.exe; do \
540 arch=$${i%.exe}; \
541 arch=$${arch#qemu-system-}; \
542 echo Section \"$$arch\" Section_$$arch; \
543 echo SetOutPath \"\$$INSTDIR\"; \
544 echo File \"\$${BINDIR}\\$$i\"; \
545 echo SectionEnd; \
546 done \
547 ) >${INSTDIR}/system-emulations.nsh
548 makensis $(nsisflags) \
549 $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
550 $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
551 -DBINDIR="${INSTDIR}" \
552 $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
553 -DSRCDIR="$(SRC_PATH)" \
554 -DOUTFILE="$(INSTALLER)" \
555 $(SRC_PATH)/qemu.nsi
556 rm -r ${INSTDIR}
557 ifdef SIGNCODE
558 $(SIGNCODE) $(INSTALLER)
559 endif # SIGNCODE
560 endif # CONFIG_WIN
562 # Add a dependency on the generated files, so that they are always
563 # rebuilt before other object files
564 ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
565 Makefile: $(GENERATED_HEADERS)
566 endif
568 # Include automatically generated dependency files
569 # Dependencies in Makefile.objs files come from our recursive subdir rules
570 -include $(wildcard *.d tests/*.d)