Statistics
| Branch: | Revision:

root / Makefile @ f3192e8f

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