Statistics
| Branch: | Revision:

root / Makefile @ 992aeb8e

History | View | Annotate | Download (14.4 kB)

1 0cb3fb1e pbrook
# Makefile for QEMU.
2 0cb3fb1e pbrook
3 519e1693 Stefan Weil
# Always point to the root of the build tree (needs GNU make).
4 519e1693 Stefan Weil
BUILD_DIR=$(CURDIR)
5 388d4758 Lluís Vilanova
6 250b086e Lluís Vilanova
# All following code might depend on configuration variables
7 55d7e8f6 aurel32
ifneq ($(wildcard config-host.mak),)
8 1ad2134f Paul Brook
# Put the all: rule here so that config-host.mak can contain dependencies.
9 8f67aa82 Stefan Weil
all:
10 ad064840 pbrook
include config-host.mak
11 d1bd2423 Peter Maydell
12 d1bd2423 Peter Maydell
# Check that we're not trying to do an out-of-tree build from
13 d1bd2423 Peter Maydell
# a tree that's been used for an in-tree build.
14 d1bd2423 Peter Maydell
ifneq ($(realpath $(SRC_PATH)),$(realpath .))
15 d1bd2423 Peter Maydell
ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
16 d1bd2423 Peter Maydell
$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
17 d1bd2423 Peter Maydell
seems to have been used for an in-tree build. You can fix this by running \
18 d1bd2423 Peter Maydell
"make distclean && rm -rf *-linux-user *-softmmu" in your source tree)
19 d1bd2423 Peter Maydell
endif
20 d1bd2423 Peter Maydell
endif
21 d1bd2423 Peter Maydell
22 17759187 aliguori
include $(SRC_PATH)/rules.mak
23 59bc10ee Paolo Bonzini
config-host.mak: $(SRC_PATH)/configure
24 e5efe7f5 Juan Quintela
	@echo $@ is out-of-date, running configure
25 e5efe7f5 Juan Quintela
	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
26 55d7e8f6 aurel32
else
27 55d7e8f6 aurel32
config-host.mak:
28 7748b8cb Mike Frysinger
ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
29 55d7e8f6 aurel32
	@echo "Please call configure before running make!"
30 55d7e8f6 aurel32
	@exit 1
31 55d7e8f6 aurel32
endif
32 7748b8cb Mike Frysinger
endif
33 766a487a bellard
34 eac236ea Lluís Vilanova
GENERATED_HEADERS = config-host.h qemu-options.def
35 eac236ea Lluís Vilanova
GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
36 eac236ea Lluís Vilanova
GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
37 eac236ea Lluís Vilanova
38 eac236ea Lluís Vilanova
GENERATED_HEADERS += trace/generated-tracers.h
39 250b086e Lluís Vilanova
ifeq ($(TRACE_BACKEND),dtrace)
40 eac236ea Lluís Vilanova
GENERATED_HEADERS += trace/generated-tracers-dtrace.h
41 250b086e Lluís Vilanova
endif
42 eac236ea Lluís Vilanova
GENERATED_SOURCES += trace/generated-tracers.c
43 250b086e Lluís Vilanova
44 d9ace8b3 Juan Quintela
# Don't try to regenerate Makefile or configure
45 d9ace8b3 Juan Quintela
# We don't generate any of them
46 d9ace8b3 Juan Quintela
Makefile: ;
47 d9ace8b3 Juan Quintela
configure: ;
48 d9ace8b3 Juan Quintela
49 818220f5 aliguori
.PHONY: all clean cscope distclean dvi html info install install-doc \
50 34bb443e Anthony Liguori
	pdf recurse-all speed test dist
