3 ifneq ($(wildcard config-host.mak
),)
4 include config-host.mak
5 include $(SRC_PATH
)/rules.mak
8 @echo
"Please call configure before running make!"
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
28 DOCS
=qemu-doc.html qemu-tech.html qemu
.1 qemu-img
.1 qemu-nbd
.8
37 LIBS
+=-lsocket
-lnsl
-lresolv
41 LIBS
+=-lwinmm
-lws2_32
-liphlpapi
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
52 SUBDIR_MAKEFLAGS
=$(if
$(V
),,--no-print-directory
)
53 SUBDIR_RULES
=$(patsubst %,subdir-
%, $(TARGET_DIRS
))
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 module.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
73 BLOCK_OBJS
+= block
/raw-win32.o
76 BLOCK_OBJS
+= posix-aio-compat.o
78 BLOCK_OBJS
+= block
/raw-posix.o
81 ######################################################################
82 # libqemu_common.a: Target independent part of system emulation. The
83 # long term path is to suppress *all* target specific code in case of
84 # system emulation, i.e. a single QEMU executable should support all
88 OBJS
+=readline.o console.o
91 OBJS
+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
92 OBJS
+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
93 OBJS
+=tmp105.o lm832x.o eeprom93xx.o tsc2005.o
94 OBJS
+=scsi-disk.o cdrom.o
96 OBJS
+=usb.o usb-hub.o usb-
$(HOST_USB
).o usb-hid.o usb-msd.o usb-wacom.o
97 OBJS
+=usb-serial.o usb-net.o
99 OBJS
+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
101 OBJS
+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
102 OBJS
+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
103 OBJS
+=msmouse.o ps2.o
114 OBJS
+=migration-exec.o
117 AUDIO_OBJS
= audio.o noaudio.o wavaudio.o mixeng.o
119 AUDIO_OBJS
+= sdlaudio.o
122 AUDIO_OBJS
+= ossaudio.o
124 ifdef CONFIG_COREAUDIO
125 AUDIO_OBJS
+= coreaudio.o
129 AUDIO_OBJS
+= alsaaudio.o
132 AUDIO_OBJS
+= dsoundaudio.o
135 AUDIO_OBJS
+= fmodaudio.o
136 audio
/audio.o audio
/fmodaudio.o
: CPPFLAGS
:= -I
$(CONFIG_FMOD_INC
) $(CPPFLAGS
)
141 AUDIO_OBJS
+= esdaudio.o
146 AUDIO_OBJS
+= paaudio.o
152 AUDIO_OBJS
+= audio_pt_int.o
154 AUDIO_OBJS
+= wavcapture.o
155 OBJS
+=$(addprefix audio
/, $(AUDIO_OBJS
))
159 OBJS
+=sdl.o x_keymap.o
164 OBJS
+=vnc.o acl.o d3des.o
166 OBJS
+=vnc-tls.o vnc-auth-vencrypt.o
168 ifdef CONFIG_VNC_SASL
169 OBJS
+=vnc-auth-sasl.o
176 ifdef CONFIG_IOTHREAD
181 CPPFLAGS
+=-I
$(SRC_PATH
)/slirp
182 SLIRP_OBJS
=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
183 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
184 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
185 OBJS
+=$(addprefix slirp
/, $(SLIRP_OBJS
))
192 keymaps.o
: keymaps.c keymaps.h
194 sdl.o
: sdl.c keymaps.h sdl_keysym.h
196 sdl.o audio
/sdlaudio.o
: CFLAGS
+= $(SDL_CFLAGS
)
200 vnc.h
: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
202 vnc.o
: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
204 vnc.o
: CFLAGS
+= $(CONFIG_VNC_TLS_CFLAGS
)
206 vnc-tls.o
: vnc-tls.c vnc.h
208 vnc-auth-vencrypt.o
: vnc-auth-vencrypt.c vnc.h
210 vnc-auth-sasl.o
: vnc-auth-sasl.c vnc.h
212 curses.o
: curses.c keymaps.h curses_keys.h
214 bt-host.o
: CFLAGS
+= $(CONFIG_BLUEZ_CFLAGS
)
216 libqemu_common.a
: $(OBJS
)
218 #######################################################################
219 # USER_OBJS is code used by qemu userspace emulation
220 USER_OBJS
=cutils.o cache-utils.o
222 libqemu_user.a
: $(USER_OBJS
)
224 ######################################################################
226 qemu-img
$(EXESUF
): qemu-img.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
228 qemu-nbd
$(EXESUF
): qemu-nbd.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
230 qemu-io
$(EXESUF
): qemu-io.o qemu-tool.o tool-osdep.o cmd.o
$(BLOCK_OBJS
)
232 qemu-img
$(EXESUF
) qemu-nbd
$(EXESUF
) qemu-io
$(EXESUF
): LIBS
+= -lz
235 # avoid old build problems by removing potentially incorrect old files
236 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
237 rm -f
*.o
*.d
*.a
$(TOOLS
) TAGS cscope.
* *.pod
*~
*/*~
238 rm -f slirp
/*.o slirp
/*.d audio
/*.o audio
/*.d block
/*.o block
/*.d
239 $(MAKE
) -C tests
clean
240 for d in
$(TARGET_DIRS
); do \
241 $(MAKE
) -C
$$d $@ || exit
1 ; \
245 rm -f config-host.mak config-host.h
$(DOCS
) qemu-options.texi
246 rm -f qemu-
{doc
,tech
}.
{info,aux
,cp
,dvi,fn
,info,ky
,log
,pg
,toc
,tp
,vr
}
247 for d in
$(TARGET_DIRS
); do \
248 rm -rf
$$d || exit
1 ; \
251 KEYMAPS
=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
252 ar de en-us fi fr-be hr it lv nl pl ru th \
253 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
256 BLOBS
=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
257 video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
258 pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
265 $(INSTALL_DIR
) "$(DESTDIR)$(docdir)"
266 $(INSTALL_DATA
) qemu-doc.html qemu-tech.html
"$(DESTDIR)$(docdir)"
268 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man1"
269 $(INSTALL_DATA
) qemu
.1 qemu-img
.1 "$(DESTDIR)$(mandir)/man1"
270 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man8"
271 $(INSTALL_DATA
) qemu-nbd
.8 "$(DESTDIR)$(mandir)/man8"
274 install: all $(if
$(BUILD_DOCS
),install-doc
)
275 $(INSTALL_DIR
) "$(DESTDIR)$(bindir)"
277 $(INSTALL_PROG
) $(STRIP_OPT
) $(TOOLS
) "$(DESTDIR)$(bindir)"
280 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)"
281 set
-e
; for x in
$(BLOBS
); do \
282 $(INSTALL_DATA
) $(SRC_PATH
)/pc-bios
/$$x "$(DESTDIR)$(datadir)"; \
286 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)/keymaps"
287 set
-e
; for x in
$(KEYMAPS
); do \
288 $(INSTALL_DATA
) $(SRC_PATH
)/keymaps
/$$x "$(DESTDIR)$(datadir)/keymaps"; \
291 for d in
$(TARGET_DIRS
); do \
292 $(MAKE
) -C
$$d $@ || exit
1 ; \
295 # various test targets
300 etags
*.
[ch
] tests
/*.
[ch
]
304 find .
-name
"*.[ch]" -print | sed
's,^\./,,' > .
/cscope.files
309 $(call quiet-command
,texi2html
-I
=.
-monolithic
-number
$<," GEN $@")
312 $(call quiet-command
,makeinfo -I .
$< -o
$@
," GEN $@")
315 $(call quiet-command
,texi2dvi -I .
$<," GEN $@")
317 qemu-options.texi
: $(SRC_PATH
)/qemu-options.hx
318 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
320 qemu
.1: qemu-doc.texi qemu-options.texi
321 $(call quiet-command
, \
322 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu.pod
&& \
323 pod2man
--section
=1 --center
=" " --release
=" " qemu.pod
> $@
, \
326 qemu-img
.1: qemu-img.texi
327 $(call quiet-command
, \
328 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-img.pod
&& \
329 pod2man
--section
=1 --center
=" " --release
=" " qemu-img.pod
> $@
, \
332 qemu-nbd
.8: qemu-nbd.texi
333 $(call quiet-command
, \
334 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-nbd.pod
&& \
335 pod2man
--section
=8 --center
=" " --release
=" " qemu-nbd.pod
> $@
, \
338 info: qemu-doc.
info qemu-tech.
info
340 dvi: qemu-doc.
dvi qemu-tech.
dvi
342 html
: qemu-doc.html qemu-tech.html
344 qemu-doc.
dvi qemu-doc.html qemu-doc.
info: qemu-img.texi qemu-nbd.texi qemu-options.texi
346 VERSION ?
= $(shell cat VERSION
)
347 FILE
= qemu-
$(VERSION
)
349 # tar release (use 'make -k tar' on a checkouted tree)
353 cd
/tmp
&& tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
--exclude .git
--exclude .svn
356 # generate a binary distribution
358 cd
/ && tar zcvf ~
/qemu-
$(VERSION
)-$(ARCH
).
tar.gz \
360 $(bindir)/qemu-system-x86_64 \
361 $(bindir)/qemu-system-arm \
362 $(bindir)/qemu-system-cris \
363 $(bindir)/qemu-system-m68k \
364 $(bindir)/qemu-system-mips \
365 $(bindir)/qemu-system-mipsel \
366 $(bindir)/qemu-system-mips64 \
367 $(bindir)/qemu-system-mips64el \
368 $(bindir)/qemu-system-ppc \
369 $(bindir)/qemu-system-ppcemb \
370 $(bindir)/qemu-system-ppc64 \
371 $(bindir)/qemu-system-sh4 \
372 $(bindir)/qemu-system-sh4eb \
373 $(bindir)/qemu-system-sparc \
374 $(bindir)/qemu-i386 \
375 $(bindir)/qemu-x86_64 \
376 $(bindir)/qemu-alpha \
378 $(bindir)/qemu-armeb \
379 $(bindir)/qemu-cris \
380 $(bindir)/qemu-m68k \
381 $(bindir)/qemu-mips \
382 $(bindir)/qemu-mipsel \
384 $(bindir)/qemu-ppc64 \
385 $(bindir)/qemu-ppc64abi32 \
387 $(bindir)/qemu-sh4eb \
388 $(bindir)/qemu-sparc \
389 $(bindir)/qemu-sparc64 \
390 $(bindir)/qemu-sparc32plus \
393 $(datadir)/bios.bin \
394 $(datadir)/vgabios.bin \
395 $(datadir)/vgabios-cirrus.bin \
396 $(datadir)/ppc_rom.bin \
398 $(datadir)/openbios-sparc32 \
399 $(datadir)/openbios-sparc64 \
400 $(datadir)/openbios-ppc \
401 $(datadir)/pxe-ne2k_pci.bin \
402 $(datadir)/pxe-rtl8139.bin \
403 $(datadir)/pxe-pcnet.bin \
404 $(datadir)/pxe-e1000.bin \
405 $(docdir
)/qemu-doc.html \
406 $(docdir
)/qemu-tech.html \
407 $(mandir)/man1
/qemu
.1 \
408 $(mandir)/man1
/qemu-img
.1 \
409 $(mandir)/man8
/qemu-nbd
.8
411 # Include automatically generated dependency files
412 -include $(wildcard *.d audio
/*.d slirp
/*.d block
/*.d
)