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
30 DOCS
=qemu-doc.html qemu-tech.html qemu
.1 qemu-img
.1 qemu-nbd
.8
39 LIBS
+=-lsocket
-lnsl
-lresolv
43 LIBS
+=-lwinmm
-lws2_32
-liphlpapi
46 build-all
: $(TOOLS
) $(DOCS
) recurse-all
48 config-host.mak
: configure
49 ifneq ($(wildcard config-host.mak
),)
50 @echo
$@ is out-of-date
, running configure
51 @sed
-n
"/.*Configured with/s/[^:]*: //p" $@ | sh
54 SUBDIR_MAKEFLAGS
=$(if
$(V
),,--no-print-directory
)
55 SUBDIR_RULES
=$(patsubst %,subdir-
%, $(TARGET_DIRS
))
58 $(call quiet-command
,$(MAKE
) $(SUBDIR_MAKEFLAGS
) -C
$* V
="$(V)" TARGET_DIR
="$*/" all,)
60 $(filter %-softmmu
,$(SUBDIR_RULES
)): libqemu_common.a
61 $(filter %-user
,$(SUBDIR_RULES
)): libqemu_user.a
63 recurse-all
: $(SUBDIR_RULES
)
65 #######################################################################
66 # BLOCK_OBJS is code used by both qemu system emulation and qemu-img
68 BLOCK_OBJS
=cutils.o cache-utils.o qemu-malloc.o module.o
69 BLOCK_OBJS
+=block
/cow.o block
/qcow.o aes.o block
/vmdk.o block
/cloop.o
70 BLOCK_OBJS
+=block
/dmg.o block
/bochs.o block
/vpc.o block
/vvfat.o
71 BLOCK_OBJS
+=block
/qcow2.o block
/parallels.o block
/nbd.o
72 BLOCK_OBJS
+=nbd.o block.o aio.o
75 BLOCK_OBJS
+= block
/raw-win32.o
78 BLOCK_OBJS
+= posix-aio-compat.o
80 BLOCK_OBJS
+= block
/raw-posix.o
83 ######################################################################
84 # libqemu_common.a: Target independent part of system emulation. The
85 # long term path is to suppress *all* target specific code in case of
86 # system emulation, i.e. a single QEMU executable should support all
90 OBJS
+=readline.o console.o
93 OBJS
+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
94 OBJS
+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
95 OBJS
+=tmp105.o lm832x.o eeprom93xx.o tsc2005.o
96 OBJS
+=scsi-disk.o cdrom.o
98 OBJS
+=usb.o usb-hub.o usb-
$(HOST_USB
).o usb-hid.o usb-msd.o usb-wacom.o
99 OBJS
+=usb-serial.o usb-net.o
101 OBJS
+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
103 OBJS
+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
104 OBJS
+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
105 OBJS
+=msmouse.o ps2.o
116 OBJS
+=migration-exec.o
119 AUDIO_OBJS
= audio.o noaudio.o wavaudio.o mixeng.o
121 AUDIO_OBJS
+= sdlaudio.o
124 AUDIO_OBJS
+= ossaudio.o
126 ifdef CONFIG_COREAUDIO
127 AUDIO_OBJS
+= coreaudio.o
131 AUDIO_OBJS
+= alsaaudio.o
134 AUDIO_OBJS
+= dsoundaudio.o
137 AUDIO_OBJS
+= fmodaudio.o
138 audio
/audio.o audio
/fmodaudio.o
: CPPFLAGS
:= -I
$(CONFIG_FMOD_INC
) $(CPPFLAGS
)
143 AUDIO_OBJS
+= esdaudio.o
148 AUDIO_OBJS
+= paaudio.o
154 AUDIO_OBJS
+= audio_pt_int.o
156 AUDIO_OBJS
+= wavcapture.o
157 OBJS
+=$(addprefix audio
/, $(AUDIO_OBJS
))
161 OBJS
+=sdl.o x_keymap.o
166 OBJS
+=vnc.o acl.o d3des.o
168 OBJS
+=vnc-tls.o vnc-auth-vencrypt.o
170 ifdef CONFIG_VNC_SASL
171 OBJS
+=vnc-auth-sasl.o
178 ifdef CONFIG_IOTHREAD
183 CPPFLAGS
+=-I
$(SRC_PATH
)/slirp
184 SLIRP_OBJS
=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
185 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
186 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
187 OBJS
+=$(addprefix slirp
/, $(SLIRP_OBJS
))
194 keymaps.o
: keymaps.c keymaps.h
196 sdl.o
: sdl.c keymaps.h sdl_keysym.h
198 sdl.o audio
/sdlaudio.o
: CFLAGS
+= $(SDL_CFLAGS
)
202 vnc.h
: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
204 vnc.o
: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
206 vnc.o
: CFLAGS
+= $(CONFIG_VNC_TLS_CFLAGS
)
208 vnc-tls.o
: vnc-tls.c vnc.h
210 vnc-auth-vencrypt.o
: vnc-auth-vencrypt.c vnc.h
212 vnc-auth-sasl.o
: vnc-auth-sasl.c vnc.h
214 curses.o
: curses.c keymaps.h curses_keys.h
216 bt-host.o
: CFLAGS
+= $(CONFIG_BLUEZ_CFLAGS
)
218 libqemu_common.a
: $(OBJS
)
220 #######################################################################
221 # USER_OBJS is code used by qemu userspace emulation
222 USER_OBJS
=cutils.o cache-utils.o
224 libqemu_user.a
: $(USER_OBJS
)
226 ######################################################################
228 qemu-img
$(EXESUF
): qemu-img.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
230 qemu-nbd
$(EXESUF
): qemu-nbd.o qemu-tool.o tool-osdep.o
$(BLOCK_OBJS
)
232 qemu-io
$(EXESUF
): qemu-io.o qemu-tool.o tool-osdep.o cmd.o
$(BLOCK_OBJS
)
234 qemu-img
$(EXESUF
) qemu-nbd
$(EXESUF
) qemu-io
$(EXESUF
): LIBS
+= -lz
237 # avoid old build problems by removing potentially incorrect old files
238 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
239 rm -f
*.o
*.d
*.a
$(TOOLS
) TAGS cscope.
* *.pod
*~
*/*~
240 rm -f slirp
/*.o slirp
/*.d audio
/*.o audio
/*.d block
/*.o block
/*.d
241 $(MAKE
) -C tests
clean
242 for d in
$(TARGET_DIRS
) libhw32 libhw64
; do \
243 $(MAKE
) -C
$$d $@ || exit
1 ; \
247 rm -f config-host.mak config-host.h
$(DOCS
) qemu-options.texi
248 rm -f qemu-
{doc
,tech
}.
{info,aux
,cp
,dvi,fn
,info,ky
,log
,pg
,toc
,tp
,vr
}
249 for d in
$(TARGET_DIRS
) libhw32 libhw64
; do \
250 rm -rf
$$d || exit
1 ; \
253 KEYMAPS
=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
254 ar de en-us fi fr-be hr it lv nl pl ru th \
255 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
258 BLOBS
=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
259 video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
260 pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
267 $(INSTALL_DIR
) "$(DESTDIR)$(docdir)"
268 $(INSTALL_DATA
) qemu-doc.html qemu-tech.html
"$(DESTDIR)$(docdir)"
270 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man1"
271 $(INSTALL_DATA
) qemu
.1 qemu-img
.1 "$(DESTDIR)$(mandir)/man1"
272 $(INSTALL_DIR
) "$(DESTDIR)$(mandir)/man8"
273 $(INSTALL_DATA
) qemu-nbd
.8 "$(DESTDIR)$(mandir)/man8"
276 install: all $(if
$(BUILD_DOCS
),install-doc
)
277 $(INSTALL_DIR
) "$(DESTDIR)$(bindir)"
279 $(INSTALL_PROG
) $(STRIP_OPT
) $(TOOLS
) "$(DESTDIR)$(bindir)"
282 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)"
283 set
-e
; for x in
$(BLOBS
); do \
284 $(INSTALL_DATA
) $(SRC_PATH
)/pc-bios
/$$x "$(DESTDIR)$(datadir)"; \
288 $(INSTALL_DIR
) "$(DESTDIR)$(datadir)/keymaps"
289 set
-e
; for x in
$(KEYMAPS
); do \
290 $(INSTALL_DATA
) $(SRC_PATH
)/keymaps
/$$x "$(DESTDIR)$(datadir)/keymaps"; \
293 for d in
$(TARGET_DIRS
); do \
294 $(MAKE
) -C
$$d $@ || exit
1 ; \
297 # various test targets
302 etags
*.
[ch
] tests
/*.
[ch
]
306 find .
-name
"*.[ch]" -print | sed
's,^\./,,' > .
/cscope.files
311 $(call quiet-command
,texi2html
-I
=.
-monolithic
-number
$<," GEN $@")
314 $(call quiet-command
,makeinfo -I .
$< -o
$@
," GEN $@")
317 $(call quiet-command
,texi2dvi -I .
$<," GEN $@")
319 qemu-options.texi
: $(SRC_PATH
)/qemu-options.hx
320 $(call quiet-command
,sh
$(SRC_PATH
)/hxtool
-t
< $< > $@
," GEN $@")
322 qemu
.1: qemu-doc.texi qemu-options.texi
323 $(call quiet-command
, \
324 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu.pod
&& \
325 pod2man
--section
=1 --center
=" " --release
=" " qemu.pod
> $@
, \
328 qemu-img
.1: qemu-img.texi
329 $(call quiet-command
, \
330 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-img.pod
&& \
331 pod2man
--section
=1 --center
=" " --release
=" " qemu-img.pod
> $@
, \
334 qemu-nbd
.8: qemu-nbd.texi
335 $(call quiet-command
, \
336 perl
-Ww
-- $(SRC_PATH
)/texi2pod.pl
$< qemu-nbd.pod
&& \
337 pod2man
--section
=8 --center
=" " --release
=" " qemu-nbd.pod
> $@
, \
340 info: qemu-doc.
info qemu-tech.
info
342 dvi: qemu-doc.
dvi qemu-tech.
dvi
344 html
: qemu-doc.html qemu-tech.html
346 qemu-doc.
dvi qemu-doc.html qemu-doc.
info: qemu-img.texi qemu-nbd.texi qemu-options.texi
348 VERSION ?
= $(shell cat VERSION
)
349 FILE
= qemu-
$(VERSION
)
351 # tar release (use 'make -k tar' on a checkouted tree)
355 cd
/tmp
&& tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
--exclude .git
--exclude .svn
358 # generate a binary distribution
360 cd
/ && tar zcvf ~
/qemu-
$(VERSION
)-$(ARCH
).
tar.gz \
362 $(bindir)/qemu-system-x86_64 \
363 $(bindir)/qemu-system-arm \
364 $(bindir)/qemu-system-cris \
365 $(bindir)/qemu-system-m68k \
366 $(bindir)/qemu-system-mips \
367 $(bindir)/qemu-system-mipsel \
368 $(bindir)/qemu-system-mips64 \
369 $(bindir)/qemu-system-mips64el \
370 $(bindir)/qemu-system-ppc \
371 $(bindir)/qemu-system-ppcemb \
372 $(bindir)/qemu-system-ppc64 \
373 $(bindir)/qemu-system-sh4 \
374 $(bindir)/qemu-system-sh4eb \
375 $(bindir)/qemu-system-sparc \
376 $(bindir)/qemu-i386 \
377 $(bindir)/qemu-x86_64 \
378 $(bindir)/qemu-alpha \
380 $(bindir)/qemu-armeb \
381 $(bindir)/qemu-cris \
382 $(bindir)/qemu-m68k \
383 $(bindir)/qemu-mips \
384 $(bindir)/qemu-mipsel \
386 $(bindir)/qemu-ppc64 \
387 $(bindir)/qemu-ppc64abi32 \
389 $(bindir)/qemu-sh4eb \
390 $(bindir)/qemu-sparc \
391 $(bindir)/qemu-sparc64 \
392 $(bindir)/qemu-sparc32plus \
395 $(datadir)/bios.bin \
396 $(datadir)/vgabios.bin \
397 $(datadir)/vgabios-cirrus.bin \
398 $(datadir)/ppc_rom.bin \
400 $(datadir)/openbios-sparc32 \
401 $(datadir)/openbios-sparc64 \
402 $(datadir)/openbios-ppc \
403 $(datadir)/pxe-ne2k_pci.bin \
404 $(datadir)/pxe-rtl8139.bin \
405 $(datadir)/pxe-pcnet.bin \
406 $(datadir)/pxe-e1000.bin \
407 $(docdir
)/qemu-doc.html \
408 $(docdir
)/qemu-tech.html \
409 $(mandir)/man1
/qemu
.1 \
410 $(mandir)/man1
/qemu-img
.1 \
411 $(mandir)/man8
/qemu-nbd
.8
413 # Include automatically generated dependency files
414 -include $(wildcard *.d audio
/*.d slirp
/*.d block
/*.d
)