51 0cb3fb1e pbrook
52 fec90ff0 Paolo Bonzini
$(call set-vpath, $(SRC_PATH))
53 8c462f8f pbrook
54 3e2e0e6b Juan Quintela
LIBS+=-lz $(LIBS_TOOLS)
55 67c0f08d Juan Quintela
56 7b93fadf Corey Bryant
HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
57 7b93fadf Corey Bryant
58 cc8ae6de pbrook
ifdef BUILD_DOCS
59 b40292e7 Jan Kiszka
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
60 983eef5a Meador Inge
ifdef CONFIG_VIRTFS
61 a2d8f1be M. Mohan Kumar
DOCS+=fsdev/virtfs-proxy-helper.1
62 983eef5a Meador Inge
endif
63 cc8ae6de pbrook
else
64 cc8ae6de pbrook
DOCS=
65 cc8ae6de pbrook
endif
66 aa05ae6f bellard
67 388d4758 Lluís Vilanova
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
68 1f3d3c8f Juan Quintela
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
69 bd9141bb Paul Brook
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
70 1f3d3c8f Juan Quintela
71 8bdd3d49 Stefan Weil
ifeq ($(SUBDIR_DEVICES_MAK),)
72 8bdd3d49 Stefan Weil
config-all-devices.mak:
73 8bdd3d49 Stefan Weil
	$(call quiet-command,echo '# no devices' > $@,"  GEN   $@")
74 8bdd3d49 Stefan Weil
else
75 1f3d3c8f Juan Quintela
config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
76 01d86a85 Stefan Weil
	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
77 8bdd3d49 Stefan Weil
endif
78 1f3d3c8f Juan Quintela
79 bd9141bb Paul Brook
-include $(SUBDIR_DEVICES_MAK_DEP)
80 bd9141bb Paul Brook
81 a992fe3d Paul Brook
%/config-devices.mak: default-configs/%.mak
82 4c3b5a48 Blue Swirl
	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
83 012f0879 Stefan Weil
	@if test -f $@; then \
84 904fe1fb Blue Swirl
	  if cmp -s $@.old $@; then \
85 bd9141bb Paul Brook
	    mv $@.tmp $@; \
86 bd9141bb Paul Brook
	    cp -p $@ $@.old; \
87 012f0879 Stefan Weil
	  else \
88 012f0879 Stefan Weil
	    if test -f $@.old; then \
89 012f0879 Stefan Weil
	      echo "WARNING: $@ (user modified) out of date.";\
90 012f0879 Stefan Weil
	    else \
91 012f0879 Stefan Weil
	      echo "WARNING: $@ out of date.";\
92 012f0879 Stefan Weil
	    fi; \
93 012f0879 Stefan Weil
	    echo "Run \"make defconfig\" to regenerate."; \
94 012f0879 Stefan Weil
	    rm $@.tmp; \
95 012f0879 Stefan Weil
	  fi; \
96 a992fe3d Paul Brook
	 else \
97 012f0879 Stefan Weil
	  mv $@.tmp $@; \
98 012f0879 Stefan Weil
	  cp -p $@ $@.old; \
99 a992fe3d Paul Brook
	 fi
100 a992fe3d Paul Brook
101 a992fe3d Paul Brook
defconfig:
102 a992fe3d Paul Brook
	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
