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