3 ifneq ($(wildcard config-host.mak
),)
4 # Put the all: rule here so that config-host.mak can contain dependencies.
6 include config-host.mak
7 include $(SRC_PATH
)/rules.mak
10 @echo
"Please call configure before running make!"
14 .PHONY
: all clean cscope
distclean dvi html
info install install-doc \
15 recurse-all speed
tar tarbin
test
17 VPATH
=$(SRC_PATH
):$(SRC_PATH
)/hw
20 CFLAGS
+= $(OS_CFLAGS
) $(ARCH_CFLAGS
)
21 LDFLAGS
+= $(OS_LDFLAGS
) $(ARCH_LDFLAGS
)
23 CPPFLAGS
+= -I.
-I
$(SRC_PATH
) -MMD
-MP
-MT
$@
24 CPPFLAGS
+= -D_GNU_SOURCE
-D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
25 CPPFLAGS
+= -U_FORTIFY_SOURCE
31 DOCS
=qemu-doc.html qemu-tech.html qemu
.1 qemu-img
.1 qemu-nbd
.8
40 LIBS
+=-lsocket
-lnsl
-lresolv
44 LIBS
+=-lwinmm
-lws2_32
-liphlpapi
47 build-all
: $(TOOLS
) $(DOCS
) recurse-all
49 config-host.mak
: configure
50 ifneq ($(wildcard config-host.mak
),)
51 @echo
$@ is out-of-date
, running configure
52 @sed
-n
"/.*Configured with/s/[^:]*: //p" $@ | sh
55 SUBDIR_MAKEFLAGS
=$(if
$(V
),,--no-print-directory
)
56 SUBDIR_RULES
=$(patsubst %,subdir-
%, $(TARGET_DIRS
))
58 ifeq ($(KVM_KMOD
),yes
)
65 $(call quiet-command
,$(MAKE
) $(SUBDIR_MAKEFLAGS
) -C kvm
/kernel V
="$(V)" )
71 $(call quiet-command
,$(MAKE
) $(SUBDIR_MAKEFLAGS
) -C
$* V
="$(V)" TARGET_DIR
="$*/" all,)
73 $(filter %-softmmu
,$(SUBDIR_RULES
)): libqemu_common.a
74 $(filter %-user
,$(SUBDIR_RULES
)): libqemu_user.a
76 recurse-all
: $(SUBDIR_RULES
)
78 #######################################################################
79 # BLOCK_OBJS is code used by both qemu system emulation and qemu-img
81 BLOCK_OBJS
=cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
82 BLOCK_OBJS
+=block
/cow.o block
/qcow.o aes.o block
/vmdk.o block
/cloop.o
83 BLOCK_OBJS
+=block
/dmg.o block
/bochs.o block
/vpc.o block
/vvfat.o
84 BLOCK_OBJS
+=block
/qcow2.o block
/qcow2-refcount.o block
/qcow2-cluster.o
85 BLOCK_OBJS
+=block
/qcow2-snapshot.o
86 BLOCK_OBJS
+=block
/parallels.o block
/nbd.o
87 BLOCK_OBJS
+=nbd.o block.o aio.o
90 BLOCK_OBJS
+= block
/raw-win32.o
93 BLOCK_OBJS
+= posix-aio-compat.o
95 BLOCK_OBJS
+= block
/raw-posix.o
99 BLOCK_OBJS
+= block
/curl.o
103 BLOCK_OBJS
+= compatfd.o
106 ######################################################################
107 # libqemu_common.a: Target independent part of system emulation. The
108 # long term path is to suppress *all* target specific code in case of
109 # system emulation, i.e. a single QEMU executable should support all
113 OBJS
+=readline.o console.o
116 OBJS
+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
117 OBJS
+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
118 OBJS
+=tmp105.o lm832x.o eeprom93xx.o tsc2005.o
119 OBJS
+=scsi-disk.o cdrom.o
121 OBJS
+=usb.o usb-hub.o usb-
$(HOST_USB
).o usb-hid.o usb-msd.o usb-wacom.o
122 OBJS
+=usb-serial.o usb-net.o
124 OBJS
+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
126 OBJS
+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
127 OBJS
+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
128 OBJS
+=msmouse.o ps2.o
139 OBJS
+=migration-exec.o
142 AUDIO_OBJS
= audio.o noaudio.o wavaudio.o mixeng.o
144 AUDIO_OBJS
+= sdlaudio.o
147 AUDIO_OBJS
+= ossaudio.o
149 ifdef CONFIG_COREAUDIO
150 AUDIO_OBJS
+= coreaudio.o
154 AUDIO_OBJS
+= alsaaudio.o
157 AUDIO_OBJS
+= dsoundaudio.o
160 AUDIO_OBJS
+= fmodaudio.o
161 audio
/audio.o audio
/fmodaudio.o
: CPPFLAGS
:= -I
$(CONFIG_FMOD_INC
) $(CPPFLAGS
)
166 AUDIO_OBJS
+= esdaudio.o
171 AUDIO_OBJS
+= paaudio.o
177 AUDIO_OBJS
+= audio_pt_int.o
179 AUDIO_OBJS
+= wavcapture.o
180 OBJS
+=$(addprefix audio
/, $(AUDIO_OBJS
))
184 OBJS
+=sdl.o sdl_zoom.o x_keymap.o
189 OBJS
+=vnc.o acl.o d3des.o
191 OBJS
+=vnc-tls.o vnc-auth-vencrypt.o
193 ifdef CONFIG_VNC_SASL
194 OBJS
+=vnc-auth-sasl.o
201 ifdef CONFIG_IOTHREAD
206 CPPFLAGS
+=-I
$(SRC_PATH
)/slirp
207 SLIRP_OBJS
=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
208 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
209 tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o
210 OBJS
+=$(addprefix slirp
/, $(SLIRP_OBJS
))
215 # xen backend driver support
216 XEN_OBJS
:= xen_backend.o xen_devconfig.o
217 XEN_OBJS
+= xen_console.o xenfb.o xen_disk.o xen_nic.o
226 keymaps.o
: keymaps.c keymaps.h
228 sdl_zoom.o
: sdl_zoom.c sdl_zoom.h sdl_zoom_template.h
230 sdl.o
: sdl.c keymaps.h sdl_keysym.h sdl_zoom.h
232 sdl.o audio
/sdlaudio.o baum.o
: CFLAGS
+= $(SDL_CFLAGS
)
236 vnc.h
: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
238 vnc.o
: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
240 vnc.o
: CFLAGS
+= $(CONFIG_VNC_TLS_CFLAGS
)
242 vnc-tls.o
: vnc-tls.c vnc.h
244 vnc-auth-vencrypt.o
: vnc-auth-vencrypt.c vnc.h
246 vnc-auth-sasl.o
: vnc-auth-sasl.c vnc.h
248 curses.o
: curses.c keymaps.h curses_keys.h
250 bt-host.o
: CFLAGS
+= $(CONFIG_BLUEZ_CFLAGS
)
252 libqemu_common.a
: $(OBJS
)
254 #######################################################################
255 # USER_OBJS is code used by qemu userspace emulation
256 USER_OBJS
=cutils.o cache-utils.o
258 libqemu_user.a
: $(USER_OBJS
)
260 ######################################################################
262 qemu-img.o
: qemu-img-cmds.h
264 qemu-img
$(EXESUF
): qemu-img.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
266 qemu-nbd
$(EXESUF
): qemu-nbd.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
268 qemu-io
$(EXESUF
): qemu-io.o qemu-tool.o tool-osdep.o cmd.o
$(BLOCK_OBJS
)
270 qemu-img
$(EXESUF
) qemu-nbd
$(EXESUF
) qemu-io
$(EXESUF
): LIBS
+= -lz
272 qemu-img-cmds.h
: $(SRC_PATH
)/qemu-img-cmds.hx
273 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-h
< $< > $@
," GEN $@")
276 # avoid old build problems by removing potentially incorrect old files
277 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
278 rm -f
*.o
*.d
*.a
$(TOOLS
) TAGS cscope.
* *.pod
*~
*/*~
279 rm -f slirp
/*.o slirp
/*.d audio
/*.o audio
/*.d block
/*.o block
/*.d
280 rm -f qemu-img-cmds.h
281 $(MAKE
) -C tests
clean
282 for d in
$(TARGET_DIRS
) libhw32 libhw64
; do \
283 $(MAKE
) -C
$$d $@ || exit
1 ; \
287 rm -f config-host.mak config-host.h
$(DOCS
) qemu-options.texi qemu-img-cmds.texi
288 rm -f qemu-
{doc
,tech
}.
{info,aux
,cp
,dvi,fn
,info,ky
,log
,pg
,toc
,tp
,vr
}
289 for d in
$(TARGET_DIRS
) libhw32 libhw64
; do \
290 rm -rf
$$d || exit
1 ; \
293 KEYMAPS
=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
294 ar de en-us fi fr-be hr it lv nl pl ru th \
295 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
298 BLOBS
=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
299 video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
300 pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
301 bamboo.dtb petalogix-s3adsp1800.dtb
308 $(INSTALL_DIR
) "$(DESTDIR)$(docdir)"
309 $(INSTALL_DATA
) qemu-doc.html qemu-tech.html
"$(DESTDIR)$(docdir)"
311 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man1"
312 $(INSTALL_DATA
) qemu
.1 qemu-img
.1 "$(DESTDIR)$(mandir)/man1"
313 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man8"
314 $(INSTALL_DATA
) qemu-nbd
.8 "$(DESTDIR)$(mandir)/man8"
317 install: all $(if
$(BUILD_DOCS
),install-doc
)
318 $(INSTALL_DIR
) "$(DESTDIR)$(bindir)"
320 $(INSTALL_PROG
) $(STRIP_OPT
) $(TOOLS
) "$(DESTDIR)$(bindir)"
323 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)"
324 set
-e
; for x in
$(BLOBS
); do \
325 if
[ -f
$(SRC_PATH
)/pc-bios
/$$x ];then \
326 $(INSTALL_DATA
) $(SRC_PATH
)/pc-bios
/$$x "$(DESTDIR)$(datadir)"; \
330 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)/keymaps"
331 set
-e
; for x in
$(KEYMAPS
); do \
332 $(INSTALL_DATA
) $(SRC_PATH
)/pc-bios
/keymaps
/$$x "$(DESTDIR)$(datadir)/keymaps"; \
334 for d in
$(TARGET_DIRS
); do \
335 $(MAKE
) -C
$$d $@ || exit
1 ; \
337 ifeq ($(KVM_KMOD
),yes
)
338 $(MAKE
) -C kvm
/kernel
$@
341 # various test targets
346 etags
*.
[ch
] tests
/*.
[ch
]
350 find .
-name
"*.[ch]" -print | sed
's,^\./,,' > .
/cscope.files
355 $(call quiet-command
,texi2html
-I
=.
-monolithic
-number
$<," GEN $@")
358 $(call quiet-command
,makeinfo -I .
$< -o
$@
," GEN $@")
361 $(call quiet-command
,texi2dvi -I .
$<," GEN $@")
363 qemu-options.texi
: $(SRC_PATH
)/qemu-options.hx
364 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
366 qemu-monitor.texi
: $(SRC_PATH
)/qemu-monitor.hx
367 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
369 qemu-img-cmds.texi
: $(SRC_PATH
)/qemu-img-cmds.hx
370 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
372 qemu
.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
373 $(call quiet-command
, \
374 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu.pod
&& \
375 pod2man
--section
=1 --center
=" " --release
=" " qemu.pod
> $@
, \
378 qemu-img
.1: qemu-img.texi qemu-img-cmds.texi
379 $(call quiet-command
, \
380 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-img.pod
&& \
381 pod2man
--section
=1 --center
=" " --release
=" " qemu-img.pod
> $@
, \
384 qemu-nbd
.8: qemu-nbd.texi
385 $(call quiet-command
, \
386 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-nbd.pod
&& \
387 pod2man
--section
=8 --center
=" " --release
=" " qemu-nbd.pod
> $@
, \
390 info: qemu-doc.
info qemu-tech.
info
392 dvi: qemu-doc.
dvi qemu-tech.
dvi
394 html
: qemu-doc.html qemu-tech.html
396 qemu-doc.
dvi qemu-doc.html qemu-doc.
info: qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-monitor.texi qemu-img-cmds.texi
398 VERSION ?
= $(shell cat VERSION
)
399 FILE
= qemu-
$(VERSION
)
401 # tar release (use 'make -k tar' on a checkouted tree)
405 cd
/tmp
&& tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
--exclude .git
--exclude .svn
408 # generate a binary distribution
410 cd
/ && tar zcvf ~
/qemu-
$(VERSION
)-$(ARCH
).
tar.gz \
412 $(bindir)/qemu-system-x86_64 \
413 $(bindir)/qemu-system-arm \
414 $(bindir)/qemu-system-cris \
415 $(bindir)/qemu-system-m68k \
416 $(bindir)/qemu-system-mips \
417 $(bindir)/qemu-system-mipsel \
418 $(bindir)/qemu-system-mips64 \
419 $(bindir)/qemu-system-mips64el \
420 $(bindir)/qemu-system-ppc \
421 $(bindir)/qemu-system-ppcemb \
422 $(bindir)/qemu-system-ppc64 \
423 $(bindir)/qemu-system-sh4 \
424 $(bindir)/qemu-system-sh4eb \
425 $(bindir)/qemu-system-sparc \
426 $(bindir)/qemu-i386 \
427 $(bindir)/qemu-x86_64 \
428 $(bindir)/qemu-alpha \
430 $(bindir)/qemu-armeb \
431 $(bindir)/qemu-cris \
432 $(bindir)/qemu-m68k \
433 $(bindir)/qemu-mips \
434 $(bindir)/qemu-mipsel \
436 $(bindir)/qemu-ppc64 \
437 $(bindir)/qemu-ppc64abi32 \
439 $(bindir)/qemu-sh4eb \
440 $(bindir)/qemu-sparc \
441 $(bindir)/qemu-sparc64 \
442 $(bindir)/qemu-sparc32plus \
445 $(datadir)/bios.bin \
446 $(datadir)/vgabios.bin \
447 $(datadir)/vgabios-cirrus.bin \
448 $(datadir)/ppc_rom.bin \
450 $(datadir)/openbios-sparc32 \
451 $(datadir)/openbios-sparc64 \
452 $(datadir)/openbios-ppc \
453 $(datadir)/pxe-ne2k_pci.bin \
454 $(datadir)/pxe-rtl8139.bin \
455 $(datadir)/pxe-pcnet.bin \
456 $(datadir)/pxe-e1000.bin \
457 $(datadir)/extboot.bin \
458 $(docdir
)/qemu-doc.html \
459 $(docdir
)/qemu-tech.html \
460 $(mandir)/man1
/qemu
.1 \
461 $(mandir)/man1
/qemu-img
.1 \
462 $(mandir)/man8
/qemu-nbd
.8
464 # Include automatically generated dependency files
465 -include $(wildcard *.d audio
/*.d slirp
/*.d block
/*.d
)
469 build-targets-i386
= $(build-targets-x86
)
470 build-targets-x86_64
= $(build-targets-x86
)
471 build-targets-x86
= kvm
/extboot
474 all: $(build-targets-
$(ARCH
))
478 if
! [ -f pc-bios
/extboot.bin
] \
479 ||
! cmp
-s pc-bios
/extboot.bin
$@
/extboot.bin
; then \
480 cp
$@
/extboot.bin pc-bios
/extboot.bin
; \