103 a992fe3d Paul Brook
104 1f3d3c8f Juan Quintela
-include config-all-devices.mak
105 76cad711 Paolo Bonzini
-include config-all-disas.mak
106 1215c6e7 Juan Quintela
107 992aeb8e Paolo Bonzini
ifneq ($(wildcard config-host.mak),)
108 992aeb8e Paolo Bonzini
include $(SRC_PATH)/Makefile.objs
109 992aeb8e Paolo Bonzini
include $(SRC_PATH)/tests/Makefile
110 992aeb8e Paolo Bonzini
endif
111 992aeb8e Paolo Bonzini
ifeq ($(CONFIG_SMARTCARD_NSS),y)
112 992aeb8e Paolo Bonzini
include $(SRC_PATH)/libcacard/Makefile
113 992aeb8e Paolo Bonzini
endif
114 992aeb8e Paolo Bonzini
115 8f67aa82 Stefan Weil
all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
116 b9dea4fb pbrook
117 1215c6e7 Juan Quintela
config-host.h: config-host.h-timestamp
118 1215c6e7 Juan Quintela
config-host.h-timestamp: config-host.mak
119 e14056ad Blue Swirl
qemu-options.def: $(SRC_PATH)/qemu-options.hx
120 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
121 1215c6e7 Juan Quintela
122 cec7d0b6 pbrook
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
123 cec7d0b6 pbrook
124 4115852b Paolo Bonzini
subdir-%:
125 0087375e Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
126 4aa42531 pbrook
127 e2134eb9 Gerd Hoffmann
subdir-pixman: pixman/Makefile
128 e2134eb9 Gerd Hoffmann
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
129 e2134eb9 Gerd Hoffmann
130 e2134eb9 Gerd Hoffmann
pixman/Makefile: $(SRC_PATH)/pixman/configure
131 c28fa5a0 Gerd Hoffmann
	(cd pixman; CFLAGS="$(CFLAGS) -fPIC" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
132 e2134eb9 Gerd Hoffmann
133 e2134eb9 Gerd Hoffmann
$(SRC_PATH)/pixman/configure:
134 e2134eb9 Gerd Hoffmann
	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
135 e2134eb9 Gerd Hoffmann
136 16529ced Stefan Weil
$(SUBDIR_RULES): libqemustub.a
137 16529ced Stefan Weil
138 76cad711 Paolo Bonzini
$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y)
139 c05ac895 Paul Brook
140 8e98e2e8 Paolo Bonzini
$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(user-obj-y)
141 add16157 Blue Swirl
142 c05ac895 Paul Brook
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
143 c05ac895 Paul Brook
romsubdir-%:
144 c05ac895 Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
145 c05ac895 Paul Brook
146 c05ac895 Paul Brook
ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
147 c05ac895 Paul Brook
148 c05ac895 Paul Brook
recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
149 83f64091 bellard
150 a558ee17 Juan Quintela
bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
151 4fb240a4 bellard
152 7948a665 Blue Swirl
version.o: $(SRC_PATH)/version.rc config-host.h
153 9fe6de94 Blue Swirl
	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
154 9fe6de94 Blue Swirl
155 9fe6de94 Blue Swirl
version-obj-$(CONFIG_WIN32) += version.o
156 3bc2f570 Paolo Bonzini
157 3bc2f570 Paolo Bonzini
######################################################################
158 3bc2f570 Paolo Bonzini
# Build library with stubs
159 3bc2f570 Paolo Bonzini
160 3bc2f570 Paolo Bonzini
libqemustub.a: $(stub-obj-y)
161 3bc2f570 Paolo Bonzini
162 4fb240a4 bellard
######################################################################
163 4fb240a4 bellard
164 3c089e15 Juan Quintela
qemu-img.o: qemu-img-cmds.h
165 153859be Stuart Brady
166 5708fc66 Paolo Bonzini
tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-timer.o \
167 136594f1 Paolo Bonzini
	main-loop.o iohandler.o error.o
