pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 1 | # Makefile for QEMU. |
| 2 | |
Michael S. Tsirkin | df2943b | 2010-10-26 17:53:41 +0200 | [diff] [blame] | 3 | GENERATED_HEADERS = config-host.h trace.h qemu-options.def |
Daniel P. Berrange | b3d08c0 | 2010-11-12 13:20:24 +0000 | [diff] [blame] | 4 | ifeq ($(TRACE_BACKEND),dtrace) |
| 5 | GENERATED_HEADERS += trace-dtrace.h |
| 6 | endif |
Juan Quintela | f527c57 | 2009-11-05 17:19:57 +0100 | [diff] [blame] | 7 | |
aurel32 | 55d7e8f | 2009-04-15 14:42:57 +0000 | [diff] [blame] | 8 | ifneq ($(wildcard config-host.mak),) |
Paul Brook | 1ad2134 | 2009-05-19 16:17:58 +0100 | [diff] [blame] | 9 | # Put the all: rule here so that config-host.mak can contain dependencies. |
| 10 | all: build-all |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 11 | include config-host.mak |
aliguori | 1775918 | 2009-01-21 18:12:52 +0000 | [diff] [blame] | 12 | include $(SRC_PATH)/rules.mak |
Paolo Bonzini | 59bc10e | 2010-01-04 11:02:28 +0100 | [diff] [blame] | 13 | config-host.mak: $(SRC_PATH)/configure |
Juan Quintela | e5efe7f | 2009-10-07 02:40:59 +0200 | [diff] [blame] | 14 | @echo $@ is out-of-date, running configure |
| 15 | @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh |
aurel32 | 55d7e8f | 2009-04-15 14:42:57 +0000 | [diff] [blame] | 16 | else |
| 17 | config-host.mak: |
| 18 | @echo "Please call configure before running make!" |
| 19 | @exit 1 |
| 20 | endif |
bellard | 766a487 | 2003-02-18 23:35:48 +0000 | [diff] [blame] | 21 | |
Juan Quintela | d9ace8b | 2009-10-06 21:11:15 +0200 | [diff] [blame] | 22 | # Don't try to regenerate Makefile or configure |
| 23 | # We don't generate any of them |
| 24 | Makefile: ; |
| 25 | configure: ; |
| 26 | |
aliguori | 818220f | 2008-09-24 01:13:40 +0000 | [diff] [blame] | 27 | .PHONY: all clean cscope distclean dvi html info install install-doc \ |
Stefan Weil | 20cc999 | 2010-01-29 23:16:50 +0100 | [diff] [blame] | 28 | pdf recurse-all speed tar tarbin test build-all |
pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 29 | |
Paolo Bonzini | 076d247 | 2009-12-21 10:06:55 +0100 | [diff] [blame] | 30 | $(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw) |
pbrook | 8c462f8 | 2007-11-18 21:12:37 +0000 | [diff] [blame] | 31 | |
Juan Quintela | 3e2e0e6 | 2009-08-03 14:47:06 +0200 | [diff] [blame] | 32 | LIBS+=-lz $(LIBS_TOOLS) |
Juan Quintela | 67c0f08 | 2009-07-27 16:12:51 +0200 | [diff] [blame] | 33 | |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 34 | ifdef BUILD_DOCS |
Jan Kiszka | b40292e | 2010-05-31 14:43:31 -0300 | [diff] [blame] | 35 | DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 36 | else |
| 37 | DOCS= |
| 38 | endif |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 39 | |
Juan Quintela | 1215c6e | 2009-10-07 02:40:58 +0200 | [diff] [blame] | 40 | SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) |
Juan Quintela | 1f3d3c8 | 2009-10-07 02:41:02 +0200 | [diff] [blame] | 41 | SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS)) |
Paul Brook | bd9141b | 2010-11-26 18:47:45 +0000 | [diff] [blame] | 42 | SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS)) |
Juan Quintela | 1f3d3c8 | 2009-10-07 02:41:02 +0200 | [diff] [blame] | 43 | |
| 44 | config-all-devices.mak: $(SUBDIR_DEVICES_MAK) |
Stefan Weil | 01d86a8 | 2009-11-19 20:19:56 +0100 | [diff] [blame] | 45 | $(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@," GEN $@") |
Juan Quintela | 1f3d3c8 | 2009-10-07 02:41:02 +0200 | [diff] [blame] | 46 | |
Paul Brook | bd9141b | 2010-11-26 18:47:45 +0000 | [diff] [blame] | 47 | -include $(SUBDIR_DEVICES_MAK_DEP) |
| 48 | |
Paul Brook | a992fe3 | 2009-11-22 16:25:30 +0000 | [diff] [blame] | 49 | %/config-devices.mak: default-configs/%.mak |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 50 | $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, " GEN $@") |
Stefan Weil | 012f087 | 2009-12-20 15:39:03 +0100 | [diff] [blame] | 51 | @if test -f $@; then \ |
Blue Swirl | 904fe1f | 2010-10-02 14:28:08 +0000 | [diff] [blame] | 52 | if cmp -s $@.old $@; then \ |
Paul Brook | bd9141b | 2010-11-26 18:47:45 +0000 | [diff] [blame] | 53 | mv $@.tmp $@; \ |
| 54 | cp -p $@ $@.old; \ |
Stefan Weil | 012f087 | 2009-12-20 15:39:03 +0100 | [diff] [blame] | 55 | else \ |
| 56 | if test -f $@.old; then \ |
| 57 | echo "WARNING: $@ (user modified) out of date.";\ |
| 58 | else \ |
| 59 | echo "WARNING: $@ out of date.";\ |
| 60 | fi; \ |
| 61 | echo "Run \"make defconfig\" to regenerate."; \ |
| 62 | rm $@.tmp; \ |
| 63 | fi; \ |
Paul Brook | a992fe3 | 2009-11-22 16:25:30 +0000 | [diff] [blame] | 64 | else \ |
Stefan Weil | 012f087 | 2009-12-20 15:39:03 +0100 | [diff] [blame] | 65 | mv $@.tmp $@; \ |
| 66 | cp -p $@ $@.old; \ |
Paul Brook | a992fe3 | 2009-11-22 16:25:30 +0000 | [diff] [blame] | 67 | fi |
| 68 | |
| 69 | defconfig: |
| 70 | rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK) |
| 71 | |
Juan Quintela | 1f3d3c8 | 2009-10-07 02:41:02 +0200 | [diff] [blame] | 72 | -include config-all-devices.mak |
Juan Quintela | 1215c6e | 2009-10-07 02:40:58 +0200 | [diff] [blame] | 73 | |
Juan Quintela | f527c57 | 2009-11-05 17:19:57 +0100 | [diff] [blame] | 74 | build-all: $(DOCS) $(TOOLS) recurse-all |
pbrook | b9dea4f | 2006-05-13 16:54:03 +0000 | [diff] [blame] | 75 | |
Juan Quintela | 1215c6e | 2009-10-07 02:40:58 +0200 | [diff] [blame] | 76 | config-host.h: config-host.h-timestamp |
| 77 | config-host.h-timestamp: config-host.mak |
Blue Swirl | e14056a | 2010-11-01 18:09:38 +0000 | [diff] [blame] | 78 | qemu-options.def: $(SRC_PATH)/qemu-options.hx |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 79 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@") |
Juan Quintela | 1215c6e | 2009-10-07 02:40:58 +0200 | [diff] [blame] | 80 | |
pbrook | cec7d0b | 2008-05-28 16:44:57 +0000 | [diff] [blame] | 81 | SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) |
| 82 | |
Juan Quintela | f527c57 | 2009-11-05 17:19:57 +0100 | [diff] [blame] | 83 | subdir-%: $(GENERATED_HEADERS) |
Paul Brook | 0087375 | 2009-05-07 02:00:31 +0100 | [diff] [blame] | 84 | $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,) |
pbrook | 4aa4253 | 2006-05-13 13:55:08 +0000 | [diff] [blame] | 85 | |
Stefan Weil | b88bc80 | 2010-01-14 18:11:43 +0100 | [diff] [blame] | 86 | ifneq ($(wildcard config-host.mak),) |
Andreas Färber | 0e8c921 | 2010-01-06 20:24:05 +0100 | [diff] [blame] | 87 | include $(SRC_PATH)/Makefile.objs |
Stefan Weil | b88bc80 | 2010-01-14 18:11:43 +0100 | [diff] [blame] | 88 | endif |
Andreas Färber | 0e8c921 | 2010-01-06 20:24:05 +0100 | [diff] [blame] | 89 | |
| 90 | $(common-obj-y): $(GENERATED_HEADERS) |
Andreas Färber | 91f1690 | 2010-09-12 17:21:36 +0200 | [diff] [blame] | 91 | $(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis |
Paul Brook | c05ac89 | 2009-07-31 13:18:32 +0100 | [diff] [blame] | 92 | |
Andreas Färber | 91f1690 | 2010-09-12 17:21:36 +0200 | [diff] [blame] | 93 | $(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser |
Blue Swirl | add1615 | 2009-09-27 16:26:02 +0000 | [diff] [blame] | 94 | |
Paul Brook | c05ac89 | 2009-07-31 13:18:32 +0100 | [diff] [blame] | 95 | ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) |
| 96 | romsubdir-%: |
| 97 | $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",) |
| 98 | |
| 99 | ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) |
| 100 | |
| 101 | recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) |
bellard | 83f6409 | 2006-08-01 16:21:11 +0000 | [diff] [blame] | 102 | |
Juan Quintela | 98b068a | 2009-08-03 14:46:57 +0200 | [diff] [blame] | 103 | audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS) |
Juan Quintela | 0e22fd2 | 2009-06-25 00:08:09 +0200 | [diff] [blame] | 104 | |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame] | 105 | QEMU_CFLAGS+=$(CURL_CFLAGS) |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 106 | |
Corentin Chary | 3e230dd | 2010-07-07 20:57:52 +0200 | [diff] [blame] | 107 | ui/cocoa.o: ui/cocoa.m |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 108 | |
Corentin Chary | 3e230dd | 2010-07-07 20:57:52 +0200 | [diff] [blame] | 109 | ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS) |
aliguori | 0483755 | 2009-03-06 20:27:10 +0000 | [diff] [blame] | 110 | |
Corentin Chary | 3e230dd | 2010-07-07 20:57:52 +0200 | [diff] [blame] | 111 | ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 112 | |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame] | 113 | bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS) |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 114 | |
Blue Swirl | 9fe6de9 | 2010-09-26 16:07:57 +0000 | [diff] [blame] | 115 | version.o: $(SRC_PATH)/version.rc config-host.mak |
| 116 | $(call quiet-command,$(WINDRES) -I. -o $@ $<," RC $(TARGET_DIR)$@") |
| 117 | |
| 118 | version-obj-$(CONFIG_WIN32) += version.o |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 119 | ###################################################################### |
| 120 | |
Juan Quintela | 3c089e1 | 2010-01-20 20:54:18 +0100 | [diff] [blame] | 121 | qemu-img.o: qemu-img-cmds.h |
Paul Brook | 6e14404 | 2010-11-26 18:46:03 +0000 | [diff] [blame] | 122 | qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o: $(GENERATED_HEADERS) |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 123 | |
Jes Sorensen | c1b0b93 | 2010-10-26 10:39:19 +0200 | [diff] [blame] | 124 | qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 125 | |
Jes Sorensen | c1b0b93 | 2010-10-26 10:39:19 +0200 | [diff] [blame] | 126 | qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o |
aliguori | 3aa892d | 2009-01-21 18:13:02 +0000 | [diff] [blame] | 127 | |
Jes Sorensen | c1b0b93 | 2010-10-26 10:39:19 +0200 | [diff] [blame] | 128 | qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o |
aliguori | 0a8e1ac | 2009-04-05 18:41:23 +0000 | [diff] [blame] | 129 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 130 | qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 131 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@") |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 132 | |
Jan Kiszka | 4091da4 | 2010-05-20 09:18:52 +0200 | [diff] [blame] | 133 | check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o: $(GENERATED_HEADERS) |
| 134 | |
Luiz Capitulino | e71e00e | 2010-11-12 12:55:46 -0200 | [diff] [blame] | 135 | CHECK_PROG_DEPS = qemu-malloc.o $(oslib-obj-y) $(trace-obj-y) |
| 136 | |
| 137 | check-qint: check-qint.o qint.o $(CHECK_PROG_DEPS) |
| 138 | check-qstring: check-qstring.o qstring.o $(CHECK_PROG_DEPS) |
| 139 | check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(CHECK_PROG_DEPS) |
| 140 | check-qlist: check-qlist.o qlist.o qint.o $(CHECK_PROG_DEPS) |
| 141 | check-qfloat: check-qfloat.o qfloat.o $(CHECK_PROG_DEPS) |
| 142 | check-qjson: check-qjson.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o qjson.o json-streamer.o json-lexer.o json-parser.o $(CHECK_PROG_DEPS) |
Luiz Capitulino | 33837ba | 2009-08-28 15:27:29 -0300 | [diff] [blame] | 143 | |
Robert Relyea | 111a38b | 2010-11-28 16:36:38 +0200 | [diff] [blame] | 144 | QEMULIBS=libhw32 libhw64 libuser libdis libdis-user |
| 145 | |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 146 | clean: |
bellard | 2d80ae8 | 2003-08-11 23:01:33 +0000 | [diff] [blame] | 147 | # avoid old build problems by removing potentially incorrect old files |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 148 | rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h |
Michael S. Tsirkin | df2943b | 2010-10-26 17:53:41 +0200 | [diff] [blame] | 149 | rm -f qemu-options.def |
aurel32 | 86e840e | 2008-12-07 15:21:23 +0000 | [diff] [blame] | 150 | rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~ |
Corentin Chary | 3e230dd | 2010-07-07 20:57:52 +0200 | [diff] [blame] | 151 | rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d |
Blue Swirl | 07b44ce | 2009-06-09 18:45:16 +0000 | [diff] [blame] | 152 | rm -f qemu-img-cmds.h |
Blue Swirl | d7489b7 | 2010-10-09 08:24:17 +0000 | [diff] [blame] | 153 | rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp |
Daniel P. Berrange | b3d08c0 | 2010-11-12 13:20:24 +0000 | [diff] [blame] | 154 | rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp |
| 155 | rm -f trace-dtrace.h trace-dtrace.h-timestamp |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 156 | $(MAKE) -C tests clean |
Robert Relyea | 111a38b | 2010-11-28 16:36:38 +0200 | [diff] [blame] | 157 | for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \ |
Magnus Damm | fc8e320 | 2009-11-13 18:51:05 +0900 | [diff] [blame] | 158 | if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \ |
Michael S. Tsirkin | df2943b | 2010-10-26 17:53:41 +0200 | [diff] [blame] | 159 | rm -f $$d/qemu-options.def; \ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 160 | done |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 161 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 162 | distclean: clean |
Magnus Damm | fc8e320 | 2009-11-13 18:51:05 +0900 | [diff] [blame] | 163 | rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi |
Paul Brook | a992fe3 | 2009-11-22 16:25:30 +0000 | [diff] [blame] | 164 | rm -f config-all-devices.mak |
Magnus Damm | fc8e320 | 2009-11-13 18:51:05 +0900 | [diff] [blame] | 165 | rm -f roms/seabios/config.mak roms/vgabios/config.mak |
Hidetoshi Seto | e1a068b | 2010-07-08 14:26:18 +0900 | [diff] [blame] | 166 | rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.dvi qemu-doc.fn qemu-doc.info qemu-doc.ky qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp qemu-doc.vr |
| 167 | rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr |
Robert Relyea | 111a38b | 2010-11-28 16:36:38 +0200 | [diff] [blame] | 168 | for d in $(TARGET_DIRS) $(QEMULIBS); do \ |
bellard | bc1b050 | 2003-10-28 00:12:52 +0000 | [diff] [blame] | 169 | rm -rf $$d || exit 1 ; \ |
bellard | 76bc683 | 2003-08-10 23:41:46 +0000 | [diff] [blame] | 170 | done |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 171 | |
bellard | fed4a9a | 2004-12-12 22:18:34 +0000 | [diff] [blame] | 172 | KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \ |
| 173 | ar de en-us fi fr-be hr it lv nl pl ru th \ |
| 174 | common de-ch es fo fr-ca hu ja mk nl-be pt sl tr |
| 175 | |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 176 | ifdef INSTALL_BLOBS |
Gerd Hoffmann | 3b3d448 | 2010-08-23 12:10:46 +0200 | [diff] [blame] | 177 | BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin \ |
Gerd Hoffmann | 7943a2f | 2010-11-30 11:54:33 +0100 | [diff] [blame] | 178 | vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \ |
Gerd Hoffmann | 3b3d448 | 2010-08-23 12:10:46 +0200 | [diff] [blame] | 179 | ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \ |
Stefan Weil | 5309e5f | 2010-03-04 14:44:41 -0600 | [diff] [blame] | 180 | gpxe-eepro100-80861209.rom \ |
Stefan Weil | 5309e5f | 2010-03-04 14:44:41 -0600 | [diff] [blame] | 181 | pxe-e1000.bin \ |
Stefan Weil | 88e2b0a | 2009-11-02 19:59:06 +0100 | [diff] [blame] | 182 | pxe-ne2k_pci.bin pxe-pcnet.bin \ |
| 183 | pxe-rtl8139.bin pxe-virtio.bin \ |
Michal Simek | 00914b7 | 2011-03-14 11:29:19 +0100 | [diff] [blame] | 184 | bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ |
Alexander Graf | fe270d0 | 2010-04-20 19:37:13 +0200 | [diff] [blame] | 185 | multiboot.bin linuxboot.bin \ |
David Gibson | 39ac845 | 2011-04-01 15:15:23 +1100 | [diff] [blame] | 186 | s390-zipl.rom \ |
David Gibson | a9f8ad8 | 2011-04-01 15:15:34 +1100 | [diff] [blame] | 187 | spapr-rtas.bin slof.bin |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 188 | else |
| 189 | BLOBS= |
| 190 | endif |
| 191 | |
pbrook | 38954dc | 2006-04-30 23:54:18 +0000 | [diff] [blame] | 192 | install-doc: $(DOCS) |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 193 | $(INSTALL_DIR) "$(DESTDIR)$(docdir)" |
| 194 | $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" |
Juan Quintela | 96d409e | 2009-08-03 14:47:00 +0200 | [diff] [blame] | 195 | ifdef CONFIG_POSIX |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 196 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" |
| 197 | $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" |
| 198 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" |
| 199 | $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" |
pbrook | 38954dc | 2006-04-30 23:54:18 +0000 | [diff] [blame] | 200 | endif |
| 201 | |
john cooper | b5ec5ce | 2010-02-20 11:14:59 -0600 | [diff] [blame] | 202 | install-sysconfig: |
Andre Przywara | 990caaf | 2010-03-08 15:43:41 +0100 | [diff] [blame] | 203 | $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu" |
| 204 | $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu" |
john cooper | b5ec5ce | 2010-02-20 11:14:59 -0600 | [diff] [blame] | 205 | |
| 206 | install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 207 | $(INSTALL_DIR) "$(DESTDIR)$(bindir)" |
ths | 932a79d | 2007-10-20 18:29:34 +0000 | [diff] [blame] | 208 | ifneq ($(TOOLS),) |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 209 | $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)" |
ths | 932a79d | 2007-10-20 18:29:34 +0000 | [diff] [blame] | 210 | endif |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 211 | ifneq ($(BLOBS),) |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 212 | $(INSTALL_DIR) "$(DESTDIR)$(datadir)" |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 213 | set -e; for x in $(BLOBS); do \ |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 214 | $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 215 | done |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 216 | endif |
aliguori | 58f8aea | 2009-04-18 15:36:02 +0000 | [diff] [blame] | 217 | $(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps" |
blueswir1 | 18be8d7 | 2008-03-05 18:16:09 +0000 | [diff] [blame] | 218 | set -e; for x in $(KEYMAPS); do \ |
Anthony Liguori | 79fd42a | 2009-05-28 03:11:42 -0500 | [diff] [blame] | 219 | $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 220 | done |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 221 | for d in $(TARGET_DIRS); do \ |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 222 | $(MAKE) -C $$d $@ || exit 1 ; \ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 223 | done |
bellard | 612384d | 2003-03-22 17:31:19 +0000 | [diff] [blame] | 224 | |
bellard | 367e86e | 2003-03-01 17:13:26 +0000 | [diff] [blame] | 225 | # various test targets |
bellard | 9b0b820 | 2007-11-14 10:34:57 +0000 | [diff] [blame] | 226 | test speed: all |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 227 | $(MAKE) -C tests $@ |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 228 | |
Alexandre Bique | 21d4e8e | 2009-08-07 15:43:11 +0100 | [diff] [blame] | 229 | .PHONY: TAGS |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 230 | TAGS: |
Alexandre Bique | 21d4e8e | 2009-08-07 15:43:11 +0100 | [diff] [blame] | 231 | find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 232 | |
bellard | 6688bc6 | 2005-08-21 09:23:39 +0000 | [diff] [blame] | 233 | cscope: |
| 234 | rm -f ./cscope.* |
aurel32 | ede4608 | 2008-10-01 21:46:58 +0000 | [diff] [blame] | 235 | find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files |
bellard | 6688bc6 | 2005-08-21 09:23:39 +0000 | [diff] [blame] | 236 | cscope -b |
| 237 | |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 238 | # documentation |
Stefan Weil | 01668d9 | 2010-03-04 22:21:02 +0100 | [diff] [blame] | 239 | MAKEINFO=makeinfo |
| 240 | MAKEINFOFLAGS=--no-headers --no-split --number-sections |
Stefan Weil | 20cc999 | 2010-01-29 23:16:50 +0100 | [diff] [blame] | 241 | TEXIFLAG=$(if $(V),,--quiet) |
| 242 | %.dvi: %.texi |
| 243 | $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@") |
| 244 | |
bellard | 1f67313 | 2004-04-04 15:21:17 +0000 | [diff] [blame] | 245 | %.html: %.texi |
Stefan Weil | 01668d9 | 2010-03-04 22:21:02 +0100 | [diff] [blame] | 246 | $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \ |
| 247 | " GEN $@") |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 248 | |
bellard | f354832 | 2006-04-30 22:51:54 +0000 | [diff] [blame] | 249 | %.info: %.texi |
Stefan Weil | 01668d9 | 2010-03-04 22:21:02 +0100 | [diff] [blame] | 250 | $(call quiet-command,$(MAKEINFO) $< -o $@," GEN $@") |
bellard | f354832 | 2006-04-30 22:51:54 +0000 | [diff] [blame] | 251 | |
Stefan Weil | 20cc999 | 2010-01-29 23:16:50 +0100 | [diff] [blame] | 252 | %.pdf: %.texi |
| 253 | $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<," GEN $@") |
blueswir1 | 5824d65 | 2009-03-28 06:44:27 +0000 | [diff] [blame] | 254 | |
| 255 | qemu-options.texi: $(SRC_PATH)/qemu-options.hx |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 256 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") |
bellard | f354832 | 2006-04-30 22:51:54 +0000 | [diff] [blame] | 257 | |
Luiz Capitulino | acd0a09 | 2010-09-30 16:00:22 -0300 | [diff] [blame] | 258 | qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 259 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") |
Blue Swirl | 2313086 | 2009-06-06 08:22:04 +0000 | [diff] [blame] | 260 | |
Luiz Capitulino | 82a56f0 | 2010-09-13 12:26:00 -0300 | [diff] [blame] | 261 | QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 262 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@," GEN $@") |
Jan Kiszka | b40292e | 2010-05-31 14:43:31 -0300 | [diff] [blame] | 263 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 264 | qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 265 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 266 | |
Blue Swirl | 2313086 | 2009-06-06 08:22:04 +0000 | [diff] [blame] | 267 | qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 268 | $(call quiet-command, \ |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 269 | perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \ |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 270 | pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \ |
| 271 | " GEN $@") |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 272 | |
Stuart Brady | 153859b | 2009-06-07 00:42:17 +0100 | [diff] [blame] | 273 | qemu-img.1: qemu-img.texi qemu-img-cmds.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 274 | $(call quiet-command, \ |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 275 | perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \ |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 276 | pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \ |
| 277 | " GEN $@") |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 278 | |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 279 | qemu-nbd.8: qemu-nbd.texi |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 280 | $(call quiet-command, \ |
Blue Swirl | 4c3b5a4 | 2011-01-20 20:54:21 +0000 | [diff] [blame] | 281 | perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \ |
aliguori | 0d00e56 | 2009-04-05 17:40:46 +0000 | [diff] [blame] | 282 | pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \ |
| 283 | " GEN $@") |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 284 | |
pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 285 | dvi: qemu-doc.dvi qemu-tech.dvi |
pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 286 | html: qemu-doc.html qemu-tech.html |
Stefan Weil | 20cc999 | 2010-01-29 23:16:50 +0100 | [diff] [blame] | 287 | info: qemu-doc.info qemu-tech.info |
| 288 | pdf: qemu-doc.pdf qemu-tech.pdf |
pbrook | 0cb3fb1 | 2006-05-14 12:07:53 +0000 | [diff] [blame] | 289 | |
Stefan Weil | 20cc999 | 2010-01-29 23:16:50 +0100 | [diff] [blame] | 290 | qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ |
| 291 | qemu-img.texi qemu-nbd.texi qemu-options.texi \ |
| 292 | qemu-monitor.texi qemu-img-cmds.texi |
aliguori | 818220f | 2008-09-24 01:13:40 +0000 | [diff] [blame] | 293 | |
ths | df5cf72 | 2007-01-24 22:56:36 +0000 | [diff] [blame] | 294 | VERSION ?= $(shell cat VERSION) |
| 295 | FILE = qemu-$(VERSION) |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 296 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 297 | # tar release (use 'make -k tar' on a checkouted tree) |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 298 | tar: |
| 299 | rm -rf /tmp/$(FILE) |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 300 | cp -r . /tmp/$(FILE) |
aurel32 | 99c6c08 | 2008-04-22 20:45:30 +0000 | [diff] [blame] | 301 | 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] | 302 | rm -rf /tmp/$(FILE) |
| 303 | |
Stuart Brady | 4c0a6db | 2010-05-12 20:42:04 +0100 | [diff] [blame] | 304 | SYSTEM_TARGETS=$(filter %-softmmu,$(TARGET_DIRS)) |
| 305 | SYSTEM_PROGS=$(patsubst qemu-system-i386,qemu, \ |
| 306 | $(patsubst %-softmmu,qemu-system-%, \ |
| 307 | $(SYSTEM_TARGETS))) |
| 308 | |
| 309 | USER_TARGETS=$(filter %-user,$(TARGET_DIRS)) |
| 310 | USER_PROGS=$(patsubst %-bsd-user,qemu-%, \ |
| 311 | $(patsubst %-darwin-user,qemu-%, \ |
| 312 | $(patsubst %-linux-user,qemu-%, \ |
| 313 | $(USER_TARGETS)))) |
| 314 | |
bellard | 76b62fd | 2003-10-28 00:47:44 +0000 | [diff] [blame] | 315 | # generate a binary distribution |
bellard | d691f66 | 2003-03-24 21:58:34 +0000 | [diff] [blame] | 316 | tarbin: |
blueswir1 | 18be8d7 | 2008-03-05 18:16:09 +0000 | [diff] [blame] | 317 | cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \ |
Stuart Brady | 4c0a6db | 2010-05-12 20:42:04 +0100 | [diff] [blame] | 318 | $(patsubst %,$(bindir)/%, $(SYSTEM_PROGS)) \ |
| 319 | $(patsubst %,$(bindir)/%, $(USER_PROGS)) \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 320 | $(bindir)/qemu-img \ |
| 321 | $(bindir)/qemu-nbd \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 322 | $(datadir)/bios.bin \ |
| 323 | $(datadir)/vgabios.bin \ |
bellard | de9258a | 2004-06-06 15:50:03 +0000 | [diff] [blame] | 324 | $(datadir)/vgabios-cirrus.bin \ |
bellard | 637f6cd | 2004-06-21 19:54:47 +0000 | [diff] [blame] | 325 | $(datadir)/ppc_rom.bin \ |
bellard | 0986ac3 | 2006-06-14 12:36:32 +0000 | [diff] [blame] | 326 | $(datadir)/openbios-sparc32 \ |
blueswir1 | 938255d | 2008-04-23 19:38:07 +0000 | [diff] [blame] | 327 | $(datadir)/openbios-sparc64 \ |
aurel32 | e5d01b0 | 2009-01-09 11:01:31 +0000 | [diff] [blame] | 328 | $(datadir)/openbios-ppc \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 329 | $(datadir)/pxe-ne2k_pci.bin \ |
bellard | 19c80e5 | 2007-02-05 21:22:42 +0000 | [diff] [blame] | 330 | $(datadir)/pxe-rtl8139.bin \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 331 | $(datadir)/pxe-pcnet.bin \ |
aliguori | 2991990 | 2008-07-26 16:53:22 +0000 | [diff] [blame] | 332 | $(datadir)/pxe-e1000.bin \ |
bellard | 1f50f8d | 2004-05-08 14:44:43 +0000 | [diff] [blame] | 333 | $(docdir)/qemu-doc.html \ |
| 334 | $(docdir)/qemu-tech.html \ |
aurel32 | 40e8a53 | 2009-01-03 12:35:57 +0000 | [diff] [blame] | 335 | $(mandir)/man1/qemu.1 \ |
| 336 | $(mandir)/man1/qemu-img.1 \ |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 337 | $(mandir)/man8/qemu-nbd.8 |
bellard | d691f66 | 2003-03-24 21:58:34 +0000 | [diff] [blame] | 338 | |
bellard | 4fb240a | 2007-11-07 19:24:02 +0000 | [diff] [blame] | 339 | # Include automatically generated dependency files |
Corentin Chary | 3e230dd | 2010-07-07 20:57:52 +0200 | [diff] [blame] | 340 | -include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d) |