3 include config-host.mak
5 .PHONY
: all clean distclean dvi info install install-doc
tar tarbin \
6 speed
test test2 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
16 CPPFLAGS
+= -DQEMU_TOOL
19 BASE_LDFLAGS
+= -static
22 DOCS
=qemu-doc.html qemu-tech.html qemu
.1 qemu-img
.1
29 all: $(TOOLS
) $(DOCS
) recurse-all
31 subdir-
%: dyngen
$(EXESUF
) libqemu_common.a
32 $(MAKE
) -C
$(subst subdir-
,,$@
) all
34 recurse-all
: $(patsubst %,subdir-
%, $(TARGET_DIRS
))
36 ######################################################################
37 # libqemu_common.a: target indepedent part of system emulation. The
38 # long term path is to suppress *all* target specific code in case of
39 # system emulation, i.e. a single QEMU executable should support all
42 OBJS
+=cutils.o readline.o console.o
43 #OBJS+=block.o block-raw.o
44 OBJS
+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o
50 AUDIO_OBJS
= audio.o noaudio.o wavaudio.o mixeng.o
52 AUDIO_OBJS
+= sdlaudio.o
55 AUDIO_OBJS
+= ossaudio.o
57 ifdef CONFIG_COREAUDIO
58 AUDIO_OBJS
+= coreaudio.o
61 AUDIO_OBJS
+= alsaaudio.o
64 AUDIO_OBJS
+= dsoundaudio.o
67 AUDIO_OBJS
+= fmodaudio.o
68 audio
/audio.o audio
/fmodaudio.o
: CPPFLAGS
:= -I
$(CONFIG_FMOD_INC
) $(CPPFLAGS
)
70 AUDIO_OBJS
+= wavcapture.o
71 OBJS
+=$(addprefix audio
/, $(AUDIO_OBJS
))
74 OBJS
+=sdl.o x_keymap.o
83 CPPFLAGS
+=-I
$(SRC_PATH
)/slirp
84 SLIRP_OBJS
=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
85 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
86 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
87 OBJS
+=$(addprefix slirp
/, $(SLIRP_OBJS
))
91 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
93 sdl.o
: sdl.c keymaps.c sdl_keysym.h
94 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(SDL_CFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
96 vnc.o
: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
97 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
99 audio
/sdlaudio.o
: audio
/sdlaudio.c
100 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(SDL_CFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
102 libqemu_common.a
: $(OBJS
)
106 ######################################################################
108 qemu-img
$(EXESUF
): qemu-img.o block.o block-raw.o libqemu_common.a
109 $(CC
) $(LDFLAGS
) $(BASE_LDFLAGS
) -o
$@
$^
-lz
$(LIBS
)
112 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -c
-o
$@
$<
115 dyngen
$(EXESUF
): dyngen.c
116 $(HOST_CC
) $(CFLAGS
) $(CPPFLAGS
) $(BASE_CFLAGS
) -o
$@
$^
119 # avoid old build problems by removing potentially incorrect old files
120 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
121 rm -f
*.o
*.d
*.a
$(TOOLS
) dyngen
$(EXESUF
) TAGS cscope.
* *.pod
*~
*/*~
122 rm -f slirp
/*.o slirp
/*.d audio
/*.o audio
/*.d
123 $(MAKE
) -C tests
clean
124 for d in
$(TARGET_DIRS
); do \
125 $(MAKE
) -C
$$d $@ || exit
1 ; \
129 rm -f config-host.mak config-host.h
$(DOCS
)
130 rm -f qemu-
{doc
,tech
}.
{info,aux
,cp
,dvi,fn
,info,ky
,log
,pg
,toc
,tp
,vr
}
131 for d in
$(TARGET_DIRS
); do \
132 rm -rf
$$d || exit
1 ; \
135 KEYMAPS
=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
136 ar de en-us fi fr-be hr it lv nl pl ru th \
137 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
140 mkdir
-p
"$(DESTDIR)$(docdir)"
141 $(INSTALL
) -m
644 qemu-doc.html qemu-tech.html
"$(DESTDIR)$(docdir)"
143 mkdir
-p
"$(DESTDIR)$(mandir)/man1"
144 $(INSTALL
) qemu
.1 qemu-img
.1 "$(DESTDIR)$(mandir)/man1"
147 install: all $(if
$(BUILD_DOCS
),install-doc
)
148 mkdir
-p
"$(DESTDIR)$(bindir)"
150 $(INSTALL
) -m
755 -s
$(TOOLS
) "$(DESTDIR)$(bindir)"
152 mkdir
-p
"$(DESTDIR)$(datadir)"
153 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
154 video.x openbios-sparc32 pxe-ne2k_pci.bin \
155 pxe-rtl8139.bin pxe-pcnet.bin
; do \
156 $(INSTALL
) -m
644 $(SRC_PATH
)/pc-bios
/$$x "$(DESTDIR)$(datadir)"; \
159 mkdir
-p
"$(DESTDIR)$(datadir)/keymaps"
160 for x in
$(KEYMAPS
); do \
161 $(INSTALL
) -m
644 $(SRC_PATH
)/keymaps
/$$x "$(DESTDIR)$(datadir)/keymaps"; \
164 for d in
$(TARGET_DIRS
); do \
165 $(MAKE
) -C
$$d $@ || exit
1 ; \
168 # various test targets
169 test speed test2
: all
173 etags
*.
[ch
] tests
/*.
[ch
]
177 find .
-name
"*.[ch]" -print > .
/cscope.files
182 texi2html
-monolithic
-number
$<
190 qemu
.1: qemu-doc.texi
191 $(SRC_PATH
)/texi2pod.pl
$< qemu.pod
192 pod2man
--section
=1 --center
=" " --release
=" " qemu.pod
> $@
194 qemu-img
.1: qemu-img.texi
195 $(SRC_PATH
)/texi2pod.pl
$< qemu-img.pod
196 pod2man
--section
=1 --center
=" " --release
=" " qemu-img.pod
> $@
198 info: qemu-doc.
info qemu-tech.
info
200 dvi: qemu-doc.
dvi qemu-tech.
dvi
202 html
: qemu-doc.html qemu-tech.html
204 VERSION ?
= $(shell cat VERSION
)
205 FILE
= qemu-
$(VERSION
)
207 # tar release (use 'make -k tar' on a checkouted tree)
211 ( cd
/tmp
; tar zcvf ~
/$(FILE
).
tar.gz
$(FILE
) --exclude CVS
)
214 # generate a binary distribution
216 ( cd
/ ; tar zcvf ~
/qemu-
$(VERSION
)-$(ARCH
).
tar.gz \
218 $(bindir)/qemu-system-ppc \
219 $(bindir)/qemu-system-ppc64 \
220 $(bindir)/qemu-system-ppcemb \
221 $(bindir)/qemu-system-sparc \
222 $(bindir)/qemu-system-x86_64 \
223 $(bindir)/qemu-system-mips \
224 $(bindir)/qemu-system-mipsel \
225 $(bindir)/qemu-system-mips64 \
226 $(bindir)/qemu-system-mips64el \
227 $(bindir)/qemu-system-arm \
228 $(bindir)/qemu-system-m68k \
229 $(bindir)/qemu-system-sh4 \
230 $(bindir)/qemu-i386 \
232 $(bindir)/qemu-armeb \
233 $(bindir)/qemu-sparc \
235 $(bindir)/qemu-ppc64 \
236 $(bindir)/qemu-mips \
237 $(bindir)/qemu-mipsel \
238 $(bindir)/qemu-mipsn32 \
239 $(bindir)/qemu-mipsn32el \
240 $(bindir)/qemu-mips64 \
241 $(bindir)/qemu-mips64el \
242 $(bindir)/qemu-alpha \
243 $(bindir)/qemu-m68k \
246 $(datadir)/bios.bin \
247 $(datadir)/vgabios.bin \
248 $(datadir)/vgabios-cirrus.bin \
249 $(datadir)/ppc_rom.bin \
251 $(datadir)/openbios-sparc32 \
252 $(datadir)/pxe-ne2k_pci.bin \
253 $(datadir)/pxe-rtl8139.bin \
254 $(datadir)/pxe-pcnet.bin \
255 $(docdir
)/qemu-doc.html \
256 $(docdir
)/qemu-tech.html \
257 $(mandir)/man1
/qemu
.1 $(mandir)/man1
/qemu-img
.1 )
259 ifneq ($(wildcard .depend
),)
263 # Include automatically generated dependency files
264 -include $(wildcard *.d audio
/*.d slirp
/*.d
)