168 cbcfa041 Paolo Bonzini
tools-obj-$(CONFIG_POSIX) += compatfd.o
169 0e8c9214 Andreas Färber
170 3bc2f570 Paolo Bonzini
qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemustub.a
171 3bc2f570 Paolo Bonzini
qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemustub.a
172 3bc2f570 Paolo Bonzini
qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemustub.a
173 0a8e1acd aliguori
174 7b93fadf Corey Bryant
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
175 7b93fadf Corey Bryant
176 ea75fc4e M. Mohan Kumar
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
177 17bff52b M. Mohan Kumar
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
178 17bff52b M. Mohan Kumar
179 153859be Stuart Brady
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
180 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
181 153859be Stuart Brady
182 957f1f99 Michael Roth
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
183 54c2e502 Dunrong Huang
qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
184 640e5404 Michael Roth
185 19bf7c87 Avi Kivity
gen-out-type = $(subst .,-,$(suffix $@))
186 8d3bc517 Avi Kivity
187 0521d375 Stefan Hajnoczi
qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
188 0521d375 Stefan Hajnoczi
189 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
190 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
191 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
192 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
193 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
194 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
195 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
196 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
197 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
198 e3d4d252 Michael Roth
199 599825c5 Michael S. Tsirkin
qapi-types.c qapi-types.h :\
200 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
201 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
202 599825c5 Michael S. Tsirkin
qapi-visit.c qapi-visit.h :\
203 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
204 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
205 599825c5 Michael S. Tsirkin
qmp-commands.h qmp-marshal.c :\
206 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
207 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
208 e3193601 Anthony Liguori
209 54c2e502 Dunrong Huang
QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
210 4115852b Paolo Bonzini
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
211 957f1f99 Michael Roth
212 2870dc34 Paolo Bonzini
qemu-ga$(EXESUF): $(qga-obj-y) $(oslib-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a
213 2870dc34 Paolo Bonzini
	$(call LINK, $^)
214 48ff7a62 Michael Roth
215 31e31b8a bellard
clean:
216 2d80ae89 bellard
# avoid old build problems by removing potentially incorrect old files
217 25be210f Juan 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
218 df2943ba Michael S. Tsirkin
	rm -f qemu-options.def
219 96610da2 Tomoki Sekiyama
	find . -name '*.[od]' -type f -exec rm -f {} +
220 e743ccec Peter Maydell
	rm -f *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
221 992aeb8e Paolo Bonzini
	rm -f *.la
222 44dc0ca3 Alon Levy
	rm -Rf .libs
223 07b44ce9 Blue Swirl
	rm -f qemu-img-cmds.h
224 19ac36b5 Lluís Vilanova
	@# May not be present in GENERATED_HEADERS
225 eac236ea Lluís Vilanova
	rm -f trace/generated-tracers-dtrace.dtrace*
226 eac236ea Lluís Vilanova
	rm -f trace/generated-tracers-dtrace.h*
227 19ac36b5 Lluís Vilanova
	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
228 19ac36b5 Lluís Vilanova
	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
229 8f0e5c6b Stefan Weil
	rm -rf qapi-generated
230 54c2e502 Dunrong Huang
	rm -rf qga/qapi-generated
231 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg clean
232 8e98e2e8 Paolo Bonzini
	for d in $(ALL_SUBDIRS) libcacard; do \
233 fc8e320e Magnus Damm
	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
234 df2943ba Michael S. Tsirkin
	rm -f $$d/qemu-options.def; \
235 626df76a bellard
        done
236 31e31b8a bellard
237 34bb443e Anthony Liguori
VERSION ?= $(shell cat VERSION)
238 34bb443e Anthony Liguori
239 34bb443e Anthony Liguori
dist: qemu-$(VERSION).tar.bz2
240 34bb443e Anthony Liguori
241 34bb443e Anthony Liguori
qemu-%.tar.bz2:
242 34bb443e Anthony Liguori
	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
243 34bb443e Anthony Liguori
244 7d13299d bellard
distclean: clean
245 fc8e320e Magnus Damm
	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
246 76cad711 Paolo Bonzini
	rm -f config-all-devices.mak config-all-disas.mak
247 fc8e320e Magnus Damm
	rm -f roms/seabios/config.mak roms/vgabios/config.mak
248 7a734b8f Brad Hards
	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
249 7a734b8f Brad Hards
	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
250 7a734b8f Brad Hards
	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
251 7a734b8f Brad Hards
	rm -f qemu-doc.vr
252 793553ac Alexandre Raymond
	rm -f config.log
253 67ed96f9 Peter Maydell
	rm -f linux-headers/asm
254 e1a068b2 Hidetoshi 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
255 8e98e2e8 Paolo Bonzini
	for d in $(TARGET_DIRS); do \
256 bc1b050d bellard
	rm -rf $$d || exit 1 ; \
257 76bc6838 bellard
        done
258 a85903ff Wenchao Xia
	if test -f pixman/config.log; then make -C pixman distclean; fi
259 7d13299d bellard
260 fed4a9ad bellard
KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
261 fed4a9ad bellard
ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
262 471fbf4a Frédéric Boiteux
common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
263 471fbf4a Frédéric Boiteux
bepo
264 fed4a9ad bellard
265 77755340 ths
ifdef INSTALL_BLOBS
266 6329866f Paolo Bonzini
BLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
267 7943a2fa Gerd Hoffmann
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
268 7e973bb2 Laszlo Ersek
acpi-dsdt.aml q35-acpi-dsdt.aml \
269 3b3d448e Gerd Hoffmann
ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
270 5ee8ad71 Alex Williamson
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
271 5ee8ad71 Alex Williamson
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
272 94b26294 Stefan Weil
qemu-icon.bmp \
273 00914b7d Michal Simek
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
274 2a2af967 Jan Kiszka
multiboot.bin linuxboot.bin kvmvapic.bin \
275 39ac8455 David Gibson
s390-zipl.rom \
276 753d11f2 Richard Henderson
spapr-rtas.bin slof.bin \
277 753d11f2 Richard Henderson
palcode-clipper
278 77755340 ths
else
279 77755340 ths
BLOBS=
280 77755340 ths
endif
281 77755340 ths
282 38954dca pbrook
install-doc: $(DOCS)
283 d7dd65ba Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
284 d7dd65ba Eduardo Habkost
	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
285 0cd23fcc Bruce Rogers
	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
286 96d409eb Juan Quintela
ifdef CONFIG_POSIX
287 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
288 58f8aead aliguori
	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
289 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
290 58f8aead aliguori
	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
291 38954dca pbrook
endif
292 a2d8f1be M. Mohan Kumar
ifdef CONFIG_VIRTFS
293 a2d8f1be M. Mohan Kumar
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
294 a2d8f1be M. Mohan Kumar
	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
295 a2d8f1be M. Mohan Kumar
endif
296 e2d87bff Eduardo Habkost
297 e2d87bff Eduardo Habkost
install-datadir:
298 e2d87bff Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
299 e2d87bff Eduardo Habkost
300 e2d87bff Eduardo Habkost
install-confdir:
301 80465e80 Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
302 e2d87bff Eduardo Habkost
303 e2d87bff Eduardo Habkost
install-sysconfig: install-datadir install-confdir
304 80465e80 Eduardo Habkost
	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
305 b5ec5ce0 john cooper
306 e2d87bff Eduardo Habkost
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir
307 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
308 932a79df ths
ifneq ($(TOOLS),)
309 58f8aead aliguori
	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
310 932a79df ths
endif
311 7b93fadf Corey Bryant
ifneq ($(HELPERS-y),)
312 7b93fadf Corey Bryant
	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
313 7b93fadf Corey Bryant
	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
314 7b93fadf Corey Bryant
endif
315 77755340 ths
ifneq ($(BLOBS),)
316 77755340 ths
	set -e; for x in $(BLOBS); do \
317 6aae2a2e Eduardo Habkost
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
318 ad064840 pbrook
	done
319 77755340 ths
endif
320 6aae2a2e Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
321 18be8d77 blueswir1
	set -e; for x in $(KEYMAPS); do \
322 6aae2a2e Eduardo Habkost
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
323 ad064840 pbrook
	done
324 626df76a bellard
	for d in $(TARGET_DIRS); do \
325 7d3505c5 bellard
	$(MAKE) -C $$d $@ || exit 1 ; \
326 626df76a bellard
        done
327 612384d7 bellard
328 367e86e8 bellard
# various test targets
329 9b0b8203 bellard
test speed: all
330 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg $@
331 31e31b8a bellard
332 21d4e8e3 Alexandre Bique
.PHONY: TAGS
333 5fafdf24 ths
TAGS:
334 21d4e8e3 Alexandre Bique
	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
335 31e31b8a bellard
336 6688bc6d bellard
cscope:
337 6688bc6d bellard
	rm -f ./cscope.*
338 45b75ae4 Alexandre Raymond
	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
339 6688bc6d bellard
	cscope -b
340 6688bc6d bellard
341 3ef693a0 bellard
# documentation
342 01668d98 Stefan Weil
MAKEINFO=makeinfo
343 01668d98 Stefan Weil
MAKEINFOFLAGS=--no-headers --no-split --number-sections
344 20cc9997 Stefan Weil
TEXIFLAG=$(if $(V),,--quiet)
345 20cc9997 Stefan Weil
%.dvi: %.texi
346 20cc9997 Stefan Weil
	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
347 20cc9997 Stefan Weil
348 1f673135 bellard
%.html: %.texi
349 952ef67c Stefan Weil
	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
350 01668d98 Stefan Weil
	"  GEN   $@")
