3 include config-host.mak
5 .PHONY
: all clean distclean dvi info install install-doc
tar tarbin \
6 speed
test html
dvi info
11 BASE_CFLAGS
+= $(OS_CFLAGS
) $(ARCH_CFLAGS
)
12 BASE_LDFLAGS
+= $(OS_LDFLAGS
) $(ARCH_LDFLAGS
)
14 CPPFLAGS
+= -I.
-I
$(SRC_PATH
) -MMD
-MP
15 CPPFLAGS
+= -D_GNU_SOURCE
-D_FILE_OFFSET_BITS
=64 -D_LARGEFILE_SOURCE
18 BASE_LDFLAGS
+= -static
21 DOCS
=qemu-doc.html qemu-tech.html qemu
.1 qemu-img
.1
28 all: $(TOOLS
) $(DOCS
) recurse-all
30 subdir-
%: dyngen
$(EXESUF
) libqemu_common.a
31 $(MAKE
) -C
$(subst subdir-
,,$@
) all
33 recurse-all
: $(patsubst %,subdir-
%, $(TARGET_DIRS
))
35 #######################################################################
36 # BLOCK_OBJS is code used by both qemu system emulation and qemu-img
39 BLOCK_OBJS
+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o
40 BLOCK_OBJS
+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
41 BLOCK_OBJS
+=block-qcow2.o block-parallels.o
43 ######################################################################
44 # libqemu_common.a: Target indepedent part of system emulation. The
45 # long term path is to suppress *all* target specific code in case of
46 # system emulation, i.e. a single QEMU executable should support all
50 OBJS
+=readline.o console.o
57 AUDIO_OBJS
= audio.o noaudio.o wavaudio.o mixeng.o
59 AUDIO_OBJS
+= sdlaudio.o
62 AUDIO_OBJS
+= ossaudio.o
64 ifdef CONFIG_COREAUDIO
65 AUDIO_OBJS
+= coreaudio.o
68 AUDIO_OBJS
+= alsaaudio.o
71 AUDIO_OBJS
+= dsoundaudio.o
74 AUDIO_OBJS
+= fmodaudio.o
75 audio
/audio.o audio
/fmodaudio.o
: CPPFLAGS
:= -I
$(CONFIG_FMOD_INC
) $(CPPFLAGS
)
77 AUDIO_OBJS
+= wavcapture.o
78 OBJS
+=$(addprefix audio
/, $(AUDIO_OBJS
))
81 OBJS
+=sdl.o x_keymap.o
90 CPPFLAGS
+=-I
$(SRC_PATH
)/slirp
91 SLIRP_OBJS
=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
92 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
93 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
94 OBJS
+=$(addprefix slirp
/, $(SLIRP_OBJS
))
98 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
100 sdl.o
: sdl.c keymaps.c sdl_keysym.h
101 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(SDL_CFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
103 vnc.o
: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
104 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
106 audio
/sdlaudio.o
: audio
/sdlaudio.c
107 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(SDL_CFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
109 libqemu_common.a
: $(OBJS
)
113 ######################################################################
115 qemu-img
$(EXESUF
): qemu-img.o qemu-img-block.o qemu-img-block-raw.o
$(BLOCK_OBJS
)
116 $(CC
) $(LDFLAGS
) $(BASE_LDFLAGS
) -o
$@
$^
-lz
$(LIBS
)
119 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -DQEMU_IMG
$(BASE_CFLAGS
) -c
-o
$@
$<
122 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
125 dyngen
$(EXESUF
): dyngen.c
126 $(HOST_CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -o
$@
$^
129 # avoid old build problems by removing potentially incorrect old files
130 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
131 rm -f
*.o
*.d
*.a
$(TOOLS
) dyngen
$(EXESUF
) TAGS cscope.
* *.pod
*~
*/*~
132 rm -f slirp
/*.o slirp
/*.d audio
/*.o audio
/*.d
133 $(MAKE
) -C tests
clean
134 for d in
$(TARGET_DIRS
); do \
135 $(MAKE
) -C
$$d $@ || exit
1 ; \
139 rm -f config-host.mak config-host.h
$(DOCS
)
140 rm -f qemu-
{doc
,tech
}.
{info,aux
,cp
,dvi,fn
,info,ky
,log
,pg
,toc
,tp
,vr
}
141 for d in
$(TARGET_DIRS
); do \
142 rm -rf
$$d || exit
1 ; \
145 KEYMAPS
=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
146 ar de en-us fi fr-be hr it lv nl pl ru th \
147 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
150 mkdir
-p
"$(DESTDIR)$(docdir)"
151 $(INSTALL
) -m
644 qemu-doc.html qemu-tech.html
"$(DESTDIR)$(docdir)"
153 mkdir
-p
"$(DESTDIR)$(mandir)/man1"
154 $(INSTALL
) qemu
.1 qemu-img
.1 "$(DESTDIR)$(mandir)/man1"
157 install: all $(if
$(BUILD_DOCS
),install-doc
)
158 mkdir
-p
"$(DESTDIR)$(bindir)"
160 $(INSTALL
) -m
755 -s
$(TOOLS
) "$(DESTDIR)$(bindir)"
162 mkdir
-p
"$(DESTDIR)$(datadir)"
163 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
164 video.x openbios-sparc32 pxe-ne2k_pci.bin \
165 pxe-rtl8139.bin pxe-pcnet.bin
; do \
166 $(INSTALL
) -m
644 $(SRC_PATH
)/pc-bios
/$$x "$(DESTDIR)$(datadir)"; \
169 mkdir
-p
"$(DESTDIR)$(datadir)/keymaps"
170 for x in
$(KEYMAPS
); do \
171 $(INSTALL
) -m
644 $(SRC_PATH
)/keymaps
/$$x "$(DESTDIR)$(datadir)/keymaps"; \
174 for d in
$(TARGET_DIRS
); do \
175 $(MAKE
) -C
$$d $@ || exit
1 ; \
178 # various test targets
183 etags
*.
[ch
] tests
/*.
[ch
]
187 find .
-name
"*.[ch]" -print > .
/cscope.files
192 texi2html
-monolithic
-number
$<
200 qemu
.1: qemu-doc.texi
201 $(SRC_PATH
)/texi2pod.pl
$< qemu.pod
202 pod2man
--section
=1 --center
=" " --release
=" " qemu.pod
> $@
204 qemu-img
.1: qemu-img.texi
205 $(SRC_PATH
)/texi2pod.pl
$< qemu-img.pod
206 pod2man
--section
=1 --center
=" " --release
=" " qemu-img.pod
> $@
208 info: qemu-doc.
info qemu-tech.
info
210 dvi: qemu-doc.
dvi qemu-tech.
dvi
212 html
: qemu-doc.html qemu-tech.html
214 VERSION ?
= $(shell cat VERSION
)
215 FILE
= qemu-
$(VERSION
)
217 # tar release (use 'make -k tar' on a checkouted tree)
221 ( cd
/tmp
; tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
)
224 # generate a binary distribution
226 ( cd
/ ; tar zcvf ~
/qemu-
$(VERSION
)-$(ARCH
).
tar.gz \
228 $(bindir)/qemu-system-ppc \
229 $(bindir)/qemu-system-ppc64 \
230 $(bindir)/qemu-system-ppcemb \
231 $(bindir)/qemu-system-sparc \
232 $(bindir)/qemu-system-x86_64 \
233 $(bindir)/qemu-system-mips \
234 $(bindir)/qemu-system-mipsel \
235 $(bindir)/qemu-system-mips64 \
236 $(bindir)/qemu-system-mips64el \
237 $(bindir)/qemu-system-arm \
238 $(bindir)/qemu-system-m68k \
239 $(bindir)/qemu-system-sh4 \
240 $(bindir)/qemu-i386 \
242 $(bindir)/qemu-armeb \
243 $(bindir)/qemu-sparc \
245 $(bindir)/qemu-ppc64 \
246 $(bindir)/qemu-mips \
247 $(bindir)/qemu-mipsel \
248 $(bindir)/qemu-mipsn32 \
249 $(bindir)/qemu-mipsn32el \
250 $(bindir)/qemu-mips64 \
251 $(bindir)/qemu-mips64el \
252 $(bindir)/qemu-alpha \
253 $(bindir)/qemu-m68k \
256 $(datadir)/bios.bin \
257 $(datadir)/vgabios.bin \
258 $(datadir)/vgabios-cirrus.bin \
259 $(datadir)/ppc_rom.bin \
261 $(datadir)/openbios-sparc32 \
262 $(datadir)/pxe-ne2k_pci.bin \
263 $(datadir)/pxe-rtl8139.bin \
264 $(datadir)/pxe-pcnet.bin \
265 $(docdir
)/qemu-doc.html \
266 $(docdir
)/qemu-tech.html \
267 $(mandir)/man1
/qemu
.1 $(mandir)/man1
/qemu-img
.1 )
269 ifneq ($(wildcard .depend
),)
273 # Include automatically generated dependency files
274 -include $(wildcard *.d audio
/*.d slirp
/*.d
)