bios: add SRAT ACPI table support (Andre Przywara)
[qemu-kvm/fedora.git] / Makefile
blob521eddd20e29ff24ebf2919fe33b80e0db662847
1 # Makefile for QEMU.
3 ifneq ($(wildcard config-host.mak),)
4 include config-host.mak
5 include $(SRC_PATH)/rules.mak
6 else
7 config-host.mak:
8 @echo "Please call configure before running make!"
9 @exit 1
10 endif
12 .PHONY: all clean cscope distclean dvi html info install install-doc \
13 recurse-all speed tar tarbin test
15 VPATH=$(SRC_PATH):$(SRC_PATH)/hw
18 CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
19 LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
21 CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
22 CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
23 LIBS=
24 ifdef CONFIG_STATIC
25 LDFLAGS += -static
26 endif
27 ifdef BUILD_DOCS
28 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
29 else
30 DOCS=
31 endif
33 LIBS+=$(PTHREADLIBS)
34 LIBS+=$(CLOCKLIBS)
36 ifdef CONFIG_SOLARIS
37 LIBS+=-lsocket -lnsl -lresolv
38 endif
40 ifdef CONFIG_WIN32
41 LIBS+=-lwinmm -lws2_32 -liphlpapi
42 endif
44 all: $(TOOLS) $(DOCS) recurse-all
46 config-host.mak: configure
47 ifneq ($(wildcard config-host.mak),)
48 @echo $@ is out-of-date, running configure
49 @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
50 endif
52 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
53 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
55 subdir-%:
56 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
58 $(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
59 $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
61 recurse-all: $(SUBDIR_RULES)
63 #######################################################################
64 # BLOCK_OBJS is code used by both qemu system emulation and qemu-img
66 BLOCK_OBJS=cutils.o cache-utils.o qemu-malloc.o
67 BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o
68 BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
69 BLOCK_OBJS+=block-qcow2.o block-parallels.o block-nbd.o
70 BLOCK_OBJS+=nbd.o block.o aio.o
72 ifdef CONFIG_WIN32
73 BLOCK_OBJS += block-raw-win32.o
74 else
75 ifdef CONFIG_AIO
76 BLOCK_OBJS += posix-aio-compat.o
77 endif
78 BLOCK_OBJS += block-raw-posix.o
79 endif
81 ifdef CONFIG_AIO
82 BLOCK_OBJS += compatfd.o
83 endif
85 ######################################################################
86 # libqemu_common.a: Target independent part of system emulation. The
87 # long term path is to suppress *all* target specific code in case of
88 # system emulation, i.e. a single QEMU executable should support all
89 # CPUs and machines.
91 OBJS=$(BLOCK_OBJS)
92 OBJS+=readline.o console.o
94 OBJS+=irq.o ptimer.o
95 OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
96 OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
97 OBJS+=tmp105.o lm832x.o eeprom93xx.o tsc2005.o
98 OBJS+=scsi-disk.o cdrom.o
99 OBJS+=scsi-generic.o
100 OBJS+=usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
101 OBJS+=usb-serial.o usb-net.o
102 OBJS+=sd.o ssi-sd.o
103 OBJS+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
104 OBJS+=bt-hci-csr.o
105 OBJS+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
106 OBJS+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
107 OBJS+=msmouse.o ps2.o
109 ifdef CONFIG_BRLAPI
110 OBJS+= baum.o
111 LIBS+=-lbrlapi
112 endif
114 ifdef CONFIG_WIN32
115 OBJS+=tap-win32.o
116 else
117 OBJS+=migration-exec.o
118 endif
120 AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
121 ifdef CONFIG_SDL
122 AUDIO_OBJS += sdlaudio.o
123 endif
124 ifdef CONFIG_OSS
125 AUDIO_OBJS += ossaudio.o
126 endif
127 ifdef CONFIG_COREAUDIO
128 AUDIO_OBJS += coreaudio.o
129 AUDIO_PT = yes
130 endif
131 ifdef CONFIG_ALSA
132 AUDIO_OBJS += alsaaudio.o
133 endif
134 ifdef CONFIG_DSOUND
135 AUDIO_OBJS += dsoundaudio.o
136 endif
137 ifdef CONFIG_FMOD
138 AUDIO_OBJS += fmodaudio.o
139 audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
140 endif
141 ifdef CONFIG_ESD
142 AUDIO_PT = yes
143 AUDIO_PT_INT = yes
144 AUDIO_OBJS += esdaudio.o
145 endif
146 ifdef CONFIG_PA
147 AUDIO_PT = yes
148 AUDIO_PT_INT = yes
149 AUDIO_OBJS += paaudio.o
150 endif
151 ifdef AUDIO_PT
152 LDFLAGS += -pthread
153 endif
154 ifdef AUDIO_PT_INT
155 AUDIO_OBJS += audio_pt_int.o
156 endif
157 AUDIO_OBJS+= wavcapture.o
158 OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
160 OBJS+=keymaps.o
161 ifdef CONFIG_SDL
162 OBJS+=sdl.o x_keymap.o
163 endif
164 ifdef CONFIG_CURSES
165 OBJS+=curses.o
166 endif
167 OBJS+=vnc.o acl.o d3des.o
168 ifdef CONFIG_VNC_TLS
169 OBJS+=vnc-tls.o vnc-auth-vencrypt.o
170 endif
171 ifdef CONFIG_VNC_SASL
172 OBJS+=vnc-auth-sasl.o
173 endif
175 ifdef CONFIG_COCOA
176 OBJS+=cocoa.o
177 endif
179 ifdef CONFIG_IOTHREAD
180 OBJS+=qemu-thread.o
181 endif
183 ifdef CONFIG_SLIRP
184 CPPFLAGS+=-I$(SRC_PATH)/slirp
185 SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
186 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
187 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
188 OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
189 endif
191 LIBS+=$(VDE_LIBS)
193 cocoa.o: cocoa.m
195 keymaps.o: keymaps.c keymaps.h
197 sdl.o: sdl.c keymaps.h sdl_keysym.h
199 sdl.o audio/sdlaudio.o: CFLAGS += $(SDL_CFLAGS)
201 acl.o: acl.h acl.c
203 vnc.h: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
205 vnc.o: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
207 vnc.o: CFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
209 vnc-tls.o: vnc-tls.c vnc.h
211 vnc-auth-vencrypt.o: vnc-auth-vencrypt.c vnc.h
213 vnc-auth-sasl.o: vnc-auth-sasl.c vnc.h
215 curses.o: curses.c keymaps.h curses_keys.h
217 bt-host.o: CFLAGS += $(CONFIG_BLUEZ_CFLAGS)
219 libqemu_common.a: $(OBJS)
221 #######################################################################
222 # USER_OBJS is code used by qemu userspace emulation
223 USER_OBJS=cutils.o cache-utils.o
225 libqemu_user.a: $(USER_OBJS)
227 ######################################################################
229 qemu-img$(EXESUF): qemu-img.o qemu-tool.o osdep.o $(BLOCK_OBJS)
231 qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS)
233 qemu-io$(EXESUF): qemu-io.o qemu-tool.o osdep.o cmd.o $(BLOCK_OBJS)
235 qemu-img$(EXESUF) qemu-nbd$(EXESUF) qemu-io$(EXESUF): LIBS += -lz
237 clean:
238 # avoid old build problems by removing potentially incorrect old files
239 rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
240 rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~
241 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d
242 $(MAKE) -C tests clean
243 for d in $(TARGET_DIRS); do \
244 $(MAKE) -C $$d $@ || exit 1 ; \
245 done
247 distclean: clean
248 rm -f config-host.mak config-host.h $(DOCS) qemu-options.texi
249 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
250 for d in $(TARGET_DIRS); do \
251 rm -rf $$d || exit 1 ; \
252 done
254 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
255 ar de en-us fi fr-be hr it lv nl pl ru th \
256 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
258 ifdef INSTALL_BLOBS
259 BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
260 video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
261 pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
262 bamboo.dtb
263 BLOBS += extboot.bin
264 else
265 BLOBS=
266 endif
268 install-doc: $(DOCS)
269 $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
270 $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
271 ifndef CONFIG_WIN32
272 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
273 $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
274 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
275 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
276 endif
278 install: all $(if $(BUILD_DOCS),install-doc)
279 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
280 ifneq ($(TOOLS),)
281 $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
282 endif
283 ifneq ($(BLOBS),)
284 $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
285 set -e; for x in $(BLOBS); do \
286 if [ -f $(SRC_PATH)/pc-bios/$$x ];then \
287 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
288 fi \
289 done
290 endif
291 ifndef CONFIG_WIN32
292 $(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
293 set -e; for x in $(KEYMAPS); do \
294 $(INSTALL_DATA) $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
295 done
296 endif
297 for d in $(TARGET_DIRS); do \
298 $(MAKE) -C $$d $@ || exit 1 ; \
299 done
301 # various test targets
302 test speed: all
303 $(MAKE) -C tests $@
305 TAGS:
306 etags *.[ch] tests/*.[ch]
308 cscope:
309 rm -f ./cscope.*
310 find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files
311 cscope -b
313 # documentation
314 %.html: %.texi
315 $(call quiet-command,texi2html -I=. -monolithic -number $<," GEN $@")
317 %.info: %.texi
318 $(call quiet-command,makeinfo -I . $< -o $@," GEN $@")
320 %.dvi: %.texi
321 $(call quiet-command,texi2dvi -I . $<," GEN $@")
323 qemu-options.texi: $(SRC_PATH)/qemu-options.hx
324 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
326 qemu.1: qemu-doc.texi qemu-options.texi
327 $(call quiet-command, \
328 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod && \
329 pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
330 " GEN $@")
332 qemu-img.1: qemu-img.texi
333 $(call quiet-command, \
334 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod && \
335 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
336 " GEN $@")
338 qemu-nbd.8: qemu-nbd.texi
339 $(call quiet-command, \
340 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod && \
341 pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
342 " GEN $@")
344 info: qemu-doc.info qemu-tech.info
346 dvi: qemu-doc.dvi qemu-tech.dvi
348 html: qemu-doc.html qemu-tech.html
350 qemu-doc.dvi qemu-doc.html qemu-doc.info: qemu-img.texi qemu-nbd.texi qemu-options.texi
352 VERSION ?= $(shell cat VERSION)
353 FILE = qemu-$(VERSION)
355 # tar release (use 'make -k tar' on a checkouted tree)
356 tar:
357 rm -rf /tmp/$(FILE)
358 cp -r . /tmp/$(FILE)
359 cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
360 rm -rf /tmp/$(FILE)
362 # generate a binary distribution
363 tarbin:
364 cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
365 $(bindir)/qemu \
366 $(bindir)/qemu-system-x86_64 \
367 $(bindir)/qemu-system-arm \
368 $(bindir)/qemu-system-cris \
369 $(bindir)/qemu-system-m68k \
370 $(bindir)/qemu-system-mips \
371 $(bindir)/qemu-system-mipsel \
372 $(bindir)/qemu-system-mips64 \
373 $(bindir)/qemu-system-mips64el \
374 $(bindir)/qemu-system-ppc \
375 $(bindir)/qemu-system-ppcemb \
376 $(bindir)/qemu-system-ppc64 \
377 $(bindir)/qemu-system-sh4 \
378 $(bindir)/qemu-system-sh4eb \
379 $(bindir)/qemu-system-sparc \
380 $(bindir)/qemu-i386 \
381 $(bindir)/qemu-x86_64 \
382 $(bindir)/qemu-alpha \
383 $(bindir)/qemu-arm \
384 $(bindir)/qemu-armeb \
385 $(bindir)/qemu-cris \
386 $(bindir)/qemu-m68k \
387 $(bindir)/qemu-mips \
388 $(bindir)/qemu-mipsel \
389 $(bindir)/qemu-ppc \
390 $(bindir)/qemu-ppc64 \
391 $(bindir)/qemu-ppc64abi32 \
392 $(bindir)/qemu-sh4 \
393 $(bindir)/qemu-sh4eb \
394 $(bindir)/qemu-sparc \
395 $(bindir)/qemu-sparc64 \
396 $(bindir)/qemu-sparc32plus \
397 $(bindir)/qemu-img \
398 $(bindir)/qemu-nbd \
399 $(datadir)/bios.bin \
400 $(datadir)/vgabios.bin \
401 $(datadir)/vgabios-cirrus.bin \
402 $(datadir)/ppc_rom.bin \
403 $(datadir)/video.x \
404 $(datadir)/openbios-sparc32 \
405 $(datadir)/openbios-sparc64 \
406 $(datadir)/openbios-ppc \
407 $(datadir)/pxe-ne2k_pci.bin \
408 $(datadir)/pxe-rtl8139.bin \
409 $(datadir)/pxe-pcnet.bin \
410 $(datadir)/pxe-e1000.bin \
411 $(datadir)/extboot.bin \
412 $(docdir)/qemu-doc.html \
413 $(docdir)/qemu-tech.html \
414 $(mandir)/man1/qemu.1 \
415 $(mandir)/man1/qemu-img.1 \
416 $(mandir)/man8/qemu-nbd.8
418 # Include automatically generated dependency files
419 -include $(wildcard *.d audio/*.d slirp/*.d)
421 .PHONY: kvm/extboot
423 build-targets-i386 = $(build-targets-x86)
424 build-targets-x86_64 = $(build-targets-x86)
425 build-targets-x86 = kvm/extboot
426 build-targets-ia64 =
428 all: $(build-targets-$(ARCH))
430 kvm/extboot:
431 $(MAKE) -C $@
432 if ! [ -f pc-bios/extboot.bin ] \
433 || ! cmp -s pc-bios/extboot.bin $@/extboot.bin; then \
434 cp $@/extboot.bin pc-bios/extboot.bin; \