351 3ef693a0 bellard
352 f3548328 bellard
%.info: %.texi
353 01668d98 Stefan Weil
	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
354 f3548328 bellard
355 20cc9997 Stefan Weil
%.pdf: %.texi
356 20cc9997 Stefan Weil
	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
357 5824d651 blueswir1
358 5824d651 blueswir1
qemu-options.texi: $(SRC_PATH)/qemu-options.hx
359 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
360 f3548328 bellard
361 acd0a093 Luiz Capitulino
qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
362 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
363 2313086a Blue Swirl
364 82a56f0d Luiz Capitulino
QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
365 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
366 b40292e7 Jan Kiszka
367 153859be Stuart Brady
qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
368 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
369 153859be Stuart Brady
370 2313086a Blue Swirl
qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
371 0d00e563 aliguori
	$(call quiet-command, \
372 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
373 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
374 0d00e563 aliguori
	  "  GEN   $@")
375 5a67135a bellard
376 153859be Stuart Brady
qemu-img.1: qemu-img.texi qemu-img-cmds.texi
377 0d00e563 aliguori
	$(call quiet-command, \
378 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
379 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
380 0d00e563 aliguori
	  "  GEN   $@")
381 acd935ef bellard
382 a2d8f1be M. Mohan Kumar
fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
383 a2d8f1be M. Mohan Kumar
	$(call quiet-command, \
384 a2d8f1be M. Mohan Kumar
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
385 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
386 a2d8f1be M. Mohan Kumar
	  "  GEN   $@")
