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
))
59 $(call quiet-command
,$(MAKE
) $(SUBDIR_MAKEFLAGS
) -C
$* V
="$(V)" TARGET_DIR
="$*/" all,)
61 $(filter %-softmmu
,$(SUBDIR_RULES
)): libqemu_common.a
62 $(filter %-user
,$(SUBDIR_RULES
)): libqemu_user.a
64 recurse-all
: $(SUBDIR_RULES
)
66 #######################################################################
67 # BLOCK_OBJS is code used by both qemu system emulation and qemu-img
69 BLOCK_OBJS
=cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
70 BLOCK_OBJS
+=block
/cow.o block
/qcow.o aes.o block
/vmdk.o block
/cloop.o
71 BLOCK_OBJS
+=block
/dmg.o block
/bochs.o block
/vpc.o block
/vvfat.o
72 BLOCK_OBJS
+=block
/qcow2.o block
/qcow2-refcount.o block
/qcow2-cluster.o
73 BLOCK_OBJS
+=block
/qcow2-snapshot.o
74 BLOCK_OBJS
+=block
/parallels.o block
/nbd.o
75 BLOCK_OBJS
+=nbd.o block.o aio.o
78 BLOCK_OBJS
+= block
/raw-win32.o
81 BLOCK_OBJS
+= posix-aio-compat.o
83 BLOCK_OBJS
+= block
/raw-posix.o
87 BLOCK_OBJS
+= block
/curl.o
90 ######################################################################
91 # libqemu_common.a: Target independent part of system emulation. The
92 # long term path is to suppress *all* target specific code in case of
93 # system emulation, i.e. a single QEMU executable should support all
97 OBJS
+=readline.o console.o
100 OBJS
+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
101 OBJS
+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
102 OBJS
+=tmp105.o lm832x.o eeprom93xx.o tsc2005.o
103 OBJS
+=scsi-disk.o cdrom.o
105 OBJS
+=usb.o usb-hub.o usb-
$(HOST_USB
).o usb-hid.o usb-msd.o usb-wacom.o
106 OBJS
+=usb-serial.o usb-net.o
108 OBJS
+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
110 OBJS
+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
111 OBJS
+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
112 OBJS
+=msmouse.o ps2.o
123 OBJS
+=migration-exec.o
126 AUDIO_OBJS
= audio.o noaudio.o wavaudio.o mixeng.o
128 AUDIO_OBJS
+= sdlaudio.o
131 AUDIO_OBJS
+= ossaudio.o
133 ifdef CONFIG_COREAUDIO
134 AUDIO_OBJS
+= coreaudio.o
138 AUDIO_OBJS
+= alsaaudio.o
141 AUDIO_OBJS
+= dsoundaudio.o
144 AUDIO_OBJS
+= fmodaudio.o
145 audio
/audio.o audio
/fmodaudio.o
: CPPFLAGS
:= -I
$(CONFIG_FMOD_INC
) $(CPPFLAGS
)
150 AUDIO_OBJS
+= esdaudio.o
155 AUDIO_OBJS
+= paaudio.o
161 AUDIO_OBJS
+= audio_pt_int.o
163 AUDIO_OBJS
+= wavcapture.o
164 OBJS
+=$(addprefix audio
/, $(AUDIO_OBJS
))
168 OBJS
+=sdl.o sdl_zoom.o x_keymap.o
173 OBJS
+=vnc.o acl.o d3des.o
175 OBJS
+=vnc-tls.o vnc-auth-vencrypt.o
177 ifdef CONFIG_VNC_SASL
178 OBJS
+=vnc-auth-sasl.o
185 ifdef CONFIG_IOTHREAD
190 CPPFLAGS
+=-I
$(SRC_PATH
)/slirp
191 SLIRP_OBJS
=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
192 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
193 tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o
194 OBJS
+=$(addprefix slirp
/, $(SLIRP_OBJS
))
199 # xen backend driver support
200 XEN_OBJS
:= xen_backend.o xen_devconfig.o
201 XEN_OBJS
+= xen_console.o xenfb.o xen_disk.o xen_nic.o
210 keymaps.o
: keymaps.c keymaps.h
212 sdl_zoom.o
: sdl_zoom.c sdl_zoom.h sdl_zoom_template.h
214 sdl.o
: sdl.c keymaps.h sdl_keysym.h sdl_zoom.h
216 sdl.o audio
/sdlaudio.o baum.o
: CFLAGS
+= $(SDL_CFLAGS
)
220 vnc.h
: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
222 vnc.o
: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
224 vnc.o
: CFLAGS
+= $(CONFIG_VNC_TLS_CFLAGS
)
226 vnc-tls.o
: vnc-tls.c vnc.h
228 vnc-auth-vencrypt.o
: vnc-auth-vencrypt.c vnc.h
230 vnc-auth-sasl.o
: vnc-auth-sasl.c vnc.h
232 curses.o
: curses.c keymaps.h curses_keys.h
234 bt-host.o
: CFLAGS
+= $(CONFIG_BLUEZ_CFLAGS
)
236 libqemu_common.a
: $(OBJS
)
238 #######################################################################
239 # USER_OBJS is code used by qemu userspace emulation
240 USER_OBJS
=cutils.o cache-utils.o
242 libqemu_user.a
: $(USER_OBJS
)
244 ######################################################################
246 qemu-img.o
: qemu-img-cmds.h
248 qemu-img
$(EXESUF
): qemu-img.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
250 qemu-nbd
$(EXESUF
): qemu-nbd.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
252 qemu-io
$(EXESUF
): qemu-io.o qemu-tool.o tool-osdep.o cmd.o
$(BLOCK_OBJS
)
254 qemu-img
$(EXESUF
) qemu-nbd
$(EXESUF
) qemu-io
$(EXESUF
): LIBS
+= -lz
256 qemu-img-cmds.h
: $(SRC_PATH
)/qemu-img-cmds.hx
257 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-h
< $< > $@
," GEN $@")
260 # avoid old build problems by removing potentially incorrect old files
261 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
262 rm -f
*.o
*.d
*.a
$(TOOLS
) TAGS cscope.
* *.pod
*~
*/*~
263 rm -f slirp
/*.o slirp
/*.d audio
/*.o audio
/*.d block
/*.o block
/*.d
264 rm -f qemu-img-cmds.h
265 $(MAKE
) -C tests
clean
266 for d in
$(TARGET_DIRS
) libhw32 libhw64
; do \
267 $(MAKE
) -C
$$d $@ || exit
1 ; \
271 rm -f config-host.mak config-host.h
$(DOCS
) qemu-options.texi qemu-img-cmds.texi
272 rm -f qemu-
{doc
,tech
}.
{info,aux
,cp
,dvi,fn
,info,ky
,log
,pg
,toc
,tp
,vr
}
273 for d in
$(TARGET_DIRS
) libhw32 libhw64
; do \
274 rm -rf
$$d || exit
1 ; \
277 KEYMAPS
=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
278 ar de en-us fi fr-be hr it lv nl pl ru th \
279 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
282 BLOBS
=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
283 video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
284 pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
285 bamboo.dtb petalogix-s3adsp1800.dtb
291 $(INSTALL_DIR
) "$(DESTDIR)$(docdir)"
292 $(INSTALL_DATA
) qemu-doc.html qemu-tech.html
"$(DESTDIR)$(docdir)"
294 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man1"
295 $(INSTALL_DATA
) qemu
.1 qemu-img
.1 "$(DESTDIR)$(mandir)/man1"
296 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man8"
297 $(INSTALL_DATA
) qemu-nbd
.8 "$(DESTDIR)$(mandir)/man8"
300 install: all $(if
$(BUILD_DOCS
),install-doc
)
301 $(INSTALL_DIR
) "$(DESTDIR)$(bindir)"
303 $(INSTALL_PROG
) $(STRIP_OPT
) $(TOOLS
) "$(DESTDIR)$(bindir)"
306 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)"
307 set
-e
; for x in
$(BLOBS
); do \
308 $(INSTALL_DATA
) $(SRC_PATH
)/pc-bios
/$$x "$(DESTDIR)$(datadir)"; \
311 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)/keymaps"
312 set
-e
; for x in
$(KEYMAPS
); do \
313 $(INSTALL_DATA
) $(SRC_PATH
)/pc-bios
/keymaps
/$$x "$(DESTDIR)$(datadir)/keymaps"; \
315 for d in
$(TARGET_DIRS
); do \
316 $(MAKE
) -C
$$d $@ || exit
1 ; \
319 # various test targets
324 etags
*.
[ch
] tests
/*.
[ch
]
328 find .
-name
"*.[ch]" -print | sed
's,^\./,,' > .
/cscope.files
333 $(call quiet-command
,texi2html
-I
=.
-monolithic
-number
$<," GEN $@")
336 $(call quiet-command
,makeinfo -I .
$< -o
$@
," GEN $@")
339 $(call quiet-command
,texi2dvi -I .
$<," GEN $@")
341 qemu-options.texi
: $(SRC_PATH
)/qemu-options.hx
342 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
344 qemu-monitor.texi
: $(SRC_PATH
)/qemu-monitor.hx
345 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
347 qemu-img-cmds.texi
: $(SRC_PATH
)/qemu-img-cmds.hx
348 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
350 qemu
.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
351 $(call quiet-command
, \
352 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu.pod
&& \
353 pod2man
--section
=1 --center
=" " --release
=" " qemu.pod
> $@
, \
356 qemu-img
.1: qemu-img.texi qemu-img-cmds.texi
357 $(call quiet-command
, \
358 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-img.pod
&& \
359 pod2man
--section
=1 --center
=" " --release
=" " qemu-img.pod
> $@
, \
362 qemu-nbd
.8: qemu-nbd.texi
363 $(call quiet-command
, \
364 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-nbd.pod
&& \
365 pod2man
--section
=8 --center
=" " --release
=" " qemu-nbd.pod
> $@
, \
368 info: qemu-doc.
info qemu-tech.
info
370 dvi: qemu-doc.
dvi qemu-tech.
dvi
372 html
: qemu-doc.html qemu-tech.html
374 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
376 VERSION ?
= $(shell cat VERSION
)
377 FILE
= qemu-
$(VERSION
)
379 # tar release (use 'make -k tar' on a checkouted tree)
383 cd
/tmp
&& tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
--exclude .git
--exclude .svn
386 # generate a binary distribution
388 cd
/ && tar zcvf ~
/qemu-
$(VERSION
)-$(ARCH
).
tar.gz \
390 $(bindir)/qemu-system-x86_64 \
391 $(bindir)/qemu-system-arm \
392 $(bindir)/qemu-system-cris \
393 $(bindir)/qemu-system-m68k \
394 $(bindir)/qemu-system-mips \
395 $(bindir)/qemu-system-mipsel \
396 $(bindir)/qemu-system-mips64 \
397 $(bindir)/qemu-system-mips64el \
398 $(bindir)/qemu-system-ppc \
399 $(bindir)/qemu-system-ppcemb \
400 $(bindir)/qemu-system-ppc64 \
401 $(bindir)/qemu-system-sh4 \
402 $(bindir)/qemu-system-sh4eb \
403 $(bindir)/qemu-system-sparc \
404 $(bindir)/qemu-i386 \
405 $(bindir)/qemu-x86_64 \
406 $(bindir)/qemu-alpha \
408 $(bindir)/qemu-armeb \
409 $(bindir)/qemu-cris \
410 $(bindir)/qemu-m68k \
411 $(bindir)/qemu-mips \
412 $(bindir)/qemu-mipsel \
414 $(bindir)/qemu-ppc64 \
415 $(bindir)/qemu-ppc64abi32 \
417 $(bindir)/qemu-sh4eb \
418 $(bindir)/qemu-sparc \
419 $(bindir)/qemu-sparc64 \
420 $(bindir)/qemu-sparc32plus \
423 $(datadir)/bios.bin \
424 $(datadir)/vgabios.bin \
425 $(datadir)/vgabios-cirrus.bin \
426 $(datadir)/ppc_rom.bin \
428 $(datadir)/openbios-sparc32 \
429 $(datadir)/openbios-sparc64 \
430 $(datadir)/openbios-ppc \
431 $(datadir)/pxe-ne2k_pci.bin \
432 $(datadir)/pxe-rtl8139.bin \
433 $(datadir)/pxe-pcnet.bin \
434 $(datadir)/pxe-e1000.bin \
435 $(docdir
)/qemu-doc.html \
436 $(docdir
)/qemu-tech.html \
437 $(mandir)/man1
/qemu
.1 \
438 $(mandir)/man1
/qemu-img
.1 \
439 $(mandir)/man8
/qemu-nbd
.8
441 # Include automatically generated dependency files
442 -include $(wildcard *.d audio
/*.d slirp
/*.d block
/*.d
)