pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 1 | # Makefile for QEMU. |
| 2 | |
aurel32 | 55d7e8f | 2009-04-15 14:42:57 +0000 | [diff] [blame] | 3 | ifneq ($(wildcard config-host.mak),) |
Paul Brook | 1ad2134 | 2009-05-19 16:17:58 +0100 | [diff] [blame] | 4 | # Put the all: rule here so that config-host.mak can contain dependencies. |
| 5 | all: build-all |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 6 | include config-host.mak |
aliguori | 1775918 | 2009-01-21 18:12:52 +0000 | [diff] [blame] | 7 | include $(SRC_PATH)/rules.mak |
aurel32 | 55d7e8f | 2009-04-15 14:42:57 +0000 | [diff] [blame] | 8 | else |
| 9 | config-host.mak: |
| 10 | @echo "Please call configure before running make!" |
| 11 | @exit 1 |
| 12 | endif |
bellard | 766a487 | 2003-02-18 23:35:48 +0000 | [diff] [blame] | 13 | |
aliguori | 818220f | 2008-09-24 01:13:40 +0000 | [diff] [blame] | 14 | .PHONY: all clean cscope distclean dvi html info install install-doc \ |
| 15 | recurse-all speed tar tarbin test |
pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 16 | |
pbrook | 8c462f8 | 2007-11-18 21:12:37 +0000 | [diff] [blame] | 17 | VPATH=$(SRC_PATH):$(SRC_PATH)/hw |
| 18 | |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame^] | 19 | QEMU_CFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@ |
| 20 | QEMU_CFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
| 21 | QEMU_CFLAGS += -U_FORTIFY_SOURCE |
Juan Quintela | fa5e22c | 2009-08-03 14:46:15 +0200 | [diff] [blame] | 22 | LIBS+=-lz |
Juan Quintela | 67c0f08 | 2009-07-27 16:12:51 +0200 | [diff] [blame] | 23 | |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 24 | ifdef BUILD_DOCS |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 25 | DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 26 | else |
| 27 | DOCS= |
| 28 | endif |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 29 | |
Paul Brook | c05ac89 | 2009-07-31 13:18:32 +0100 | [diff] [blame] | 30 | build-all: $(TOOLS) $(DOCS) recurse-all |
pbrook | b9dea4f | 2006-05-13 16:54:03 +0000 | [diff] [blame] | 31 | |
aurel32 | 55d7e8f | 2009-04-15 14:42:57 +0000 | [diff] [blame] | 32 | config-host.mak: configure |
| 33 | ifneq ($(wildcard config-host.mak),) |
| 34 | @echo $@ is out-of-date, running configure |
blueswir1 | 052ff92 | 2009-04-17 20:01:12 +0000 | [diff] [blame] | 35 | @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh |
aurel32 | 55d7e8f | 2009-04-15 14:42:57 +0000 | [diff] [blame] | 36 | endif |
| 37 | |
Paul Brook | 0087375 | 2009-05-07 02:00:31 +0100 | [diff] [blame] | 38 | SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) |
pbrook | cec7d0b | 2008-05-28 16:44:57 +0000 | [diff] [blame] | 39 | SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) |
| 40 | |
aurel32 | 86e840e | 2008-12-07 15:21:23 +0000 | [diff] [blame] | 41 | subdir-%: |
Paul Brook | 0087375 | 2009-05-07 02:00:31 +0100 | [diff] [blame] | 42 | $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,) |
pbrook | 4aa4253 | 2006-05-13 13:55:08 +0000 | [diff] [blame] | 43 | |
pbrook | cec7d0b | 2008-05-28 16:44:57 +0000 | [diff] [blame] | 44 | $(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a |
| 45 | $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a |
| 46 | |
Paul Brook | c05ac89 | 2009-07-31 13:18:32 +0100 | [diff] [blame] | 47 | |
| 48 | ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) |
| 49 | romsubdir-%: |
| 50 | $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",) |
| 51 | |
| 52 | ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) |
| 53 | |
| 54 | recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) |
bellard | 83f6409 | 2006-08-01 16:21:11 +0000 | [diff] [blame] | 55 | |
pbrook | faf0796 | 2007-11-11 02:51:17 +0000 | [diff] [blame] | 56 | ####################################################################### |
Juan Quintela | 319f08e | 2009-06-25 00:08:02 +0200 | [diff] [blame] | 57 | # block-obj-y is code used by both qemu system emulation and qemu-img |
pbrook | faf0796 | 2007-11-11 02:51:17 +0000 | [diff] [blame] | 58 | |
Juan Quintela | 319f08e | 2009-06-25 00:08:02 +0200 | [diff] [blame] | 59 | block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o |
Juan Quintela | 1a65ba7 | 2009-07-16 17:57:03 +0200 | [diff] [blame] | 60 | block-obj-y += nbd.o block.o aio.o aes.o |
Juan Quintela | eeb6d45 | 2009-07-27 16:13:08 +0200 | [diff] [blame] | 61 | block-obj-$(CONFIG_AIO) += posix-aio-compat.o |
Juan Quintela | 1a65ba7 | 2009-07-16 17:57:03 +0200 | [diff] [blame] | 62 | |
Stefan Weil | 9aebd98 | 2009-07-31 21:45:56 +0200 | [diff] [blame] | 63 | block-nested-y += cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o |
Juan Quintela | 1a65ba7 | 2009-07-16 17:57:03 +0200 | [diff] [blame] | 64 | block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o |
| 65 | block-nested-y += parallels.o nbd.o |
Juan Quintela | eeb6d45 | 2009-07-27 16:13:08 +0200 | [diff] [blame] | 66 | block-nested-$(CONFIG_WIN32) += raw-win32.o |
| 67 | block-nested-$(CONFIG_POSIX) += raw-posix.o |
Juan Quintela | 1a65ba7 | 2009-07-16 17:57:03 +0200 | [diff] [blame] | 68 | block-nested-$(CONFIG_CURL) += curl.o |
| 69 | |
| 70 | block-obj-y += $(addprefix block/, $(block-nested-y)) |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 71 | |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 72 | ###################################################################### |
bellard | 2e2ea90 | 2008-02-01 10:02:52 +0000 | [diff] [blame] | 73 | # libqemu_common.a: Target independent part of system emulation. The |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 74 | # long term path is to suppress *all* target specific code in case of |
| 75 | # system emulation, i.e. a single QEMU executable should support all |
| 76 | # CPUs and machines. |
bellard | 47cea61 | 2004-05-17 20:06:42 +0000 | [diff] [blame] | 77 | |
Juan Quintela | 6ef859b | 2009-06-25 00:08:07 +0200 | [diff] [blame] | 78 | obj-y = $(block-obj-y) |
| 79 | obj-y += readline.o console.o |
aliguori | cd01b4a | 2008-08-21 19:25:45 +0000 | [diff] [blame] | 80 | |
Juan Quintela | 6ef859b | 2009-06-25 00:08:07 +0200 | [diff] [blame] | 81 | obj-y += irq.o ptimer.o |
| 82 | obj-y += i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o |
| 83 | obj-y += ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o |
| 84 | obj-y += tmp105.o lm832x.o eeprom93xx.o tsc2005.o |
| 85 | obj-y += scsi-disk.o cdrom.o |
| 86 | obj-y += scsi-generic.o |
| 87 | obj-y += usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o |
| 88 | obj-y += usb-serial.o usb-net.o |
| 89 | obj-y += sd.o ssi-sd.o |
| 90 | obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o |
| 91 | obj-y += bt-hci-csr.o |
| 92 | obj-y += buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o |
Juan Quintela | 3b47612 | 2009-07-16 17:57:06 +0200 | [diff] [blame] | 93 | obj-y += qemu-char.o aio.o net-checksum.o savevm.o |
Juan Quintela | 6ef859b | 2009-06-25 00:08:07 +0200 | [diff] [blame] | 94 | obj-y += msmouse.o ps2.o |
Gerd Hoffmann | ee6847d | 2009-07-15 13:43:31 +0200 | [diff] [blame] | 95 | obj-y += qdev.o qdev-properties.o ssi.o |
pbrook | 87ecb68 | 2007-11-17 17:14:51 +0000 | [diff] [blame] | 96 | |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 97 | obj-$(CONFIG_BRLAPI) += baum.o |
| 98 | |
Juan Quintela | eb82284 | 2009-07-27 16:13:18 +0200 | [diff] [blame] | 99 | LIBS+=$(BRLAPI_LIBS) |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 100 | |
Juan Quintela | eeb6d45 | 2009-07-27 16:13:08 +0200 | [diff] [blame] | 101 | obj-$(CONFIG_WIN32) += tap-win32.o |
| 102 | obj-$(CONFIG_POSIX) += migration-exec.o |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 103 | |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 104 | ifdef CONFIG_COREAUDIO |
Anthony Liguori | c6a5a71 | 2009-07-01 10:07:16 -0500 | [diff] [blame] | 105 | AUDIO_PT = y |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 106 | endif |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 107 | ifdef CONFIG_FMOD |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame^] | 108 | audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS := $(FMOD_CFLAGS) $(QEMU_CFLAGS) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 109 | endif |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 110 | ifdef CONFIG_ESD |
Anthony Liguori | c6a5a71 | 2009-07-01 10:07:16 -0500 | [diff] [blame] | 111 | AUDIO_PT = y |
| 112 | AUDIO_PT_INT = y |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 113 | endif |
malc | b8e59f1 | 2008-07-02 21:03:08 +0000 | [diff] [blame] | 114 | ifdef CONFIG_PA |
Anthony Liguori | c6a5a71 | 2009-07-01 10:07:16 -0500 | [diff] [blame] | 115 | AUDIO_PT = y |
| 116 | AUDIO_PT_INT = y |
malc | b8e59f1 | 2008-07-02 21:03:08 +0000 | [diff] [blame] | 117 | endif |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 118 | ifdef AUDIO_PT |
| 119 | LDFLAGS += -pthread |
| 120 | endif |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 121 | |
| 122 | audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o |
| 123 | audio-obj-$(CONFIG_SDL) += sdlaudio.o |
| 124 | audio-obj-$(CONFIG_OSS) += ossaudio.o |
| 125 | audio-obj-$(CONFIG_COREAUDIO) += coreaudio.o |
| 126 | audio-obj-$(CONFIG_ALSA) += alsaaudio.o |
| 127 | audio-obj-$(CONFIG_DSOUND) += dsoundaudio.o |
| 128 | audio-obj-$(CONFIG_FMOD) += fmodaudio.o |
| 129 | audio-obj-$(CONFIG_ESD) += esdaudio.o |
| 130 | audio-obj-$(CONFIG_PA) += paaudio.o |
| 131 | audio-obj-$(AUDIO_PT_INT) += audio_pt_int.o |
Juan Quintela | eda959b | 2009-06-25 00:08:03 +0200 | [diff] [blame] | 132 | audio-obj-y += wavcapture.o |
Juan Quintela | 6ef859b | 2009-06-25 00:08:07 +0200 | [diff] [blame] | 133 | obj-y += $(addprefix audio/, $(audio-obj-y)) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 134 | |
Juan Quintela | 6ef859b | 2009-06-25 00:08:07 +0200 | [diff] [blame] | 135 | obj-y += keymaps.o |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 136 | obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o |
| 137 | obj-$(CONFIG_CURSES) += curses.o |
Juan Quintela | 6ef859b | 2009-06-25 00:08:07 +0200 | [diff] [blame] | 138 | obj-y += vnc.o acl.o d3des.o |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 139 | obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o |
| 140 | obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o |
| 141 | obj-$(CONFIG_COCOA) += cocoa.o |
| 142 | obj-$(CONFIG_IOTHREAD) += qemu-thread.o |
aliguori | e5d355d | 2009-04-24 18:03:15 +0000 | [diff] [blame] | 143 | |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 144 | ifdef CONFIG_SLIRP |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame^] | 145 | QEMU_CFLAGS+=-I$(SRC_PATH)/slirp |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 146 | endif |
| 147 | |
Juan Quintela | f835ed1 | 2009-06-25 00:08:04 +0200 | [diff] [blame] | 148 | slirp-obj-y = cksum.o if.o ip_icmp.o ip_input.o ip_output.o |
| 149 | slirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o |
| 150 | slirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 151 | obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y)) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 152 | |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 153 | LIBS+=$(VDE_LIBS) |
| 154 | |
Blue Swirl | 2567f57 | 2009-05-21 15:54:48 +0000 | [diff] [blame] | 155 | # xen backend driver support |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 156 | obj-$(CONFIG_XEN) += xen_backend.o xen_devconfig.o |
| 157 | obj-$(CONFIG_XEN) += xen_console.o xenfb.o xen_disk.o xen_nic.o |
Blue Swirl | 2567f57 | 2009-05-21 15:54:48 +0000 | [diff] [blame] | 158 | |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame^] | 159 | QEMU_CFLAGS+=$(CURL_CFLAGS) |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 160 | LIBS+=$(CURL_LIBS) |
| 161 | |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 162 | cocoa.o: cocoa.m |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 163 | |
aliguori | 0483755 | 2009-03-06 20:27:10 +0000 | [diff] [blame] | 164 | keymaps.o: keymaps.c keymaps.h |
| 165 | |
Stefano Stabellini | c18a2c3 | 2009-06-24 11:58:25 +0100 | [diff] [blame] | 166 | sdl_zoom.o: sdl_zoom.c sdl_zoom.h sdl_zoom_template.h |
| 167 | |
| 168 | sdl.o: sdl.c keymaps.h sdl_keysym.h sdl_zoom.h |
aliguori | 807544e | 2009-01-21 18:12:44 +0000 | [diff] [blame] | 169 | |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame^] | 170 | sdl.o audio/sdlaudio.o sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 171 | |
aliguori | 76655d6 | 2009-03-06 20:27:37 +0000 | [diff] [blame] | 172 | acl.o: acl.h acl.c |
| 173 | |
aliguori | 2f9606b | 2009-03-06 20:27:28 +0000 | [diff] [blame] | 174 | vnc.h: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h |
aliguori | 5fb6c7a | 2009-03-06 20:27:23 +0000 | [diff] [blame] | 175 | |
aliguori | 76655d6 | 2009-03-06 20:27:37 +0000 | [diff] [blame] | 176 | vnc.o: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h |
aliguori | 807544e | 2009-01-21 18:12:44 +0000 | [diff] [blame] | 177 | |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame^] | 178 | vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 179 | |
aliguori | 5fb6c7a | 2009-03-06 20:27:23 +0000 | [diff] [blame] | 180 | vnc-tls.o: vnc-tls.c vnc.h |
| 181 | |
| 182 | vnc-auth-vencrypt.o: vnc-auth-vencrypt.c vnc.h |
| 183 | |
aliguori | 2f9606b | 2009-03-06 20:27:28 +0000 | [diff] [blame] | 184 | vnc-auth-sasl.o: vnc-auth-sasl.c vnc.h |
| 185 | |
aliguori | 0483755 | 2009-03-06 20:27:10 +0000 | [diff] [blame] | 186 | curses.o: curses.c keymaps.h curses_keys.h |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 187 | |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame^] | 188 | bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 189 | |
Juan Quintela | 6ef859b | 2009-06-25 00:08:07 +0200 | [diff] [blame] | 190 | libqemu_common.a: $(obj-y) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 191 | |
pbrook | cec7d0b | 2008-05-28 16:44:57 +0000 | [diff] [blame] | 192 | ####################################################################### |
Juan Quintela | e11b1dc | 2009-06-25 00:08:06 +0200 | [diff] [blame] | 193 | # user-obj-y is code used by qemu userspace emulation |
| 194 | user-obj-y = cutils.o cache-utils.o |
pbrook | cec7d0b | 2008-05-28 16:44:57 +0000 | [diff] [blame] | 195 | |
Juan Quintela | e11b1dc | 2009-06-25 00:08:06 +0200 | [diff] [blame] | 196 | libqemu_user.a: $(user-obj-y) |
pbrook | cec7d0b | 2008-05-28 16:44:57 +0000 | [diff] [blame] | 197 | |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 198 | ###################################################################### |
| 199 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 200 | qemu-img.o: qemu-img-cmds.h |
| 201 | |
Juan Quintela | 319f08e | 2009-06-25 00:08:02 +0200 | [diff] [blame] | 202 | qemu-img$(EXESUF): qemu-img.o qemu-tool.o tool-osdep.o $(block-obj-y) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 203 | |
Juan Quintela | 319f08e | 2009-06-25 00:08:02 +0200 | [diff] [blame] | 204 | qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o tool-osdep.o $(block-obj-y) |
aliguori | 3aa892d | 2009-01-21 18:13:02 +0000 | [diff] [blame] | 205 | |
Juan Quintela | 319f08e | 2009-06-25 00:08:02 +0200 | [diff] [blame] | 206 | qemu-io$(EXESUF): qemu-io.o qemu-tool.o tool-osdep.o cmd.o $(block-obj-y) |
aliguori | 0a8e1ac | 2009-04-05 18:41:23 +0000 | [diff] [blame] | 207 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 208 | qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx |
| 209 | $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@") |
| 210 | |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 211 | clean: |
bellard | 2d80ae8 | 2003-08-11 23:01:33 +0000 | [diff] [blame] | 212 | # avoid old build problems by removing potentially incorrect old files |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 213 | 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 |
aurel32 | 86e840e | 2008-12-07 15:21:23 +0000 | [diff] [blame] | 214 | rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~ |
Anthony Liguori | 019d6b8 | 2009-05-09 17:14:19 -0500 | [diff] [blame] | 215 | rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d |
Blue Swirl | 07b44ce | 2009-06-09 18:45:16 +0000 | [diff] [blame] | 216 | rm -f qemu-img-cmds.h |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 217 | $(MAKE) -C tests clean |
Paul Brook | c05ac89 | 2009-07-31 13:18:32 +0100 | [diff] [blame] | 218 | for d in $(ALL_SUBDIRS) libhw32 libhw64; do \ |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 219 | $(MAKE) -C $$d $@ || exit 1 ; \ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 220 | done |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 221 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 222 | distclean: clean |
Juan Quintela | 4bf6b55 | 2009-07-22 22:37:40 +0200 | [diff] [blame] | 223 | rm -f config-host.mak config-host.h config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi |
pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 224 | rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr} |
Paul Brook | 1ad2134 | 2009-05-19 16:17:58 +0100 | [diff] [blame] | 225 | for d in $(TARGET_DIRS) libhw32 libhw64; do \ |
bellard | bc1b050 | 2003-10-28 00:12:52 +0000 | [diff] [blame] | 226 | rm -rf $$d || exit 1 ; \ |
bellard | 76bc683 | 2003-08-10 23:41:46 +0000 | [diff] [blame] | 227 | done |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 228 | |
bellard | fed4a9a | 2004-12-12 22:18:34 +0000 | [diff] [blame] | 229 | KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \ |
| 230 | ar de en-us fi fr-be hr it lv nl pl ru th \ |
| 231 | common de-ch es fo fr-ca hu ja mk nl-be pt sl tr |
| 232 | |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 233 | ifdef INSTALL_BLOBS |
| 234 | BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ |
aurel32 | e5d01b0 | 2009-01-09 11:01:31 +0000 | [diff] [blame] | 235 | video.x openbios-sparc32 openbios-sparc64 openbios-ppc \ |
| 236 | pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \ |
Alexander Graf | 253d094 | 2009-06-29 15:37:40 +0200 | [diff] [blame] | 237 | bamboo.dtb petalogix-s3adsp1800.dtb \ |
| 238 | multiboot.bin |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 239 | else |
| 240 | BLOBS= |
| 241 | endif |
| 242 | |
pbrook | 38954dc | 2006-04-30 23:54:18 +0000 | [diff] [blame] | 243 | install-doc: $(DOCS) |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 244 | $(INSTALL_DIR) "$(DESTDIR)$(docdir)" |
| 245 | $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" |
pbrook | 38954dc | 2006-04-30 23:54:18 +0000 | [diff] [blame] | 246 | ifndef CONFIG_WIN32 |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 247 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" |
| 248 | $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" |
| 249 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" |
| 250 | $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" |
pbrook | 38954dc | 2006-04-30 23:54:18 +0000 | [diff] [blame] | 251 | endif |
| 252 | |
| 253 | install: all $(if $(BUILD_DOCS),install-doc) |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 254 | $(INSTALL_DIR) "$(DESTDIR)$(bindir)" |
ths | 932a79d | 2007-10-20 18:29:34 +0000 | [diff] [blame] | 255 | ifneq ($(TOOLS),) |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 256 | $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)" |
ths | 932a79d | 2007-10-20 18:29:34 +0000 | [diff] [blame] | 257 | endif |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 258 | ifneq ($(BLOBS),) |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 259 | $(INSTALL_DIR) "$(DESTDIR)$(datadir)" |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 260 | set -e; for x in $(BLOBS); do \ |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 261 | $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 262 | done |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 263 | endif |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 264 | $(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps" |
blueswir1 | 18be8d7 | 2008-03-05 18:16:09 +0000 | [diff] [blame] | 265 | set -e; for x in $(KEYMAPS); do \ |
Anthony Liguori | 79fd42a | 2009-05-28 03:11:42 -0500 | [diff] [blame] | 266 | $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 267 | done |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 268 | for d in $(TARGET_DIRS); do \ |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 269 | $(MAKE) -C $$d $@ || exit 1 ; \ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 270 | done |
bellard | 612384d | 2003-03-22 17:31:19 +0000 | [diff] [blame] | 271 | |
bellard | 367e86e | 2003-03-01 17:13:26 +0000 | [diff] [blame] | 272 | # various test targets |
bellard | 9b0b820 | 2007-11-14 10:34:57 +0000 | [diff] [blame] | 273 | test speed: all |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 274 | $(MAKE) -C tests $@ |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 275 | |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 276 | TAGS: |
Juan Quintela | ae95ade | 2009-06-29 13:49:29 +0200 | [diff] [blame] | 277 | etags *.[ch] tests/*.[ch] block/*.[ch] hw/*.[ch] |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 278 | |
bellard | 6688bc6 | 2005-08-21 09:23:39 +0000 | [diff] [blame] | 279 | cscope: |
| 280 | rm -f ./cscope.* |
aurel32 | ede4608 | 2008-10-01 21:46:58 +0000 | [diff] [blame] | 281 | find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files |
bellard | 6688bc6 | 2005-08-21 09:23:39 +0000 | [diff] [blame] | 282 | cscope -b |
| 283 | |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 284 | # documentation |
bellard | 1f67313 | 2004-04-04 15:21:17 +0000 | [diff] [blame] | 285 | %.html: %.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 286 | $(call quiet-command,texi2html -I=. -monolithic -number $<," GEN $@") |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 287 | |
bellard | f354832 | 2006-04-30 22:51:54 +0000 | [diff] [blame] | 288 | %.info: %.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 289 | $(call quiet-command,makeinfo -I . $< -o $@," GEN $@") |
bellard | f354832 | 2006-04-30 22:51:54 +0000 | [diff] [blame] | 290 | |
| 291 | %.dvi: %.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 292 | $(call quiet-command,texi2dvi -I . $<," GEN $@") |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 293 | |
| 294 | qemu-options.texi: $(SRC_PATH)/qemu-options.hx |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 295 | $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@") |
bellard | f354832 | 2006-04-30 22:51:54 +0000 | [diff] [blame] | 296 | |
Blue Swirl | 2313086 | 2009-06-06 08:22:04 +0000 | [diff] [blame] | 297 | qemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx |
| 298 | $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@") |
| 299 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 300 | qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx |
| 301 | $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@") |
| 302 | |
Blue Swirl | 2313086 | 2009-06-06 08:22:04 +0000 | [diff] [blame] | 303 | qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 304 | $(call quiet-command, \ |
| 305 | perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod && \ |
| 306 | pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \ |
| 307 | " GEN $@") |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 308 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 309 | qemu-img.1: qemu-img.texi qemu-img-cmds.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 310 | $(call quiet-command, \ |
| 311 | perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod && \ |
| 312 | pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \ |
| 313 | " GEN $@") |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 314 | |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 315 | qemu-nbd.8: qemu-nbd.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 316 | $(call quiet-command, \ |
| 317 | perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod && \ |
| 318 | pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \ |
| 319 | " GEN $@") |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 320 | |
pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 321 | info: qemu-doc.info qemu-tech.info |
| 322 | |
| 323 | dvi: qemu-doc.dvi qemu-tech.dvi |
| 324 | |
| 325 | html: qemu-doc.html qemu-tech.html |
| 326 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 327 | qemu-doc.dvi qemu-doc.html qemu-doc.info: qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-monitor.texi qemu-img-cmds.texi |
aliguori | 818220f | 2008-09-24 01:13:40 +0000 | [diff] [blame] | 328 | |
ths | df5cf72 | 2007-01-24 22:56:36 +0000 | [diff] [blame] | 329 | VERSION ?= $(shell cat VERSION) |
| 330 | FILE = qemu-$(VERSION) |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 331 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 332 | # tar release (use 'make -k tar' on a checkouted tree) |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 333 | tar: |
| 334 | rm -rf /tmp/$(FILE) |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 335 | cp -r . /tmp/$(FILE) |
aurel32 | 99c6c08 | 2008-04-22 20:45:30 +0000 | [diff] [blame] | 336 | cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 337 | rm -rf /tmp/$(FILE) |
| 338 | |
bellard | 76b62fd | 2003-10-28 00:47:44 +0000 | [diff] [blame] | 339 | # generate a binary distribution |
bellard | d691f66 | 2003-03-24 21:58:34 +0000 | [diff] [blame] | 340 | tarbin: |
blueswir1 | 18be8d7 | 2008-03-05 18:16:09 +0000 | [diff] [blame] | 341 | cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \ |
bellard | 43095f3 | 2005-04-27 20:49:23 +0000 | [diff] [blame] | 342 | $(bindir)/qemu \ |
bellard | 43095f3 | 2005-04-27 20:49:23 +0000 | [diff] [blame] | 343 | $(bindir)/qemu-system-x86_64 \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 344 | $(bindir)/qemu-system-arm \ |
| 345 | $(bindir)/qemu-system-cris \ |
| 346 | $(bindir)/qemu-system-m68k \ |
bellard | 93856aa | 2005-07-24 18:44:35 +0000 | [diff] [blame] | 347 | $(bindir)/qemu-system-mips \ |
pbrook | 3826099 | 2006-03-11 14:51:13 +0000 | [diff] [blame] | 348 | $(bindir)/qemu-system-mipsel \ |
ths | fbe4f65 | 2007-04-01 11:16:48 +0000 | [diff] [blame] | 349 | $(bindir)/qemu-system-mips64 \ |
| 350 | $(bindir)/qemu-system-mips64el \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 351 | $(bindir)/qemu-system-ppc \ |
| 352 | $(bindir)/qemu-system-ppcemb \ |
| 353 | $(bindir)/qemu-system-ppc64 \ |
ths | ff1aaf6 | 2007-09-29 21:18:26 +0000 | [diff] [blame] | 354 | $(bindir)/qemu-system-sh4 \ |
ths | 85ffbdf | 2007-12-09 05:10:03 +0000 | [diff] [blame] | 355 | $(bindir)/qemu-system-sh4eb \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 356 | $(bindir)/qemu-system-sparc \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 357 | $(bindir)/qemu-i386 \ |
bellard | f0403c0 | 2008-01-06 18:27:12 +0000 | [diff] [blame] | 358 | $(bindir)/qemu-x86_64 \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 359 | $(bindir)/qemu-alpha \ |
| 360 | $(bindir)/qemu-arm \ |
| 361 | $(bindir)/qemu-armeb \ |
| 362 | $(bindir)/qemu-cris \ |
| 363 | $(bindir)/qemu-m68k \ |
| 364 | $(bindir)/qemu-mips \ |
| 365 | $(bindir)/qemu-mipsel \ |
| 366 | $(bindir)/qemu-ppc \ |
| 367 | $(bindir)/qemu-ppc64 \ |
| 368 | $(bindir)/qemu-ppc64abi32 \ |
| 369 | $(bindir)/qemu-sh4 \ |
| 370 | $(bindir)/qemu-sh4eb \ |
| 371 | $(bindir)/qemu-sparc \ |
| 372 | $(bindir)/qemu-sparc64 \ |
| 373 | $(bindir)/qemu-sparc32plus \ |
| 374 | $(bindir)/qemu-img \ |
| 375 | $(bindir)/qemu-nbd \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 376 | $(datadir)/bios.bin \ |
| 377 | $(datadir)/vgabios.bin \ |
bellard | de9258a | 2004-06-06 15:50:03 +0000 | [diff] [blame] | 378 | $(datadir)/vgabios-cirrus.bin \ |
bellard | 637f6cd | 2004-06-21 19:54:47 +0000 | [diff] [blame] | 379 | $(datadir)/ppc_rom.bin \ |
bellard | d529525 | 2005-07-03 14:00:51 +0000 | [diff] [blame] | 380 | $(datadir)/video.x \ |
bellard | 0986ac3 | 2006-06-14 12:36:32 +0000 | [diff] [blame] | 381 | $(datadir)/openbios-sparc32 \ |
blueswir1 | 938255d | 2008-04-23 19:38:07 +0000 | [diff] [blame] | 382 | $(datadir)/openbios-sparc64 \ |
aurel32 | e5d01b0 | 2009-01-09 11:01:31 +0000 | [diff] [blame] | 383 | $(datadir)/openbios-ppc \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 384 | $(datadir)/pxe-ne2k_pci.bin \ |
bellard | 19c80e5 | 2007-02-05 21:22:42 +0000 | [diff] [blame] | 385 | $(datadir)/pxe-rtl8139.bin \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 386 | $(datadir)/pxe-pcnet.bin \ |
aliguori | 2991990 | 2008-07-26 16:53:22 +0000 | [diff] [blame] | 387 | $(datadir)/pxe-e1000.bin \ |
bellard | 1f50f8d | 2004-05-08 14:44:43 +0000 | [diff] [blame] | 388 | $(docdir)/qemu-doc.html \ |
| 389 | $(docdir)/qemu-tech.html \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 390 | $(mandir)/man1/qemu.1 \ |
| 391 | $(mandir)/man1/qemu-img.1 \ |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 392 | $(mandir)/man8/qemu-nbd.8 |
bellard | d691f66 | 2003-03-24 21:58:34 +0000 | [diff] [blame] | 393 | |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 394 | # Include automatically generated dependency files |
Anthony Liguori | 019d6b8 | 2009-05-09 17:14:19 -0500 | [diff] [blame] | 395 | -include $(wildcard *.d audio/*.d slirp/*.d block/*.d) |