Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 265 lines (218 sloc) 7.147 kB
0cb3fb1 Add doc, html, dvi and .PHONY Makefile targets.
pbrook authored
1 # Makefile for QEMU.
2
ad06484 Fix out of tree builds.
pbrook authored
3 include config-host.mak
766a487 ppc build
bellard authored
4
0cb3fb1 Add doc, html, dvi and .PHONY Makefile targets.
pbrook authored
5 .PHONY: all clean distclean dvi info install install-doc tar tarbin \
6 speed test test2 html dvi info
7
6f30fa8 Untangle the various CFLAGS/LDFLAGS flavours. Allow overriding the
ths authored
8 BASE_CFLAGS=
9 BASE_LDFLAGS=
10
3142255 Sparc host update (Ben Taylor, Martin Bochnig)
blueswir1 authored
11 BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
12 BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
13
4fb240a compile common code once
bellard authored
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
766a487 ppc build
bellard authored
17 LIBS=
1f50f8d better install
bellard authored
18 ifdef CONFIG_STATIC
6f30fa8 Untangle the various CFLAGS/LDFLAGS flavours. Allow overriding the
ths authored
19 BASE_LDFLAGS += -static
1f50f8d better install
bellard authored
20 endif
cc8ae6d Autodetect tools neccessary for building documentation.
pbrook authored
21 ifdef BUILD_DOCS
acd935e doc update - added qemu-img manual page
bellard authored
22 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
cc8ae6d Autodetect tools neccessary for building documentation.
pbrook authored
23 else
24 DOCS=
25 endif
aa05ae6 added exec.h
bellard authored
26
70956b7 Better way to select -lrt, by Andrzei Zaborowski.
ths authored
27 LIBS+=$(AIOLIBS)
83f6409 async file I/O API
bellard authored
28
da0b0df Fix Makefile dependencies.
pbrook authored
29 all: $(TOOLS) $(DOCS) recurse-all
b9dea4f Move all: target first.
pbrook authored
30
da0b0df Fix Makefile dependencies.
pbrook authored
31 subdir-%: dyngen$(EXESUF) libqemu_common.a
4aa4253 Allow parallel make.
pbrook authored
32 $(MAKE) -C $(subst subdir-,,$@) all
33
34 recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
83f6409 async file I/O API
bellard authored
35
4fb240a compile common code once
bellard authored
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
40 # CPUs and machines.
47cea61 vmdk2raw: convert VMware disk images to raw images
bellard authored
41
4fb240a compile common code once
bellard authored
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
45
46 ifdef CONFIG_WIN32
47 OBJS+=tap-win32.o
48 endif
49
50 AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
51 ifdef CONFIG_SDL
52 AUDIO_OBJS += sdlaudio.o
53 endif
54 ifdef CONFIG_OSS
55 AUDIO_OBJS += ossaudio.o
56 endif
57 ifdef CONFIG_COREAUDIO
58 AUDIO_OBJS += coreaudio.o
59 endif
60 ifdef CONFIG_ALSA
61 AUDIO_OBJS += alsaaudio.o
62 endif
63 ifdef CONFIG_DSOUND
64 AUDIO_OBJS += dsoundaudio.o
65 endif
66 ifdef CONFIG_FMOD
67 AUDIO_OBJS += fmodaudio.o
68 audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
69 endif
70 AUDIO_OBJS+= wavcapture.o
71 OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
72
73 ifdef CONFIG_SDL
74 OBJS+=sdl.o x_keymap.o
75 endif
76 OBJS+=vnc.o d3des.o
77
78 ifdef CONFIG_COCOA
79 OBJS+=cocoa.o
80 endif
81
82 ifdef CONFIG_SLIRP
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))
88 endif
89
90 cocoa.o: cocoa.m
91 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
92
93 sdl.o: sdl.c keymaps.c sdl_keysym.h
94 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
95
96 vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
97 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
98
99 audio/sdlaudio.o: audio/sdlaudio.c
100 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
101
102 libqemu_common.a: $(OBJS)
103 rm -f $@
104 $(AR) rcs $@ $(OBJS)
105
106 ######################################################################
107
108 qemu-img$(EXESUF): qemu-img.o block.o block-raw.o libqemu_common.a
109 $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
110
111 %.o: %.c
112 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
113
114 # dyngen host tool
11d9f69 win32 cross compile fix
bellard authored
115 dyngen$(EXESUF): dyngen.c
6f30fa8 Untangle the various CFLAGS/LDFLAGS flavours. Allow overriding the
ths authored
116 $(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
31e31b8 This commit was generated by cvs2svn to compensate for changes in r2,
bellard authored
117
118 clean:
2d80ae8 avoid problems if make clean was not made before updating
bellard authored
119 # avoid old build problems by removing potentially incorrect old files
5fafdf2 find -type f | xargs sed -i 's/[\t ]$//g' # on most files
ths authored
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
4fb240a compile common code once
bellard authored
121 rm -f *.o *.d *.a $(TOOLS) dyngen$(EXESUF) TAGS cscope.* *.pod *~ */*~
122 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d
7d3505c bsd port (Markus Niemisto)
bellard authored
123 $(MAKE) -C tests clean
626df76 build all targets at the same time
bellard authored
124 for d in $(TARGET_DIRS); do \
7d3505c bsd port (Markus Niemisto)
bellard authored
125 $(MAKE) -C $$d $@ || exit 1 ; \
626df76 build all targets at the same time
bellard authored
126 done
31e31b8 This commit was generated by cvs2svn to compensate for changes in r2,
bellard authored
127
7d13299 added translation cache
bellard authored
128 distclean: clean
cc8ae6d Autodetect tools neccessary for building documentation.
pbrook authored
129 rm -f config-host.mak config-host.h $(DOCS)
0cb3fb1 Add doc, html, dvi and .PHONY Makefile targets.
pbrook authored
130 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
76bc683 updated
bellard authored
131 for d in $(TARGET_DIRS); do \
bc1b050 fixed distclean target
bellard authored
132 rm -rf $$d || exit 1 ; \
76bc683 updated
bellard authored
133 done
7d13299 added translation cache
bellard authored
134
fed4a9a keymap install fix
bellard authored
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
138
38954dc Add install-doc rule. Use it when building docs.
pbrook authored
139 install-doc: $(DOCS)
140 mkdir -p "$(DESTDIR)$(docdir)"
141 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
142 ifndef CONFIG_WIN32
143 mkdir -p "$(DESTDIR)$(mandir)/man1"
144 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
145 endif
146
147 install: all $(if $(BUILD_DOCS),install-doc)
1236cab DESTDIR makefile support.
pbrook authored
148 mkdir -p "$(DESTDIR)$(bindir)"
932a79d Don't install tools if $(TOOLS) is empty, by Thayne Harbaugh.
ths authored
149 ifneq ($(TOOLS),)
6a88264 Allow user to specify "install" utility.
pbrook authored
150 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
932a79d Don't install tools if $(TOOLS) is empty, by Thayne Harbaugh.
ths authored
151 endif
1236cab DESTDIR makefile support.
pbrook authored
152 mkdir -p "$(DESTDIR)$(datadir)"
ad06484 Fix out of tree builds.
pbrook authored
153 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
860c6c5 Delete linux_boot.bin from the install target.
ths authored
154 video.x openbios-sparc32 pxe-ne2k_pci.bin \
eec85c2 Add -boot n option for x86 using PXE, by Anthony Liguori.
ths authored
155 pxe-rtl8139.bin pxe-pcnet.bin; do \
6a88264 Allow user to specify "install" utility.
pbrook authored
156 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
ad06484 Fix out of tree builds.
pbrook authored
157 done
11d9f69 win32 cross compile fix
bellard authored
158 ifndef CONFIG_WIN32
1236cab DESTDIR makefile support.
pbrook authored
159 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
ad06484 Fix out of tree builds.
pbrook authored
160 for x in $(KEYMAPS); do \
6a88264 Allow user to specify "install" utility.
pbrook authored
161 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
ad06484 Fix out of tree builds.
pbrook authored
162 done
11d9f69 win32 cross compile fix
bellard authored
163 endif
626df76 build all targets at the same time
bellard authored
164 for d in $(TARGET_DIRS); do \
7d3505c bsd port (Markus Niemisto)
bellard authored
165 $(MAKE) -C $$d $@ || exit 1 ; \
626df76 build all targets at the same time
bellard authored
166 done
612384d added libgemu.a build
bellard authored
167
367e86e new x86 CPU core
bellard authored
168 # various test targets
82c7e2a update
bellard authored
169 test speed test2: all
7d3505c bsd port (Markus Niemisto)
bellard authored
170 $(MAKE) -C tests $@
31e31b8 This commit was generated by cvs2svn to compensate for changes in r2,
bellard authored
171
5fafdf2 find -type f | xargs sed -i 's/[\t ]$//g' # on most files
ths authored
172 TAGS:
b9adb4a PowerPC disas code
bellard authored
173 etags *.[ch] tests/*.[ch]
31e31b8 This commit was generated by cvs2svn to compensate for changes in r2,
bellard authored
174
6688bc6 cscope rule
bellard authored
175 cscope:
176 rm -f ./cscope.*
177 find . -name "*.[ch]" -print > ./cscope.files
178 cscope -b
179
3ef693a distribution patches
bellard authored
180 # documentation
1f67313 doc update
bellard authored
181 %.html: %.texi
3ef693a distribution patches
bellard authored
182 texi2html -monolithic -number $<
183
f354832 info and dvi doc targets
bellard authored
184 %.info: %.texi
185 makeinfo $< -o $@
186
187 %.dvi: %.texi
188 texi2dvi $<
189
5a67135 automatic man page generation - BIOS installation
bellard authored
190 qemu.1: qemu-doc.texi
ad06484 Fix out of tree builds.
pbrook authored
191 $(SRC_PATH)/texi2pod.pl $< qemu.pod
5a67135 automatic man page generation - BIOS installation
bellard authored
192 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
193
acd935e doc update - added qemu-img manual page
bellard authored
194 qemu-img.1: qemu-img.texi
ad06484 Fix out of tree builds.
pbrook authored
195 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
acd935e doc update - added qemu-img manual page
bellard authored
196 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
197
0cb3fb1 Add doc, html, dvi and .PHONY Makefile targets.
pbrook authored
198 info: qemu-doc.info qemu-tech.info
199
200 dvi: qemu-doc.dvi qemu-tech.dvi
201
202 html: qemu-doc.html qemu-tech.html
203
df5cf72 Make the tarball's VERSION part overridable from make invocation.
ths authored
204 VERSION ?= $(shell cat VERSION)
205 FILE = qemu-$(VERSION)
586314f better debug support
bellard authored
206
1e43adf new directory structure - changed naming of qemu and vl
bellard authored
207 # tar release (use 'make -k tar' on a checkouted tree)
586314f better debug support
bellard authored
208 tar:
209 rm -rf /tmp/$(FILE)
1e43adf new directory structure - changed naming of qemu and vl
bellard authored
210 cp -r . /tmp/$(FILE)
76b62fd added binary archive
bellard authored
211 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
586314f better debug support
bellard authored
212 rm -rf /tmp/$(FILE)
213
76b62fd added binary archive
bellard authored
214 # generate a binary distribution
d691f66 glibc2.2 fixes - more command line options - misc doc fixes
bellard authored
215 tarbin:
4887d78 Don't hardcode the host architecture name.
ths authored
216 ( cd / ; tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
43095f3 tarbin fix
bellard authored
217 $(bindir)/qemu \
7efa438 better packaging support
bellard authored
218 $(bindir)/qemu-system-ppc \
d4082e9 New target for embedded PowerPC emulation (only system emulation, for…
j_mayer authored
219 $(bindir)/qemu-system-ppc64 \
220 $(bindir)/qemu-system-ppcemb \
acd935e doc update - added qemu-img manual page
bellard authored
221 $(bindir)/qemu-system-sparc \
43095f3 tarbin fix
bellard authored
222 $(bindir)/qemu-system-x86_64 \
93856aa update tarbin target
bellard authored
223 $(bindir)/qemu-system-mips \
3826099 mipsel configure support (Thiemo Seufer).
pbrook authored
224 $(bindir)/qemu-system-mipsel \
fbe4f65 MIPS64 configurations.
ths authored
225 $(bindir)/qemu-system-mips64 \
226 $(bindir)/qemu-system-mips64el \
ea31eb5 update
bellard authored
227 $(bindir)/qemu-system-arm \
ff1aaf6 Update tarbin rule.
ths authored
228 $(bindir)/qemu-system-m68k \
229 $(bindir)/qemu-system-sh4 \
7efa438 better packaging support
bellard authored
230 $(bindir)/qemu-i386 \
231 $(bindir)/qemu-arm \
ea31eb5 update
bellard authored
232 $(bindir)/qemu-armeb \
7efa438 better packaging support
bellard authored
233 $(bindir)/qemu-sparc \
234 $(bindir)/qemu-ppc \
d4082e9 New target for embedded PowerPC emulation (only system emulation, for…
j_mayer authored
235 $(bindir)/qemu-ppc64 \
ea31eb5 update
bellard authored
236 $(bindir)/qemu-mips \
237 $(bindir)/qemu-mipsel \
540635b Code provision for n32/n64 mips userland emulation. Not functional yet.
ths authored
238 $(bindir)/qemu-mipsn32 \
239 $(bindir)/qemu-mipsn32el \
240 $(bindir)/qemu-mips64 \
241 $(bindir)/qemu-mips64el \
cf6c1b1 Rules needed to compile linux user-mode alpha target.
j_mayer authored
242 $(bindir)/qemu-alpha \
ff1aaf6 Update tarbin rule.
ths authored
243 $(bindir)/qemu-m68k \
244 $(bindir)/qemu-sh4 \
b932cab new disk image layer
bellard authored
245 $(bindir)/qemu-img \
7efa438 better packaging support
bellard authored
246 $(datadir)/bios.bin \
247 $(datadir)/vgabios.bin \
de9258a specific VGA BIOS for Cirrus VGA Card
bellard authored
248 $(datadir)/vgabios-cirrus.bin \
637f6cd ppc bios
bellard authored
249 $(datadir)/ppc_rom.bin \
d529525 VGA bios support for PowerPC
bellard authored
250 $(datadir)/video.x \
0986ac3 use OpenBIOS instead of Proll on sparc (Blue Swirl)
bellard authored
251 $(datadir)/openbios-sparc32 \
19c80e5 update
bellard authored
252 $(datadir)/pxe-ne2k_pci.bin \
253 $(datadir)/pxe-rtl8139.bin \
254 $(datadir)/pxe-pcnet.bin \
1f50f8d better install
bellard authored
255 $(docdir)/qemu-doc.html \
256 $(docdir)/qemu-tech.html \
acd935e doc update - added qemu-img manual page
bellard authored
257 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
d691f66 glibc2.2 fixes - more command line options - misc doc fixes
bellard authored
258
31e31b8 This commit was generated by cvs2svn to compensate for changes in r2,
bellard authored
259 ifneq ($(wildcard .depend),)
260 include .depend
261 endif
4fb240a compile common code once
bellard authored
262
263 # Include automatically generated dependency files
264 -include $(wildcard *.d audio/*.d slirp/*.d)
Something went wrong with that request. Please try again.