Statistics
| Branch: | Revision:

root / Makefile @ fec90ff0

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