]> git.proxmox.com Git - qemu.git/blame - Makefile
Emulate a serial bluetooth HCI with H4+ extensions and attach to n8x0's UART.
[qemu.git] / Makefile
CommitLineData
0cb3fb1e
PB
1# Makefile for QEMU.
2
ad064840 3include config-host.mak
766a487a 4
818220f5
AL
5.PHONY: all clean cscope distclean dvi html info install install-doc \
6 recurse-all speed tar tarbin test
0cb3fb1e 7
8c462f8f
PB
8VPATH=$(SRC_PATH):$(SRC_PATH)/hw
9
40293e58
FB
10CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
11LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
3142255c 12
96935aa4 13CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
4fb240a4 14CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
766a487a 15LIBS=
1f50f8d1 16ifdef CONFIG_STATIC
40293e58 17LDFLAGS += -static
1f50f8d1 18endif
cc8ae6de 19ifdef BUILD_DOCS
7a5ca864 20DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
cc8ae6de
PB
21else
22DOCS=
23endif
aa05ae6f 24
70956b77 25LIBS+=$(AIOLIBS)
83f64091 26
7e00eb9b
AL
27ifdef CONFIG_SOLARIS
28LIBS+=-lsocket -lnsl -lresolv
29endif
30
03ff3ca3
AL
31ifdef CONFIG_WIN32
32LIBS+=-lwinmm -lws2_32 -liphlpapi
33endif
34
818220f5 35all: $(TOOLS) $(DOCS) recurse-all
b9dea4fb 36
cec7d0b6
PB
37SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
38
39subdir-%: dyngen$(EXESUF)
4aa42531
PB
40 $(MAKE) -C $(subst subdir-,,$@) all
41
cec7d0b6
PB
42$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
43$(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
44
45recurse-all: $(SUBDIR_RULES)
83f64091 46
faf07963
PB
47#######################################################################
48# BLOCK_OBJS is code used by both qemu system emulation and qemu-img
49
17e2377a 50BLOCK_OBJS=cutils.o qemu-malloc.o
faf07963
PB
51BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o
52BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
03ff3ca3 53BLOCK_OBJS+=block-qcow2.o block-parallels.o block-nbd.o
a76bab49 54BLOCK_OBJS+=nbd.o block.o aio.o
03ff3ca3
AL
55
56ifdef CONFIG_WIN32
57BLOCK_OBJS += block-raw-win32.o
58else
59BLOCK_OBJS += block-raw-posix.o
60endif
61
62ifdef CONFIG_AIO
63BLOCK_OBJS += compatfd.o
cd01b4a3 64endif
faf07963 65
4fb240a4 66######################################################################
2e2ea909 67# libqemu_common.a: Target independent part of system emulation. The
4fb240a4
FB
68# long term path is to suppress *all* target specific code in case of
69# system emulation, i.e. a single QEMU executable should support all
70# CPUs and machines.
47cea614 71
cd01b4a3 72OBJS=$(BLOCK_OBJS)
87ecb68b 73OBJS+=readline.o console.o
cd01b4a3 74
87ecb68b
PB
75OBJS+=irq.o
76OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
7e7c5e4c 77OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
1d4e547b 78OBJS+=tmp105.o lm832x.o
87ecb68b 79OBJS+=scsi-disk.o cdrom.o
985a03b0 80OBJS+=scsi-generic.o
6c9f886c
AZ
81OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o
82OBJS+=usb-serial.o usb-net.o
775616c3 83OBJS+=sd.o ssi-sd.o
1ae26a18 84OBJS+=bt.o
87ecb68b 85
2e4d9fb1
AJ
86ifdef CONFIG_BRLAPI
87OBJS+= baum.o
88LIBS+=-lbrlapi
89endif
90
4fb240a4
FB
91ifdef CONFIG_WIN32
92OBJS+=tap-win32.o
93endif
94
95AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
96ifdef CONFIG_SDL
97AUDIO_OBJS += sdlaudio.o
98endif
99ifdef CONFIG_OSS
100AUDIO_OBJS += ossaudio.o
101endif
102ifdef CONFIG_COREAUDIO
103AUDIO_OBJS += coreaudio.o
ca9cc28c 104AUDIO_PT = yes
4fb240a4
FB
105endif
106ifdef CONFIG_ALSA
107AUDIO_OBJS += alsaaudio.o
108endif
109ifdef CONFIG_DSOUND
110AUDIO_OBJS += dsoundaudio.o
111endif
112ifdef CONFIG_FMOD
113AUDIO_OBJS += fmodaudio.o
114audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
115endif
ca9cc28c
AZ
116ifdef CONFIG_ESD
117AUDIO_PT = yes
118AUDIO_PT_INT = yes
119AUDIO_OBJS += esdaudio.o
120endif
b8e59f18 121ifdef CONFIG_PA
122AUDIO_PT = yes
123AUDIO_PT_INT = yes
124AUDIO_OBJS += paaudio.o
125endif
ca9cc28c
AZ
126ifdef AUDIO_PT
127LDFLAGS += -pthread
128endif
129ifdef AUDIO_PT_INT
130AUDIO_OBJS += audio_pt_int.o
131endif
4fb240a4
FB
132AUDIO_OBJS+= wavcapture.o
133OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
134
135ifdef CONFIG_SDL
136OBJS+=sdl.o x_keymap.o
137endif
4d3b6f6e
AZ
138ifdef CONFIG_CURSES
139OBJS+=curses.o
140endif
4fb240a4
FB
141OBJS+=vnc.o d3des.o
142
143ifdef CONFIG_COCOA
144OBJS+=cocoa.o
145endif
146
147ifdef CONFIG_SLIRP
148CPPFLAGS+=-I$(SRC_PATH)/slirp
149SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
150slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
151tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
152OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
153endif
154
8a16d273
TS
155LIBS+=$(VDE_LIBS)
156
4fb240a4 157cocoa.o: cocoa.m
40293e58 158 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
4fb240a4
FB
159
160sdl.o: sdl.c keymaps.c sdl_keysym.h
40293e58 161 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $<
4fb240a4
FB
162
163vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
40293e58 164 $(CC) $(CFLAGS) $(CPPFLAGS) $(CONFIG_VNC_TLS_CFLAGS) -c -o $@ $<
4fb240a4 165
4d3b6f6e 166curses.o: curses.c keymaps.c curses_keys.h
f5d28393 167 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
4d3b6f6e 168
4fb240a4 169audio/sdlaudio.o: audio/sdlaudio.c
40293e58 170 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $<
4fb240a4
FB
171
172libqemu_common.a: $(OBJS)
173 rm -f $@
174 $(AR) rcs $@ $(OBJS)
175
cec7d0b6
PB
176#######################################################################
177# USER_OBJS is code used by qemu userspace emulation
178USER_OBJS=cutils.o
179
180libqemu_user.a: $(USER_OBJS)
181 rm -f $@
182 $(AR) rcs $@ $(USER_OBJS)
183
4fb240a4
FB
184######################################################################
185
03ff3ca3 186qemu-img$(EXESUF): qemu-img.o qemu-tool.o osdep.o $(BLOCK_OBJS)
40293e58 187 $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
4fb240a4
FB
188
189%.o: %.c
40293e58 190 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
4fb240a4 191
03ff3ca3 192qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS)
7a5ca864
FB
193 $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
194
4fb240a4 195# dyngen host tool
11d9f695 196dyngen$(EXESUF): dyngen.c
40293e58 197 $(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^
31e31b8a
FB
198
199clean:
2d80ae89 200# avoid old build problems by removing potentially incorrect old files
5fafdf24 201 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
4fb240a4 202 rm -f *.o *.d *.a $(TOOLS) dyngen$(EXESUF) TAGS cscope.* *.pod *~ */*~
b94ec3ec 203 rm -rf dyngen.dSYM
4fb240a4 204 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d
7d3505c5 205 $(MAKE) -C tests clean
626df76a 206 for d in $(TARGET_DIRS); do \
7d3505c5 207 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 208 done
31e31b8a 209
7d13299d 210distclean: clean
cc8ae6de 211 rm -f config-host.mak config-host.h $(DOCS)
0cb3fb1e 212 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
76bc6838 213 for d in $(TARGET_DIRS); do \
bc1b050d 214 rm -rf $$d || exit 1 ; \
76bc6838 215 done
7d13299d 216
fed4a9ad
FB
217KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
218ar de en-us fi fr-be hr it lv nl pl ru th \
219common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
220
38954dca
PB
221install-doc: $(DOCS)
222 mkdir -p "$(DESTDIR)$(docdir)"
223 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
224ifndef CONFIG_WIN32
225 mkdir -p "$(DESTDIR)$(mandir)/man1"
226 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
7a5ca864
FB
227 mkdir -p "$(DESTDIR)$(mandir)/man8"
228 $(INSTALL) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
38954dca
PB
229endif
230
231install: all $(if $(BUILD_DOCS),install-doc)
1236cab7 232 mkdir -p "$(DESTDIR)$(bindir)"
932a79df 233ifneq ($(TOOLS),)
6a882643 234 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
932a79df 235endif
1236cab7 236 mkdir -p "$(DESTDIR)$(datadir)"
18be8d77 237 set -e; for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
938255d2 238 video.x openbios-sparc32 openbios-sparc64 pxe-ne2k_pci.bin \
2991990b 239 pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin; do \
6a882643 240 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
ad064840 241 done
11d9f695 242ifndef CONFIG_WIN32
1236cab7 243 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
18be8d77 244 set -e; for x in $(KEYMAPS); do \
6a882643 245 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
ad064840 246 done
11d9f695 247endif
626df76a 248 for d in $(TARGET_DIRS); do \
7d3505c5 249 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 250 done
612384d7 251
367e86e8 252# various test targets
9b0b8203 253test speed: all
7d3505c5 254 $(MAKE) -C tests $@
31e31b8a 255
5fafdf24 256TAGS:
b9adb4a6 257 etags *.[ch] tests/*.[ch]
31e31b8a 258
6688bc6d
FB
259cscope:
260 rm -f ./cscope.*
261 find . -name "*.[ch]" -print > ./cscope.files
262 cscope -b
263
3ef693a0 264# documentation
1f673135 265%.html: %.texi
3ef693a0
FB
266 texi2html -monolithic -number $<
267
f3548328
FB
268%.info: %.texi
269 makeinfo $< -o $@
270
271%.dvi: %.texi
272 texi2dvi $<
273
5a67135a 274qemu.1: qemu-doc.texi
ad064840 275 $(SRC_PATH)/texi2pod.pl $< qemu.pod
5a67135a
FB
276 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
277
acd935ef 278qemu-img.1: qemu-img.texi
ad064840 279 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
acd935ef
FB
280 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
281
7a5ca864
FB
282qemu-nbd.8: qemu-nbd.texi
283 $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod
284 pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@
285
0cb3fb1e
PB
286info: qemu-doc.info qemu-tech.info
287
288dvi: qemu-doc.dvi qemu-tech.dvi
289
290html: qemu-doc.html qemu-tech.html
291
818220f5
AL
292qemu-doc.dvi qemu-doc.html qemu-doc.info: qemu-img.texi qemu-nbd.texi
293
df5cf721
TS
294VERSION ?= $(shell cat VERSION)
295FILE = qemu-$(VERSION)
586314f2 296
1e43adfc 297# tar release (use 'make -k tar' on a checkouted tree)
586314f2
FB
298tar:
299 rm -rf /tmp/$(FILE)
1e43adfc 300 cp -r . /tmp/$(FILE)
99c6c082 301 cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
586314f2
FB
302 rm -rf /tmp/$(FILE)
303
76b62fd0 304# generate a binary distribution
d691f669 305tarbin:
18be8d77 306 cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
43095f31 307 $(bindir)/qemu \
7efa4387 308 $(bindir)/qemu-system-ppc \
d4082e95
JM
309 $(bindir)/qemu-system-ppc64 \
310 $(bindir)/qemu-system-ppcemb \
acd935ef 311 $(bindir)/qemu-system-sparc \
43095f31 312 $(bindir)/qemu-system-x86_64 \
93856aac 313 $(bindir)/qemu-system-mips \
38260998 314 $(bindir)/qemu-system-mipsel \
fbe4f65b
TS
315 $(bindir)/qemu-system-mips64 \
316 $(bindir)/qemu-system-mips64el \
ea31eb5b 317 $(bindir)/qemu-system-arm \
ff1aaf65
TS
318 $(bindir)/qemu-system-m68k \
319 $(bindir)/qemu-system-sh4 \
85ffbdfc 320 $(bindir)/qemu-system-sh4eb \
f0403c03 321 $(bindir)/qemu-system-cris \
7efa4387 322 $(bindir)/qemu-i386 \
f0403c03 323 $(bindir)/qemu-x86_64 \
7efa4387 324 $(bindir)/qemu-arm \
ea31eb5b 325 $(bindir)/qemu-armeb \
7efa4387 326 $(bindir)/qemu-sparc \
f0403c03
FB
327 $(bindir)/qemu-sparc32plus \
328 $(bindir)/qemu-sparc64 \
7efa4387 329 $(bindir)/qemu-ppc \
d4082e95 330 $(bindir)/qemu-ppc64 \
f0403c03 331 $(bindir)/qemu-ppc64abi32 \
ea31eb5b
FB
332 $(bindir)/qemu-mips \
333 $(bindir)/qemu-mipsel \
cf6c1b16 334 $(bindir)/qemu-alpha \
ff1aaf65
TS
335 $(bindir)/qemu-m68k \
336 $(bindir)/qemu-sh4 \
85ffbdfc 337 $(bindir)/qemu-sh4eb \
f0403c03 338 $(bindir)/qemu-cris \
b932caba 339 $(bindir)/qemu-img \
7a5ca864 340 $(bindir)/qemu-nbd \
7efa4387
FB
341 $(datadir)/bios.bin \
342 $(datadir)/vgabios.bin \
de9258a8 343 $(datadir)/vgabios-cirrus.bin \
637f6cd7 344 $(datadir)/ppc_rom.bin \
d5295253 345 $(datadir)/video.x \
0986ac3b 346 $(datadir)/openbios-sparc32 \
938255d2 347 $(datadir)/openbios-sparc64 \
19c80e50
FB
348 $(datadir)/pxe-ne2k_pci.bin \
349 $(datadir)/pxe-rtl8139.bin \
350 $(datadir)/pxe-pcnet.bin \
2991990b 351 $(datadir)/pxe-e1000.bin \
1f50f8d1
FB
352 $(docdir)/qemu-doc.html \
353 $(docdir)/qemu-tech.html \
18be8d77 354 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1
7a5ca864 355 $(mandir)/man8/qemu-nbd.8
d691f669 356
4fb240a4
FB
357# Include automatically generated dependency files
358-include $(wildcard *.d audio/*.d slirp/*.d)