387 a2d8f1be M. Mohan Kumar
388 7a5ca864 bellard
qemu-nbd.8: qemu-nbd.texi
389 0d00e563 aliguori
	$(call quiet-command, \
390 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
391 3179d694 Michael Tokarev
	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
392 0d00e563 aliguori
	  "  GEN   $@")
393 7a5ca864 bellard
394 0cb3fb1e pbrook
dvi: qemu-doc.dvi qemu-tech.dvi
395 0cb3fb1e pbrook
html: qemu-doc.html qemu-tech.html
396 20cc9997 Stefan Weil
info: qemu-doc.info qemu-tech.info
397 20cc9997 Stefan Weil
pdf: qemu-doc.pdf qemu-tech.pdf
398 0cb3fb1e pbrook
399 20cc9997 Stefan Weil
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
400 20cc9997 Stefan Weil
	qemu-img.texi qemu-nbd.texi qemu-options.texi \
401 20cc9997 Stefan Weil
	qemu-monitor.texi qemu-img-cmds.texi
402 818220f5 aliguori
403 cb5fc67d Anthony Liguori
# Add a dependency on the generated files, so that they are always
404 cb5fc67d Anthony Liguori
# rebuilt before other object files
405 7748b8cb Mike Frysinger
ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
406 cb5fc67d Anthony Liguori
Makefile: $(GENERATED_HEADERS)
407 7748b8cb Mike Frysinger
endif
408 cb5fc67d Anthony Liguori
409 4fb240a4 bellard
# Include automatically generated dependency files
410 1435ddb8 Paolo Bonzini
# Dependencies in Makefile.objs files come from our recursive subdir rules
411 1435ddb8 Paolo Bonzini
-include $(wildcard *.d tests/*.d)