blob: 062c129cf8afd59bb161cacaa029953f3b788ad2 [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
Juan Quintelae5efe7f2009-10-07 02:40:59 +02008config-host.mak: configure
9 @echo $@ is out-of-date, running configure
10 @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
aurel3255d7e8f2009-04-15 14:42:57 +000011else
12config-host.mak:
13 @echo "Please call configure before running make!"
14 @exit 1
15endif
bellard766a4872003-02-18 23:35:48 +000016
Juan Quintelad9ace8b2009-10-06 21:11:15 +020017# Don't try to regenerate Makefile or configure
18# We don't generate any of them
19Makefile: ;
20configure: ;
21
aliguori818220f2008-09-24 01:13:40 +000022.PHONY: all clean cscope distclean dvi html info install install-doc \
Juan Quintela9c927652009-10-06 21:11:12 +020023 recurse-all speed tar tarbin test build-all
pbrook0cb3fb12006-05-14 12:07:53 +000024
pbrook8c462f82007-11-18 21:12:37 +000025VPATH=$(SRC_PATH):$(SRC_PATH)/hw
26
Juan Quintela3e2e0e62009-08-03 14:47:06 +020027LIBS+=-lz $(LIBS_TOOLS)
Juan Quintela67c0f082009-07-27 16:12:51 +020028
pbrookcc8ae6d2006-04-23 17:57:59 +000029ifdef BUILD_DOCS
bellard7a5ca862008-05-27 21:13:40 +000030DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
pbrookcc8ae6d2006-04-23 17:57:59 +000031else
32DOCS=
33endif
bellard7d132992003-03-06 23:23:54 +000034
Juan Quintela1215c6e2009-10-07 02:40:58 +020035SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
Juan Quintela1f3d3c82009-10-07 02:41:02 +020036SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
37
38config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
39 $(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep "=y$$" | sort -u > $@," GEN $@")
40
41-include config-all-devices.mak
Juan Quintela1215c6e2009-10-07 02:40:58 +020042
43build-all: config-host.h
44 $(call quiet-command, $(MAKE) $(SUBDIR_MAKEFLAGS) $(TOOLS) $(DOCS) recurse-all,)
pbrookb9dea4f2006-05-13 16:54:03 +000045
Juan Quintela1215c6e2009-10-07 02:40:58 +020046config-host.h: config-host.h-timestamp
47config-host.h-timestamp: config-host.mak
48
pbrookcec7d0b2008-05-28 16:44:57 +000049SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
50
Juan Quintela1215c6e2009-10-07 02:40:58 +020051subdir-%: config-host.h
Paul Brook00873752009-05-07 02:00:31 +010052 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
pbrook4aa42532006-05-13 13:55:08 +000053
pbrookcec7d0b2008-05-28 16:44:57 +000054$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
Paul Brookc05ac892009-07-31 13:18:32 +010055
Blue Swirladd16152009-09-27 16:26:02 +000056$(filter %-user,$(SUBDIR_RULES)): libuser.a
57
58libuser.a:
59 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libuser V="$(V)" TARGET_DIR="$*/" all,)
60
Paul Brookc05ac892009-07-31 13:18:32 +010061ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
62romsubdir-%:
63 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
64
65ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
66
67recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
bellard83f64092006-08-01 16:21:11 +000068
pbrookfaf07962007-11-11 02:51:17 +000069#######################################################################
Juan Quintela319f08e2009-06-25 00:08:02 +020070# block-obj-y is code used by both qemu system emulation and qemu-img
pbrookfaf07962007-11-11 02:51:17 +000071
Juan Quintela319f08e2009-06-25 00:08:02 +020072block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
Anthony Liguoria25a0ef2009-08-10 17:14:11 -050073block-obj-y += nbd.o block.o aio.o aes.o osdep.o
Christoph Hellwig4dd75c72009-08-10 23:39:39 +020074block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
Christoph Hellwig5c6c3a62009-08-20 16:58:35 +020075block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
Juan Quintela1a65ba72009-07-16 17:57:03 +020076
Stefan Weil9aebd982009-07-31 21:45:56 +020077block-nested-y += cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
Juan Quintela1a65ba72009-07-16 17:57:03 +020078block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o
79block-nested-y += parallels.o nbd.o
Juan Quintelaeeb6d452009-07-27 16:13:08 +020080block-nested-$(CONFIG_WIN32) += raw-win32.o
81block-nested-$(CONFIG_POSIX) += raw-posix.o
Juan Quintela1a65ba72009-07-16 17:57:03 +020082block-nested-$(CONFIG_CURL) += curl.o
83
84block-obj-y += $(addprefix block/, $(block-nested-y))
Alexander Graf769ce762009-05-11 17:41:42 +020085
bellard4fb240a2007-11-07 19:24:02 +000086######################################################################
bellard2e2ea902008-02-01 10:02:52 +000087# libqemu_common.a: Target independent part of system emulation. The
bellard4fb240a2007-11-07 19:24:02 +000088# long term path is to suppress *all* target specific code in case of
89# system emulation, i.e. a single QEMU executable should support all
90# CPUs and machines.
bellard47cea612004-05-17 20:06:42 +000091
Juan Quintela6ef859b2009-06-25 00:08:07 +020092obj-y = $(block-obj-y)
Kirill A. Shutemov34005a02009-09-12 02:17:55 +030093obj-y += readline.o console.o
aliguoricd01b4a2008-08-21 19:25:45 +000094
Blue Swirlc2b023b2009-09-20 19:20:05 +000095obj-y += tcg-runtime.o host-utils.o
Blue Swirlafcea8c2009-09-20 16:05:47 +000096obj-y += irq.o ptimer.o ioport.o
Juan Quintela6ef859b2009-06-25 00:08:07 +020097obj-y += i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
98obj-y += ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
99obj-y += tmp105.o lm832x.o eeprom93xx.o tsc2005.o
100obj-y += scsi-disk.o cdrom.o
Gerd Hoffmannd52affa2009-08-31 14:24:04 +0200101obj-y += scsi-generic.o scsi-bus.o
Juan Quintela6ef859b2009-06-25 00:08:07 +0200102obj-y += usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
Gerd Hoffmann806b6022009-08-31 14:23:59 +0200103obj-y += usb-serial.o usb-net.o usb-bus.o
Juan Quintela6ef859b2009-06-25 00:08:07 +0200104obj-y += sd.o ssi-sd.o
105obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
106obj-y += bt-hci-csr.o
107obj-y += buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
Juan Quintela3b476122009-07-16 17:57:06 +0200108obj-y += qemu-char.o aio.o net-checksum.o savevm.o
Juan Quintela6ef859b2009-06-25 00:08:07 +0200109obj-y += msmouse.o ps2.o
Gerd Hoffmannee6847d2009-07-15 13:43:31 +0200110obj-y += qdev.o qdev-properties.o ssi.o
Blue Swirla333cd72009-09-20 08:28:29 +0000111obj-y += qint.o qstring.o qdict.o qemu-config.o
pbrook87ecb682007-11-17 17:14:51 +0000112
Juan Quintela0e22fd22009-06-25 00:08:09 +0200113obj-$(CONFIG_BRLAPI) += baum.o
Juan Quintelaeeb6d452009-07-27 16:13:08 +0200114obj-$(CONFIG_WIN32) += tap-win32.o
Paolo Bonzini5ac1fad2009-08-18 15:56:25 +0200115obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
bellard4fb240a2007-11-07 19:24:02 +0000116
Juan Quintela98b068a2009-08-03 14:46:57 +0200117audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
Juan Quintela0e22fd22009-06-25 00:08:09 +0200118
119audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
120audio-obj-$(CONFIG_SDL) += sdlaudio.o
121audio-obj-$(CONFIG_OSS) += ossaudio.o
122audio-obj-$(CONFIG_COREAUDIO) += coreaudio.o
123audio-obj-$(CONFIG_ALSA) += alsaaudio.o
124audio-obj-$(CONFIG_DSOUND) += dsoundaudio.o
125audio-obj-$(CONFIG_FMOD) += fmodaudio.o
126audio-obj-$(CONFIG_ESD) += esdaudio.o
127audio-obj-$(CONFIG_PA) += paaudio.o
Juan Quintela67f86e82009-08-03 14:46:59 +0200128audio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
Juan Quintelaeda959b2009-06-25 00:08:03 +0200129audio-obj-y += wavcapture.o
Juan Quintela6ef859b2009-06-25 00:08:07 +0200130obj-y += $(addprefix audio/, $(audio-obj-y))
bellard4fb240a2007-11-07 19:24:02 +0000131
Juan Quintela6ef859b2009-06-25 00:08:07 +0200132obj-y += keymaps.o
Juan Quintela0e22fd22009-06-25 00:08:09 +0200133obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
134obj-$(CONFIG_CURSES) += curses.o
Juan Quintela6ef859b2009-06-25 00:08:07 +0200135obj-y += vnc.o acl.o d3des.o
Juan Quintela0e22fd22009-06-25 00:08:09 +0200136obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
137obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
138obj-$(CONFIG_COCOA) += cocoa.o
139obj-$(CONFIG_IOTHREAD) += qemu-thread.o
aliguorie5d355d2009-04-24 18:03:15 +0000140
Juan Quintelaf835ed12009-06-25 00:08:04 +0200141slirp-obj-y = cksum.o if.o ip_icmp.o ip_input.o ip_output.o
142slirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
143slirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o
Juan Quintela0e22fd22009-06-25 00:08:09 +0200144obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
bellard4fb240a2007-11-07 19:24:02 +0000145
Blue Swirl2567f572009-05-21 15:54:48 +0000146# xen backend driver support
Juan Quintela0e22fd22009-06-25 00:08:09 +0200147obj-$(CONFIG_XEN) += xen_backend.o xen_devconfig.o
148obj-$(CONFIG_XEN) += xen_console.o xenfb.o xen_disk.o xen_nic.o
Blue Swirl2567f572009-05-21 15:54:48 +0000149
Juan Quintelaa558ee12009-08-03 14:46:21 +0200150QEMU_CFLAGS+=$(CURL_CFLAGS)
Alexander Graf769ce762009-05-11 17:41:42 +0200151
bellard4fb240a2007-11-07 19:24:02 +0000152cocoa.o: cocoa.m
bellard4fb240a2007-11-07 19:24:02 +0000153
aliguori04837552009-03-06 20:27:10 +0000154keymaps.o: keymaps.c keymaps.h
155
Stefano Stabellinic18a2c32009-06-24 11:58:25 +0100156sdl_zoom.o: sdl_zoom.c sdl_zoom.h sdl_zoom_template.h
157
158sdl.o: sdl.c keymaps.h sdl_keysym.h sdl_zoom.h
aliguori807544e2009-01-21 18:12:44 +0000159
Juan Quintelaa558ee12009-08-03 14:46:21 +0200160sdl.o audio/sdlaudio.o sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
bellard4fb240a2007-11-07 19:24:02 +0000161
aliguori76655d62009-03-06 20:27:37 +0000162acl.o: acl.h acl.c
163
aliguori2f9606b2009-03-06 20:27:28 +0000164vnc.h: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
aliguori5fb6c7a2009-03-06 20:27:23 +0000165
aliguori76655d62009-03-06 20:27:37 +0000166vnc.o: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
aliguori807544e2009-01-21 18:12:44 +0000167
Juan Quintelaa558ee12009-08-03 14:46:21 +0200168vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
bellard4fb240a2007-11-07 19:24:02 +0000169
aliguori5fb6c7a2009-03-06 20:27:23 +0000170vnc-tls.o: vnc-tls.c vnc.h
171
172vnc-auth-vencrypt.o: vnc-auth-vencrypt.c vnc.h
173
aliguori2f9606b2009-03-06 20:27:28 +0000174vnc-auth-sasl.o: vnc-auth-sasl.c vnc.h
175
aliguori04837552009-03-06 20:27:10 +0000176curses.o: curses.c keymaps.h curses_keys.h
balrog4d3b6f62008-02-10 16:33:14 +0000177
Juan Quintelaa558ee12009-08-03 14:46:21 +0200178bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
bellard4fb240a2007-11-07 19:24:02 +0000179
Juan Quintela6ef859b2009-06-25 00:08:07 +0200180libqemu_common.a: $(obj-y)
bellard4fb240a2007-11-07 19:24:02 +0000181
182######################################################################
183
Stuart Brady153859b2009-06-07 00:42:17 +0100184qemu-img.o: qemu-img-cmds.h
185
Anthony Liguoria25a0ef2009-08-10 17:14:11 -0500186qemu-img$(EXESUF): qemu-img.o qemu-tool.o $(block-obj-y)
bellard4fb240a2007-11-07 19:24:02 +0000187
Anthony Liguoria25a0ef2009-08-10 17:14:11 -0500188qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o $(block-obj-y)
aliguori3aa892d2009-01-21 18:13:02 +0000189
Anthony Liguoria25a0ef2009-08-10 17:14:11 -0500190qemu-io$(EXESUF): qemu-io.o qemu-tool.o cmd.o $(block-obj-y)
aliguori0a8e1ac2009-04-05 18:41:23 +0000191
Stuart Brady153859b2009-06-07 00:42:17 +0100192qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
193 $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@")
194
Luiz Capitulino33837ba2009-08-28 15:27:29 -0300195check-qint: check-qint.o qint.o qemu-malloc.o
Luiz Capitulino5de65a02009-08-28 15:27:30 -0300196check-qstring: check-qstring.o qstring.o qemu-malloc.o
Luiz Capitulino7b8c51a2009-08-28 15:27:32 -0300197check-qdict: check-qdict.o qdict.o qint.o qstring.o qemu-malloc.o
Luiz Capitulino33837ba2009-08-28 15:27:29 -0300198
bellard31e31b82003-02-18 22:55:36 +0000199clean:
bellard2d80ae82003-08-11 23:01:33 +0000200# avoid old build problems by removing potentially incorrect old files
Juan Quintela25be210f2009-10-07 02:41:00 +0200201 rm -f config.mak 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 +0000202 rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~
Anthony Liguori019d6b82009-05-09 17:14:19 -0500203 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d
Blue Swirl07b44ce2009-06-09 18:45:16 +0000204 rm -f qemu-img-cmds.h
bellard7d3505c2004-05-12 19:32:15 +0000205 $(MAKE) -C tests clean
Blue Swirladd16152009-09-27 16:26:02 +0000206 for d in $(ALL_SUBDIRS) libhw32 libhw64 libuser; do \
bellard7d3505c2004-05-12 19:32:15 +0000207 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +0000208 done
bellard31e31b82003-02-18 22:55:36 +0000209
bellard7d132992003-03-06 23:23:54 +0000210distclean: clean
Juan Quintela1215c6e2009-10-07 02:40:58 +0200211 rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi
Juan Quintela1f3d3c82009-10-07 02:41:02 +0200212 rm -f config-all-devices.mak config-all-devices.h*
pbrook0cb3fb12006-05-14 12:07:53 +0000213 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
Blue Swirladd16152009-09-27 16:26:02 +0000214 for d in $(TARGET_DIRS) libhw32 libhw64 libuser; do \
bellardbc1b0502003-10-28 00:12:52 +0000215 rm -rf $$d || exit 1 ; \
bellard76bc6832003-08-10 23:41:46 +0000216 done
bellard7d132992003-03-06 23:23:54 +0000217
bellardfed4a9a2004-12-12 22:18:34 +0000218KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
219ar de en-us fi fr-be hr it lv nl pl ru th \
220common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
221
ths77755342008-11-27 15:45:16 +0000222ifdef INSTALL_BLOBS
223BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
aurel32e5d01b02009-01-09 11:01:31 +0000224video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
225pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
Alexander Graf253d0942009-06-29 15:37:40 +0200226bamboo.dtb petalogix-s3adsp1800.dtb \
227multiboot.bin
ths77755342008-11-27 15:45:16 +0000228else
229BLOBS=
230endif
231
pbrook38954dc2006-04-30 23:54:18 +0000232install-doc: $(DOCS)
aliguori58f8aea2009-04-18 15:36:02 +0000233 $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
234 $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
Juan Quintela96d409e2009-08-03 14:47:00 +0200235ifdef CONFIG_POSIX
aliguori58f8aea2009-04-18 15:36:02 +0000236 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
237 $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
238 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
239 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
pbrook38954dc2006-04-30 23:54:18 +0000240endif
241
242install: all $(if $(BUILD_DOCS),install-doc)
aliguori58f8aea2009-04-18 15:36:02 +0000243 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ths932a79d2007-10-20 18:29:34 +0000244ifneq ($(TOOLS),)
aliguori58f8aea2009-04-18 15:36:02 +0000245 $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
ths932a79d2007-10-20 18:29:34 +0000246endif
ths77755342008-11-27 15:45:16 +0000247ifneq ($(BLOBS),)
aliguori58f8aea2009-04-18 15:36:02 +0000248 $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
ths77755342008-11-27 15:45:16 +0000249 set -e; for x in $(BLOBS); do \
aliguori58f8aea2009-04-18 15:36:02 +0000250 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
pbrookad064842006-04-16 12:41:07 +0000251 done
ths77755342008-11-27 15:45:16 +0000252endif
aliguori58f8aea2009-04-18 15:36:02 +0000253 $(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
blueswir118be8d72008-03-05 18:16:09 +0000254 set -e; for x in $(KEYMAPS); do \
Anthony Liguori79fd42a2009-05-28 03:11:42 -0500255 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
pbrookad064842006-04-16 12:41:07 +0000256 done
bellard626df762003-08-10 21:39:31 +0000257 for d in $(TARGET_DIRS); do \
bellard7d3505c2004-05-12 19:32:15 +0000258 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +0000259 done
bellard612384d2003-03-22 17:31:19 +0000260
bellard367e86e2003-03-01 17:13:26 +0000261# various test targets
bellard9b0b8202007-11-14 10:34:57 +0000262test speed: all
bellard7d3505c2004-05-12 19:32:15 +0000263 $(MAKE) -C tests $@
bellard31e31b82003-02-18 22:55:36 +0000264
Alexandre Bique21d4e8e2009-08-07 15:43:11 +0100265.PHONY: TAGS
ths5fafdf22007-09-16 21:08:06 +0000266TAGS:
Alexandre Bique21d4e8e2009-08-07 15:43:11 +0100267 find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
bellard31e31b82003-02-18 22:55:36 +0000268
bellard6688bc62005-08-21 09:23:39 +0000269cscope:
270 rm -f ./cscope.*
aurel32ede46082008-10-01 21:46:58 +0000271 find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files
bellard6688bc62005-08-21 09:23:39 +0000272 cscope -b
273
bellard3ef693a2003-03-23 20:17:16 +0000274# documentation
bellard1f673132004-04-04 15:21:17 +0000275%.html: %.texi
aliguori0d00e562009-04-05 17:40:46 +0000276 $(call quiet-command,texi2html -I=. -monolithic -number $<," GEN $@")
bellard3ef693a2003-03-23 20:17:16 +0000277
bellardf3548322006-04-30 22:51:54 +0000278%.info: %.texi
aliguori0d00e562009-04-05 17:40:46 +0000279 $(call quiet-command,makeinfo -I . $< -o $@," GEN $@")
bellardf3548322006-04-30 22:51:54 +0000280
281%.dvi: %.texi
aliguori0d00e562009-04-05 17:40:46 +0000282 $(call quiet-command,texi2dvi -I . $<," GEN $@")
blueswir15824d652009-03-28 06:44:27 +0000283
284qemu-options.texi: $(SRC_PATH)/qemu-options.hx
aliguori0d00e562009-04-05 17:40:46 +0000285 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
bellardf3548322006-04-30 22:51:54 +0000286
Blue Swirl23130862009-06-06 08:22:04 +0000287qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
288 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
289
Stuart Brady153859b2009-06-07 00:42:17 +0100290qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
291 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
292
Blue Swirl23130862009-06-06 08:22:04 +0000293qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
aliguori0d00e562009-04-05 17:40:46 +0000294 $(call quiet-command, \
295 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod && \
296 pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
297 " GEN $@")
bellard5a671352003-10-01 00:13:48 +0000298
Stuart Brady153859b2009-06-07 00:42:17 +0100299qemu-img.1: qemu-img.texi qemu-img-cmds.texi
aliguori0d00e562009-04-05 17:40:46 +0000300 $(call quiet-command, \
301 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod && \
302 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
303 " GEN $@")
bellardacd935e2004-11-15 22:57:26 +0000304
bellard7a5ca862008-05-27 21:13:40 +0000305qemu-nbd.8: qemu-nbd.texi
aliguori0d00e562009-04-05 17:40:46 +0000306 $(call quiet-command, \
307 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod && \
308 pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
309 " GEN $@")
bellard7a5ca862008-05-27 21:13:40 +0000310
pbrook0cb3fb12006-05-14 12:07:53 +0000311info: qemu-doc.info qemu-tech.info
312
313dvi: qemu-doc.dvi qemu-tech.dvi
314
315html: qemu-doc.html qemu-tech.html
316
Stuart Brady153859b2009-06-07 00:42:17 +0100317qemu-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 +0000318
thsdf5cf722007-01-24 22:56:36 +0000319VERSION ?= $(shell cat VERSION)
320FILE = qemu-$(VERSION)
bellard586314f2003-03-03 15:02:29 +0000321
bellard1e43adf2003-09-30 20:54:24 +0000322# tar release (use 'make -k tar' on a checkouted tree)
bellard586314f2003-03-03 15:02:29 +0000323tar:
324 rm -rf /tmp/$(FILE)
bellard1e43adf2003-09-30 20:54:24 +0000325 cp -r . /tmp/$(FILE)
aurel3299c6c082008-04-22 20:45:30 +0000326 cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
bellard586314f2003-03-03 15:02:29 +0000327 rm -rf /tmp/$(FILE)
328
bellard76b62fd2003-10-28 00:47:44 +0000329# generate a binary distribution
bellardd691f662003-03-24 21:58:34 +0000330tarbin:
blueswir118be8d72008-03-05 18:16:09 +0000331 cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
bellard43095f32005-04-27 20:49:23 +0000332 $(bindir)/qemu \
bellard43095f32005-04-27 20:49:23 +0000333 $(bindir)/qemu-system-x86_64 \
aurel3240e8a532009-01-03 12:35:57 +0000334 $(bindir)/qemu-system-arm \
335 $(bindir)/qemu-system-cris \
336 $(bindir)/qemu-system-m68k \
Edgar E. Iglesiasbc6291a2009-10-01 15:18:36 +0200337 $(bindir)/qemu-system-microblaze \
bellard93856aa2005-07-24 18:44:35 +0000338 $(bindir)/qemu-system-mips \
pbrook38260992006-03-11 14:51:13 +0000339 $(bindir)/qemu-system-mipsel \
thsfbe4f652007-04-01 11:16:48 +0000340 $(bindir)/qemu-system-mips64 \
341 $(bindir)/qemu-system-mips64el \
aurel3240e8a532009-01-03 12:35:57 +0000342 $(bindir)/qemu-system-ppc \
343 $(bindir)/qemu-system-ppcemb \
344 $(bindir)/qemu-system-ppc64 \
thsff1aaf62007-09-29 21:18:26 +0000345 $(bindir)/qemu-system-sh4 \
ths85ffbdf2007-12-09 05:10:03 +0000346 $(bindir)/qemu-system-sh4eb \
aurel3240e8a532009-01-03 12:35:57 +0000347 $(bindir)/qemu-system-sparc \
bellard7efa4382004-05-12 18:54:06 +0000348 $(bindir)/qemu-i386 \
bellardf0403c02008-01-06 18:27:12 +0000349 $(bindir)/qemu-x86_64 \
aurel3240e8a532009-01-03 12:35:57 +0000350 $(bindir)/qemu-alpha \
351 $(bindir)/qemu-arm \
352 $(bindir)/qemu-armeb \
353 $(bindir)/qemu-cris \
354 $(bindir)/qemu-m68k \
Edgar E. Iglesiasbc6291a2009-10-01 15:18:36 +0200355 $(bindir)/qemu-microblaze \
aurel3240e8a532009-01-03 12:35:57 +0000356 $(bindir)/qemu-mips \
357 $(bindir)/qemu-mipsel \
358 $(bindir)/qemu-ppc \
359 $(bindir)/qemu-ppc64 \
360 $(bindir)/qemu-ppc64abi32 \
361 $(bindir)/qemu-sh4 \
362 $(bindir)/qemu-sh4eb \
363 $(bindir)/qemu-sparc \
364 $(bindir)/qemu-sparc64 \
365 $(bindir)/qemu-sparc32plus \
366 $(bindir)/qemu-img \
367 $(bindir)/qemu-nbd \
bellard7efa4382004-05-12 18:54:06 +0000368 $(datadir)/bios.bin \
369 $(datadir)/vgabios.bin \
bellardde9258a2004-06-06 15:50:03 +0000370 $(datadir)/vgabios-cirrus.bin \
bellard637f6cd2004-06-21 19:54:47 +0000371 $(datadir)/ppc_rom.bin \
bellardd5295252005-07-03 14:00:51 +0000372 $(datadir)/video.x \
bellard0986ac32006-06-14 12:36:32 +0000373 $(datadir)/openbios-sparc32 \
blueswir1938255d2008-04-23 19:38:07 +0000374 $(datadir)/openbios-sparc64 \
aurel32e5d01b02009-01-09 11:01:31 +0000375 $(datadir)/openbios-ppc \
aurel3240e8a532009-01-03 12:35:57 +0000376 $(datadir)/pxe-ne2k_pci.bin \
bellard19c80e52007-02-05 21:22:42 +0000377 $(datadir)/pxe-rtl8139.bin \
aurel3240e8a532009-01-03 12:35:57 +0000378 $(datadir)/pxe-pcnet.bin \
aliguori29919902008-07-26 16:53:22 +0000379 $(datadir)/pxe-e1000.bin \
bellard1f50f8d2004-05-08 14:44:43 +0000380 $(docdir)/qemu-doc.html \
381 $(docdir)/qemu-tech.html \
aurel3240e8a532009-01-03 12:35:57 +0000382 $(mandir)/man1/qemu.1 \
383 $(mandir)/man1/qemu-img.1 \
bellard7a5ca862008-05-27 21:13:40 +0000384 $(mandir)/man8/qemu-nbd.8
bellardd691f662003-03-24 21:58:34 +0000385
bellard4fb240a2007-11-07 19:24:02 +0000386# Include automatically generated dependency files
Anthony Liguori019d6b82009-05-09 17:14:19 -0500387-include $(wildcard *.d audio/*.d slirp/*.d block/*.d)