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