blob: d4e851304f5a2fc7e2b024c8bfe0546c364b58d0 [file] [log] [blame]
pbrook0cb3fb12006-05-14 12:07:53 +00001# Makefile for QEMU.
2
aurel3255d7e8f2009-04-15 14:42:57 +00003ifneq ($(wildcard config-host.mak),)
Paul Brook1ad21342009-05-19 16:17:58 +01004# Put the all: rule here so that config-host.mak can contain dependencies.
5all: build-all
pbrookad064842006-04-16 12:41:07 +00006include config-host.mak
aliguori17759182009-01-21 18:12:52 +00007include $(SRC_PATH)/rules.mak
aurel3255d7e8f2009-04-15 14:42:57 +00008else
9config-host.mak:
10 @echo "Please call configure before running make!"
11 @exit 1
12endif
bellard766a4872003-02-18 23:35:48 +000013
aliguori818220f2008-09-24 01:13:40 +000014.PHONY: all clean cscope distclean dvi html info install install-doc \
15 recurse-all speed tar tarbin test
pbrook0cb3fb12006-05-14 12:07:53 +000016
pbrook8c462f82007-11-18 21:12:37 +000017VPATH=$(SRC_PATH):$(SRC_PATH)/hw
18
aliguori17759182009-01-21 18:12:52 +000019
bellard40293e52008-01-31 11:32:10 +000020CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
21LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
blueswir131422552007-04-16 18:27:06 +000022
malc96935aa2008-07-02 21:16:22 +000023CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
bellard4fb240a2007-11-07 19:24:02 +000024CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
Anthony Liguori4a244702009-06-17 14:27:09 -050025CPPFLAGS += -U_FORTIFY_SOURCE
bellard766a4872003-02-18 23:35:48 +000026LIBS=
bellard1f50f8d2004-05-08 14:44:43 +000027ifdef CONFIG_STATIC
bellard40293e52008-01-31 11:32:10 +000028LDFLAGS += -static
bellard1f50f8d2004-05-08 14:44:43 +000029endif
pbrookcc8ae6d2006-04-23 17:57:59 +000030ifdef BUILD_DOCS
bellard7a5ca862008-05-27 21:13:40 +000031DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
pbrookcc8ae6d2006-04-23 17:57:59 +000032else
33DOCS=
34endif
bellard7d132992003-03-06 23:23:54 +000035
aliguorie5d355d2009-04-24 18:03:15 +000036LIBS+=$(PTHREADLIBS)
37LIBS+=$(CLOCKLIBS)
bellard83f64092006-08-01 16:21:11 +000038
aliguori7e00eb92008-08-02 01:57:02 +000039ifdef CONFIG_SOLARIS
40LIBS+=-lsocket -lnsl -lresolv
41endif
42
aliguori03ff3ca2008-09-15 15:51:35 +000043ifdef CONFIG_WIN32
44LIBS+=-lwinmm -lws2_32 -liphlpapi
45endif
46
Alexander Graf253d0942009-06-29 15:37:40 +020047build-all: $(TOOLS) $(DOCS) roms recurse-all
pbrookb9dea4f2006-05-13 16:54:03 +000048
aurel3255d7e8f2009-04-15 14:42:57 +000049config-host.mak: configure
50ifneq ($(wildcard config-host.mak),)
51 @echo $@ is out-of-date, running configure
blueswir1052ff922009-04-17 20:01:12 +000052 @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
aurel3255d7e8f2009-04-15 14:42:57 +000053endif
54
Paul Brook00873752009-05-07 02:00:31 +010055SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
pbrookcec7d0b2008-05-28 16:44:57 +000056SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
57
aurel3286e840e2008-12-07 15:21:23 +000058subdir-%:
Paul Brook00873752009-05-07 02:00:31 +010059 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
pbrook4aa42532006-05-13 13:55:08 +000060
pbrookcec7d0b2008-05-28 16:44:57 +000061$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
62$(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
63
64recurse-all: $(SUBDIR_RULES)
bellard83f64092006-08-01 16:21:11 +000065
pbrookfaf07962007-11-11 02:51:17 +000066#######################################################################
Juan Quintela319f08e2009-06-25 00:08:02 +020067# block-obj-y is code used by both qemu system emulation and qemu-img
pbrookfaf07962007-11-11 02:51:17 +000068
Juan Quintela319f08e2009-06-25 00:08:02 +020069block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
70block-obj-y += block/cow.o block/qcow.o aes.o block/vmdk.o block/cloop.o
71block-obj-y += block/dmg.o block/bochs.o block/vpc.o block/vvfat.o
72block-obj-y += block/qcow2.o block/qcow2-refcount.o block/qcow2-cluster.o
73block-obj-y += block/qcow2-snapshot.o
74block-obj-y += block/parallels.o block/nbd.o
75block-obj-y += nbd.o block.o aio.o
aliguori03ff3ca2008-09-15 15:51:35 +000076
77ifdef CONFIG_WIN32
Juan Quintela319f08e2009-06-25 00:08:02 +020078block-obj-y += block/raw-win32.o
aliguori03ff3ca2008-09-15 15:51:35 +000079else
aliguori3c529d92008-12-12 16:41:40 +000080ifdef CONFIG_AIO
Juan Quintela319f08e2009-06-25 00:08:02 +020081block-obj-y += posix-aio-compat.o
aliguori3c529d92008-12-12 16:41:40 +000082endif
Juan Quintela319f08e2009-06-25 00:08:02 +020083block-obj-y += block/raw-posix.o
aliguori03ff3ca2008-09-15 15:51:35 +000084endif
85
Alexander Graf769ce762009-05-11 17:41:42 +020086ifdef CONFIG_CURL
Juan Quintela319f08e2009-06-25 00:08:02 +020087block-obj-y += block/curl.o
Alexander Graf769ce762009-05-11 17:41:42 +020088endif
89
bellard4fb240a2007-11-07 19:24:02 +000090######################################################################
bellard2e2ea902008-02-01 10:02:52 +000091# libqemu_common.a: Target independent part of system emulation. The
bellard4fb240a2007-11-07 19:24:02 +000092# long term path is to suppress *all* target specific code in case of
93# system emulation, i.e. a single QEMU executable should support all
94# CPUs and machines.
bellard47cea612004-05-17 20:06:42 +000095
Juan Quintela319f08e2009-06-25 00:08:02 +020096OBJS=$(block-obj-y)
pbrook87ecb682007-11-17 17:14:51 +000097OBJS+=readline.o console.o
aliguoricd01b4a2008-08-21 19:25:45 +000098
blueswir1e9c28332009-04-11 09:04:44 +000099OBJS+=irq.o ptimer.o
pbrook87ecb682007-11-17 17:14:51 +0000100OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
balrog7e7c5e42008-04-14 21:57:44 +0000101OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
blueswir1e9c28332009-04-11 09:04:44 +0000102OBJS+=tmp105.o lm832x.o eeprom93xx.o tsc2005.o
pbrook87ecb682007-11-17 17:14:51 +0000103OBJS+=scsi-disk.o cdrom.o
ths985a03b2007-12-24 16:10:43 +0000104OBJS+=scsi-generic.o
blueswir168063642008-11-22 21:03:55 +0000105OBJS+=usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
balrog6c9f8862008-07-17 20:47:13 +0000106OBJS+=usb-serial.o usb-net.o
pbrook775616c2007-11-24 23:35:08 +0000107OBJS+=sd.o ssi-sd.o
balroge6a6d5a2008-09-29 00:40:44 +0000108OBJS+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
blueswir1e9c28332009-04-11 09:04:44 +0000109OBJS+=bt-hci-csr.o
aliguori559b90f2008-11-11 21:20:14 +0000110OBJS+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
malc902b3d52008-12-10 19:18:40 +0000111OBJS+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
blueswir1e9c28332009-04-11 09:04:44 +0000112OBJS+=msmouse.o ps2.o
Paul Brook90d37232009-05-14 22:35:09 +0100113OBJS+=qdev.o ssi.o
pbrook87ecb682007-11-17 17:14:51 +0000114
aurel322e4d9fb2008-04-08 06:01:02 +0000115ifdef CONFIG_BRLAPI
116OBJS+= baum.o
117LIBS+=-lbrlapi
118endif
119
bellard4fb240a2007-11-07 19:24:02 +0000120ifdef CONFIG_WIN32
121OBJS+=tap-win32.o
aliguori559b90f2008-11-11 21:20:14 +0000122else
123OBJS+=migration-exec.o
bellard4fb240a2007-11-07 19:24:02 +0000124endif
125
126AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
127ifdef CONFIG_SDL
128AUDIO_OBJS += sdlaudio.o
129endif
130ifdef CONFIG_OSS
131AUDIO_OBJS += ossaudio.o
132endif
133ifdef CONFIG_COREAUDIO
134AUDIO_OBJS += coreaudio.o
balrogca9cc282008-01-14 04:24:29 +0000135AUDIO_PT = yes
bellard4fb240a2007-11-07 19:24:02 +0000136endif
137ifdef CONFIG_ALSA
138AUDIO_OBJS += alsaaudio.o
139endif
140ifdef CONFIG_DSOUND
141AUDIO_OBJS += dsoundaudio.o
142endif
143ifdef CONFIG_FMOD
144AUDIO_OBJS += fmodaudio.o
145audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
146endif
balrogca9cc282008-01-14 04:24:29 +0000147ifdef CONFIG_ESD
148AUDIO_PT = yes
149AUDIO_PT_INT = yes
150AUDIO_OBJS += esdaudio.o
151endif
malcb8e59f12008-07-02 21:03:08 +0000152ifdef CONFIG_PA
153AUDIO_PT = yes
154AUDIO_PT_INT = yes
155AUDIO_OBJS += paaudio.o
156endif
balrogca9cc282008-01-14 04:24:29 +0000157ifdef AUDIO_PT
158LDFLAGS += -pthread
159endif
160ifdef AUDIO_PT_INT
161AUDIO_OBJS += audio_pt_int.o
162endif
bellard4fb240a2007-11-07 19:24:02 +0000163AUDIO_OBJS+= wavcapture.o
164OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
165
aliguori04837552009-03-06 20:27:10 +0000166OBJS+=keymaps.o
bellard4fb240a2007-11-07 19:24:02 +0000167ifdef CONFIG_SDL
Stefano Stabellinic18a2c32009-06-24 11:58:25 +0100168OBJS+=sdl.o sdl_zoom.o x_keymap.o
bellard4fb240a2007-11-07 19:24:02 +0000169endif
balrog4d3b6f62008-02-10 16:33:14 +0000170ifdef CONFIG_CURSES
171OBJS+=curses.o
172endif
aliguori76655d62009-03-06 20:27:37 +0000173OBJS+=vnc.o acl.o d3des.o
aliguori5fb6c7a2009-03-06 20:27:23 +0000174ifdef CONFIG_VNC_TLS
175OBJS+=vnc-tls.o vnc-auth-vencrypt.o
176endif
aliguori2f9606b2009-03-06 20:27:28 +0000177ifdef CONFIG_VNC_SASL
178OBJS+=vnc-auth-sasl.o
179endif
bellard4fb240a2007-11-07 19:24:02 +0000180
181ifdef CONFIG_COCOA
182OBJS+=cocoa.o
183endif
184
aliguorie5d355d2009-04-24 18:03:15 +0000185ifdef CONFIG_IOTHREAD
186OBJS+=qemu-thread.o
187endif
188
bellard4fb240a2007-11-07 19:24:02 +0000189ifdef CONFIG_SLIRP
190CPPFLAGS+=-I$(SRC_PATH)/slirp
191SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
192slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
Jan Kiszka9f349492009-06-24 14:42:29 +0200193tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o
bellard4fb240a2007-11-07 19:24:02 +0000194OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
195endif
196
ths8a16d272008-07-19 09:56:24 +0000197LIBS+=$(VDE_LIBS)
198
Blue Swirl2567f572009-05-21 15:54:48 +0000199# xen backend driver support
200XEN_OBJS := xen_backend.o xen_devconfig.o
201XEN_OBJS += xen_console.o xenfb.o xen_disk.o xen_nic.o
202ifdef CONFIG_XEN
203 OBJS += $(XEN_OBJS)
204endif
205
Alexander Graf769ce762009-05-11 17:41:42 +0200206LIBS+=$(CURL_LIBS)
207
bellard4fb240a2007-11-07 19:24:02 +0000208cocoa.o: cocoa.m
bellard4fb240a2007-11-07 19:24:02 +0000209
aliguori04837552009-03-06 20:27:10 +0000210keymaps.o: keymaps.c keymaps.h
211
Stefano Stabellinic18a2c32009-06-24 11:58:25 +0100212sdl_zoom.o: sdl_zoom.c sdl_zoom.h sdl_zoom_template.h
213
214sdl.o: sdl.c keymaps.h sdl_keysym.h sdl_zoom.h
aliguori807544e2009-01-21 18:12:44 +0000215
Anthony Liguori537fe2d2009-06-16 15:17:22 -0500216sdl.o audio/sdlaudio.o baum.o: CFLAGS += $(SDL_CFLAGS)
bellard4fb240a2007-11-07 19:24:02 +0000217
aliguori76655d62009-03-06 20:27:37 +0000218acl.o: acl.h acl.c
219
aliguori2f9606b2009-03-06 20:27:28 +0000220vnc.h: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
aliguori5fb6c7a2009-03-06 20:27:23 +0000221
aliguori76655d62009-03-06 20:27:37 +0000222vnc.o: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
aliguori807544e2009-01-21 18:12:44 +0000223
224vnc.o: CFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
bellard4fb240a2007-11-07 19:24:02 +0000225
aliguori5fb6c7a2009-03-06 20:27:23 +0000226vnc-tls.o: vnc-tls.c vnc.h
227
228vnc-auth-vencrypt.o: vnc-auth-vencrypt.c vnc.h
229
aliguori2f9606b2009-03-06 20:27:28 +0000230vnc-auth-sasl.o: vnc-auth-sasl.c vnc.h
231
aliguori04837552009-03-06 20:27:10 +0000232curses.o: curses.c keymaps.h curses_keys.h
balrog4d3b6f62008-02-10 16:33:14 +0000233
aliguori807544e2009-01-21 18:12:44 +0000234bt-host.o: CFLAGS += $(CONFIG_BLUEZ_CFLAGS)
bellard4fb240a2007-11-07 19:24:02 +0000235
236libqemu_common.a: $(OBJS)
bellard4fb240a2007-11-07 19:24:02 +0000237
pbrookcec7d0b2008-05-28 16:44:57 +0000238#######################################################################
239# USER_OBJS is code used by qemu userspace emulation
malc902b3d52008-12-10 19:18:40 +0000240USER_OBJS=cutils.o cache-utils.o
pbrookcec7d0b2008-05-28 16:44:57 +0000241
242libqemu_user.a: $(USER_OBJS)
pbrookcec7d0b2008-05-28 16:44:57 +0000243
bellard4fb240a2007-11-07 19:24:02 +0000244######################################################################
245
Stuart Brady153859b2009-06-07 00:42:17 +0100246qemu-img.o: qemu-img-cmds.h
247
Juan Quintela319f08e2009-06-25 00:08:02 +0200248qemu-img$(EXESUF): qemu-img.o qemu-tool.o tool-osdep.o $(block-obj-y)
bellard4fb240a2007-11-07 19:24:02 +0000249
Juan Quintela319f08e2009-06-25 00:08:02 +0200250qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o tool-osdep.o $(block-obj-y)
aliguori3aa892d2009-01-21 18:13:02 +0000251
Juan Quintela319f08e2009-06-25 00:08:02 +0200252qemu-io$(EXESUF): qemu-io.o qemu-tool.o tool-osdep.o cmd.o $(block-obj-y)
aliguori0a8e1ac2009-04-05 18:41:23 +0000253
254qemu-img$(EXESUF) qemu-nbd$(EXESUF) qemu-io$(EXESUF): LIBS += -lz
bellard7a5ca862008-05-27 21:13:40 +0000255
Stuart Brady153859b2009-06-07 00:42:17 +0100256qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
257 $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@")
258
bellard31e31b82003-02-18 22:55:36 +0000259clean:
bellard2d80ae82003-08-11 23:01:33 +0000260# avoid old build problems by removing potentially incorrect old files
ths5fafdf22007-09-16 21:08:06 +0000261 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
aurel3286e840e2008-12-07 15:21:23 +0000262 rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~
Anthony Liguori019d6b82009-05-09 17:14:19 -0500263 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d
Blue Swirl07b44ce2009-06-09 18:45:16 +0000264 rm -f qemu-img-cmds.h
bellard7d3505c2004-05-12 19:32:15 +0000265 $(MAKE) -C tests clean
Alexander Graf253d0942009-06-29 15:37:40 +0200266 for d in $(TARGET_DIRS) $(ROMS) libhw32 libhw64; do \
bellard7d3505c2004-05-12 19:32:15 +0000267 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +0000268 done
bellard31e31b82003-02-18 22:55:36 +0000269
bellard7d132992003-03-06 23:23:54 +0000270distclean: clean
Stuart Brady153859b2009-06-07 00:42:17 +0100271 rm -f config-host.mak config-host.h $(DOCS) qemu-options.texi qemu-img-cmds.texi
pbrook0cb3fb12006-05-14 12:07:53 +0000272 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
Paul Brook1ad21342009-05-19 16:17:58 +0100273 for d in $(TARGET_DIRS) libhw32 libhw64; do \
bellardbc1b0502003-10-28 00:12:52 +0000274 rm -rf $$d || exit 1 ; \
bellard76bc6832003-08-10 23:41:46 +0000275 done
bellard7d132992003-03-06 23:23:54 +0000276
bellardfed4a9a2004-12-12 22:18:34 +0000277KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
278ar de en-us fi fr-be hr it lv nl pl ru th \
279common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
280
ths77755342008-11-27 15:45:16 +0000281ifdef INSTALL_BLOBS
282BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
aurel32e5d01b02009-01-09 11:01:31 +0000283video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
284pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
Alexander Graf253d0942009-06-29 15:37:40 +0200285bamboo.dtb petalogix-s3adsp1800.dtb \
286multiboot.bin
ths77755342008-11-27 15:45:16 +0000287else
288BLOBS=
289endif
290
Alexander Graf253d0942009-06-29 15:37:40 +0200291roms:
292 for d in $(ROMS); do \
293 $(MAKE) -C $$d || exit 1 ; \
294 done
295
pbrook38954dc2006-04-30 23:54:18 +0000296install-doc: $(DOCS)
aliguori58f8aea2009-04-18 15:36:02 +0000297 $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
298 $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
pbrook38954dc2006-04-30 23:54:18 +0000299ifndef CONFIG_WIN32
aliguori58f8aea2009-04-18 15:36:02 +0000300 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
301 $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
302 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
303 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
pbrook38954dc2006-04-30 23:54:18 +0000304endif
305
306install: all $(if $(BUILD_DOCS),install-doc)
aliguori58f8aea2009-04-18 15:36:02 +0000307 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ths932a79d2007-10-20 18:29:34 +0000308ifneq ($(TOOLS),)
aliguori58f8aea2009-04-18 15:36:02 +0000309 $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
ths932a79d2007-10-20 18:29:34 +0000310endif
ths77755342008-11-27 15:45:16 +0000311ifneq ($(BLOBS),)
aliguori58f8aea2009-04-18 15:36:02 +0000312 $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
ths77755342008-11-27 15:45:16 +0000313 set -e; for x in $(BLOBS); do \
aliguori58f8aea2009-04-18 15:36:02 +0000314 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
pbrookad064842006-04-16 12:41:07 +0000315 done
ths77755342008-11-27 15:45:16 +0000316endif
aliguori58f8aea2009-04-18 15:36:02 +0000317 $(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
blueswir118be8d72008-03-05 18:16:09 +0000318 set -e; for x in $(KEYMAPS); do \
Anthony Liguori79fd42a2009-05-28 03:11:42 -0500319 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
pbrookad064842006-04-16 12:41:07 +0000320 done
bellard626df762003-08-10 21:39:31 +0000321 for d in $(TARGET_DIRS); do \
bellard7d3505c2004-05-12 19:32:15 +0000322 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +0000323 done
bellard612384d2003-03-22 17:31:19 +0000324
bellard367e86e2003-03-01 17:13:26 +0000325# various test targets
bellard9b0b8202007-11-14 10:34:57 +0000326test speed: all
bellard7d3505c2004-05-12 19:32:15 +0000327 $(MAKE) -C tests $@
bellard31e31b82003-02-18 22:55:36 +0000328
ths5fafdf22007-09-16 21:08:06 +0000329TAGS:
bellardb9adb4a2003-04-29 20:41:16 +0000330 etags *.[ch] tests/*.[ch]
bellard31e31b82003-02-18 22:55:36 +0000331
bellard6688bc62005-08-21 09:23:39 +0000332cscope:
333 rm -f ./cscope.*
aurel32ede46082008-10-01 21:46:58 +0000334 find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files
bellard6688bc62005-08-21 09:23:39 +0000335 cscope -b
336
bellard3ef693a2003-03-23 20:17:16 +0000337# documentation
bellard1f673132004-04-04 15:21:17 +0000338%.html: %.texi
aliguori0d00e562009-04-05 17:40:46 +0000339 $(call quiet-command,texi2html -I=. -monolithic -number $<," GEN $@")
bellard3ef693a2003-03-23 20:17:16 +0000340
bellardf3548322006-04-30 22:51:54 +0000341%.info: %.texi
aliguori0d00e562009-04-05 17:40:46 +0000342 $(call quiet-command,makeinfo -I . $< -o $@," GEN $@")
bellardf3548322006-04-30 22:51:54 +0000343
344%.dvi: %.texi
aliguori0d00e562009-04-05 17:40:46 +0000345 $(call quiet-command,texi2dvi -I . $<," GEN $@")
blueswir15824d652009-03-28 06:44:27 +0000346
347qemu-options.texi: $(SRC_PATH)/qemu-options.hx
aliguori0d00e562009-04-05 17:40:46 +0000348 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
bellardf3548322006-04-30 22:51:54 +0000349
Blue Swirl23130862009-06-06 08:22:04 +0000350qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
351 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
352
Stuart Brady153859b2009-06-07 00:42:17 +0100353qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
354 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
355
Blue Swirl23130862009-06-06 08:22:04 +0000356qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
aliguori0d00e562009-04-05 17:40:46 +0000357 $(call quiet-command, \
358 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod && \
359 pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
360 " GEN $@")
bellard5a671352003-10-01 00:13:48 +0000361
Stuart Brady153859b2009-06-07 00:42:17 +0100362qemu-img.1: qemu-img.texi qemu-img-cmds.texi
aliguori0d00e562009-04-05 17:40:46 +0000363 $(call quiet-command, \
364 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod && \
365 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
366 " GEN $@")
bellardacd935e2004-11-15 22:57:26 +0000367
bellard7a5ca862008-05-27 21:13:40 +0000368qemu-nbd.8: qemu-nbd.texi
aliguori0d00e562009-04-05 17:40:46 +0000369 $(call quiet-command, \
370 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod && \
371 pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
372 " GEN $@")
bellard7a5ca862008-05-27 21:13:40 +0000373
pbrook0cb3fb12006-05-14 12:07:53 +0000374info: qemu-doc.info qemu-tech.info
375
376dvi: qemu-doc.dvi qemu-tech.dvi
377
378html: qemu-doc.html qemu-tech.html
379
Stuart Brady153859b2009-06-07 00:42:17 +0100380qemu-doc.dvi qemu-doc.html qemu-doc.info: qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-monitor.texi qemu-img-cmds.texi
aliguori818220f2008-09-24 01:13:40 +0000381
thsdf5cf722007-01-24 22:56:36 +0000382VERSION ?= $(shell cat VERSION)
383FILE = qemu-$(VERSION)
bellard586314f2003-03-03 15:02:29 +0000384
bellard1e43adf2003-09-30 20:54:24 +0000385# tar release (use 'make -k tar' on a checkouted tree)
bellard586314f2003-03-03 15:02:29 +0000386tar:
387 rm -rf /tmp/$(FILE)
bellard1e43adf2003-09-30 20:54:24 +0000388 cp -r . /tmp/$(FILE)
aurel3299c6c082008-04-22 20:45:30 +0000389 cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
bellard586314f2003-03-03 15:02:29 +0000390 rm -rf /tmp/$(FILE)
391
bellard76b62fd2003-10-28 00:47:44 +0000392# generate a binary distribution
bellardd691f662003-03-24 21:58:34 +0000393tarbin:
blueswir118be8d72008-03-05 18:16:09 +0000394 cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
bellard43095f32005-04-27 20:49:23 +0000395 $(bindir)/qemu \
bellard43095f32005-04-27 20:49:23 +0000396 $(bindir)/qemu-system-x86_64 \
aurel3240e8a532009-01-03 12:35:57 +0000397 $(bindir)/qemu-system-arm \
398 $(bindir)/qemu-system-cris \
399 $(bindir)/qemu-system-m68k \
bellard93856aa2005-07-24 18:44:35 +0000400 $(bindir)/qemu-system-mips \
pbrook38260992006-03-11 14:51:13 +0000401 $(bindir)/qemu-system-mipsel \
thsfbe4f652007-04-01 11:16:48 +0000402 $(bindir)/qemu-system-mips64 \
403 $(bindir)/qemu-system-mips64el \
aurel3240e8a532009-01-03 12:35:57 +0000404 $(bindir)/qemu-system-ppc \
405 $(bindir)/qemu-system-ppcemb \
406 $(bindir)/qemu-system-ppc64 \
thsff1aaf62007-09-29 21:18:26 +0000407 $(bindir)/qemu-system-sh4 \
ths85ffbdf2007-12-09 05:10:03 +0000408 $(bindir)/qemu-system-sh4eb \
aurel3240e8a532009-01-03 12:35:57 +0000409 $(bindir)/qemu-system-sparc \
bellard7efa4382004-05-12 18:54:06 +0000410 $(bindir)/qemu-i386 \
bellardf0403c02008-01-06 18:27:12 +0000411 $(bindir)/qemu-x86_64 \
aurel3240e8a532009-01-03 12:35:57 +0000412 $(bindir)/qemu-alpha \
413 $(bindir)/qemu-arm \
414 $(bindir)/qemu-armeb \
415 $(bindir)/qemu-cris \
416 $(bindir)/qemu-m68k \
417 $(bindir)/qemu-mips \
418 $(bindir)/qemu-mipsel \
419 $(bindir)/qemu-ppc \
420 $(bindir)/qemu-ppc64 \
421 $(bindir)/qemu-ppc64abi32 \
422 $(bindir)/qemu-sh4 \
423 $(bindir)/qemu-sh4eb \
424 $(bindir)/qemu-sparc \
425 $(bindir)/qemu-sparc64 \
426 $(bindir)/qemu-sparc32plus \
427 $(bindir)/qemu-img \
428 $(bindir)/qemu-nbd \
bellard7efa4382004-05-12 18:54:06 +0000429 $(datadir)/bios.bin \
430 $(datadir)/vgabios.bin \
bellardde9258a2004-06-06 15:50:03 +0000431 $(datadir)/vgabios-cirrus.bin \
bellard637f6cd2004-06-21 19:54:47 +0000432 $(datadir)/ppc_rom.bin \
bellardd5295252005-07-03 14:00:51 +0000433 $(datadir)/video.x \
bellard0986ac32006-06-14 12:36:32 +0000434 $(datadir)/openbios-sparc32 \
blueswir1938255d2008-04-23 19:38:07 +0000435 $(datadir)/openbios-sparc64 \
aurel32e5d01b02009-01-09 11:01:31 +0000436 $(datadir)/openbios-ppc \
aurel3240e8a532009-01-03 12:35:57 +0000437 $(datadir)/pxe-ne2k_pci.bin \
bellard19c80e52007-02-05 21:22:42 +0000438 $(datadir)/pxe-rtl8139.bin \
aurel3240e8a532009-01-03 12:35:57 +0000439 $(datadir)/pxe-pcnet.bin \
aliguori29919902008-07-26 16:53:22 +0000440 $(datadir)/pxe-e1000.bin \
bellard1f50f8d2004-05-08 14:44:43 +0000441 $(docdir)/qemu-doc.html \
442 $(docdir)/qemu-tech.html \
aurel3240e8a532009-01-03 12:35:57 +0000443 $(mandir)/man1/qemu.1 \
444 $(mandir)/man1/qemu-img.1 \
bellard7a5ca862008-05-27 21:13:40 +0000445 $(mandir)/man8/qemu-nbd.8
bellardd691f662003-03-24 21:58:34 +0000446
bellard4fb240a2007-11-07 19:24:02 +0000447# Include automatically generated dependency files
Anthony Liguori019d6b82009-05-09 17:14:19 -0500448-include $(wildcard *.d audio/*.d slirp/*.d block/*.d)