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