blob: 747e47c834dd09e6afae70fb7bd9b75b17fdebe1 [file] [log] [blame]
pbrook0cb3fb12006-05-14 12:07:53 +00001# Makefile for QEMU.
2
Michael S. Tsirkindf2943b2010-10-26 17:53:41 +02003GENERATED_HEADERS = config-host.h trace.h qemu-options.def
Daniel P. Berrangeb3d08c02010-11-12 13:20:24 +00004ifeq ($(TRACE_BACKEND),dtrace)
5GENERATED_HEADERS += trace-dtrace.h
6endif
Juan Quintelaf527c572009-11-05 17:19:57 +01007
aurel3255d7e8f2009-04-15 14:42:57 +00008ifneq ($(wildcard config-host.mak),)
Paul Brook1ad21342009-05-19 16:17:58 +01009# Put the all: rule here so that config-host.mak can contain dependencies.
10all: build-all
pbrookad064842006-04-16 12:41:07 +000011include config-host.mak
aliguori17759182009-01-21 18:12:52 +000012include $(SRC_PATH)/rules.mak
Paolo Bonzini59bc10e2010-01-04 11:02:28 +010013config-host.mak: $(SRC_PATH)/configure
Juan Quintelae5efe7f2009-10-07 02:40:59 +020014 @echo $@ is out-of-date, running configure
15 @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
aurel3255d7e8f2009-04-15 14:42:57 +000016else
17config-host.mak:
18 @echo "Please call configure before running make!"
19 @exit 1
20endif
bellard766a4872003-02-18 23:35:48 +000021
Juan Quintelad9ace8b2009-10-06 21:11:15 +020022# Don't try to regenerate Makefile or configure
23# We don't generate any of them
24Makefile: ;
25configure: ;
26
aliguori818220f2008-09-24 01:13:40 +000027.PHONY: all clean cscope distclean dvi html info install install-doc \
Stefan Weil20cc9992010-01-29 23:16:50 +010028 pdf recurse-all speed tar tarbin test build-all
pbrook0cb3fb12006-05-14 12:07:53 +000029
Paolo Bonzini076d2472009-12-21 10:06:55 +010030$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
pbrook8c462f82007-11-18 21:12:37 +000031
Juan Quintela3e2e0e62009-08-03 14:47:06 +020032LIBS+=-lz $(LIBS_TOOLS)
Juan Quintela67c0f082009-07-27 16:12:51 +020033
pbrookcc8ae6d2006-04-23 17:57:59 +000034ifdef BUILD_DOCS
Jan Kiszkab40292e2010-05-31 14:43:31 -030035DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
pbrookcc8ae6d2006-04-23 17:57:59 +000036else
37DOCS=
38endif
bellard7d132992003-03-06 23:23:54 +000039
Juan Quintela1215c6e2009-10-07 02:40:58 +020040SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
Juan Quintela1f3d3c82009-10-07 02:41:02 +020041SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
42
43config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
Stefan Weil01d86a82009-11-19 20:19:56 +010044 $(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@," GEN $@")
Juan Quintela1f3d3c82009-10-07 02:41:02 +020045
Paul Brooka992fe32009-11-22 16:25:30 +000046%/config-devices.mak: default-configs/%.mak
47 $(call quiet-command,cat $< > $@.tmp, " GEN $@")
Stefan Weil012f0872009-12-20 15:39:03 +010048 @if test -f $@; then \
Blue Swirl904fe1f2010-10-02 14:28:08 +000049 if cmp -s $@.old $@; then \
50 if ! cmp -s $@ $@.tmp; then \
51 mv $@.tmp $@; \
52 cp -p $@ $@.old; \
53 fi; \
Stefan Weil012f0872009-12-20 15:39:03 +010054 else \
55 if test -f $@.old; then \
56 echo "WARNING: $@ (user modified) out of date.";\
57 else \
58 echo "WARNING: $@ out of date.";\
59 fi; \
60 echo "Run \"make defconfig\" to regenerate."; \
61 rm $@.tmp; \
62 fi; \
Paul Brooka992fe32009-11-22 16:25:30 +000063 else \
Stefan Weil012f0872009-12-20 15:39:03 +010064 mv $@.tmp $@; \
65 cp -p $@ $@.old; \
Paul Brooka992fe32009-11-22 16:25:30 +000066 fi
67
68defconfig:
69 rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
70
Juan Quintela1f3d3c82009-10-07 02:41:02 +020071-include config-all-devices.mak
Juan Quintela1215c6e2009-10-07 02:40:58 +020072
Juan Quintelaf527c572009-11-05 17:19:57 +010073build-all: $(DOCS) $(TOOLS) recurse-all
pbrookb9dea4f2006-05-13 16:54:03 +000074
Juan Quintela1215c6e2009-10-07 02:40:58 +020075config-host.h: config-host.h-timestamp
76config-host.h-timestamp: config-host.mak
Blue Swirle14056a2010-11-01 18:09:38 +000077qemu-options.def: $(SRC_PATH)/qemu-options.hx
Michael S. Tsirkindf2943b2010-10-26 17:53:41 +020078 $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@")
Juan Quintela1215c6e2009-10-07 02:40:58 +020079
pbrookcec7d0b2008-05-28 16:44:57 +000080SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
81
Juan Quintelaf527c572009-11-05 17:19:57 +010082subdir-%: $(GENERATED_HEADERS)
Paul Brook00873752009-05-07 02:00:31 +010083 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
pbrook4aa42532006-05-13 13:55:08 +000084
Stefan Weilb88bc802010-01-14 18:11:43 +010085ifneq ($(wildcard config-host.mak),)
Andreas Färber0e8c9212010-01-06 20:24:05 +010086include $(SRC_PATH)/Makefile.objs
Stefan Weilb88bc802010-01-14 18:11:43 +010087endif
Andreas Färber0e8c9212010-01-06 20:24:05 +010088
89$(common-obj-y): $(GENERATED_HEADERS)
Andreas Färber91f16902010-09-12 17:21:36 +020090$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
Paul Brookc05ac892009-07-31 13:18:32 +010091
Andreas Färber91f16902010-09-12 17:21:36 +020092$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
Blue Swirladd16152009-09-27 16:26:02 +000093
Paul Brookc05ac892009-07-31 13:18:32 +010094ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
95romsubdir-%:
96 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
97
98ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
99
100recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
bellard83f64092006-08-01 16:21:11 +0000101
Juan Quintela98b068a2009-08-03 14:46:57 +0200102audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
Juan Quintela0e22fd22009-06-25 00:08:09 +0200103
Juan Quintelaa558ee12009-08-03 14:46:21 +0200104QEMU_CFLAGS+=$(CURL_CFLAGS)
Alexander Graf769ce762009-05-11 17:41:42 +0200105
Corentin Chary3e230dd2010-07-07 20:57:52 +0200106ui/cocoa.o: ui/cocoa.m
bellard4fb240a2007-11-07 19:24:02 +0000107
Corentin Chary3e230dd2010-07-07 20:57:52 +0200108ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
aliguori04837552009-03-06 20:27:10 +0000109
Corentin Chary3e230dd2010-07-07 20:57:52 +0200110ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
balrog4d3b6f62008-02-10 16:33:14 +0000111
Juan Quintelaa558ee12009-08-03 14:46:21 +0200112bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
bellard4fb240a2007-11-07 19:24:02 +0000113
Daniel P. Berrangeb3d08c02010-11-12 13:20:24 +0000114ifeq ($(TRACE_BACKEND),dtrace)
115trace.h: trace.h-timestamp trace-dtrace.h
116else
Blue Swirla82cdd52010-10-02 14:28:12 +0000117trace.h: trace.h-timestamp
Daniel P. Berrangeb3d08c02010-11-12 13:20:24 +0000118endif
Blue Swirla82cdd52010-10-02 14:28:12 +0000119trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak
120 $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -h < $< > $@," GEN trace.h")
121 @cmp -s $@ trace.h || cp $@ trace.h
Stefan Hajnoczi94a420b2010-05-22 17:52:39 +0100122
Blue Swirla82cdd52010-10-02 14:28:12 +0000123trace.c: trace.c-timestamp
124trace.c-timestamp: $(SRC_PATH)/trace-events config-host.mak
125 $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -c < $< > $@," GEN trace.c")
126 @cmp -s $@ trace.c || cp $@ trace.c
Stefan Hajnoczi94a420b2010-05-22 17:52:39 +0100127
128trace.o: trace.c $(GENERATED_HEADERS)
129
Daniel P. Berrangeb3d08c02010-11-12 13:20:24 +0000130trace-dtrace.h: trace-dtrace.dtrace
131 $(call quiet-command,dtrace -o $@ -h -s $<, " GEN trace-dtrace.h")
132
133# Normal practice is to name DTrace probe file with a '.d' extension
134# but that gets picked up by QEMU's Makefile as an external dependancy
135# rule file. So we use '.dtrace' instead
136trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
137trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events config-host.mak
138 $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -d < $< > $@," GEN trace-dtrace.dtrace")
139 @cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
140
141trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
142 $(call quiet-command,dtrace -o $@ -G -s $<, " GEN trace-dtrace.o")
143
Stefan Hajnoczi26f72272010-05-22 19:24:51 +0100144simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
145
Blue Swirl9fe6de92010-09-26 16:07:57 +0000146version.o: $(SRC_PATH)/version.rc config-host.mak
147 $(call quiet-command,$(WINDRES) -I. -o $@ $<," RC $(TARGET_DIR)$@")
148
149version-obj-$(CONFIG_WIN32) += version.o
bellard4fb240a2007-11-07 19:24:02 +0000150######################################################################
151
Juan Quintela3c089e12010-01-20 20:54:18 +0100152qemu-img.o: qemu-img-cmds.h
153qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o: $(GENERATED_HEADERS)
Stuart Brady153859b2009-06-07 00:42:17 +0100154
Jes Sorensenc1b0b932010-10-26 10:39:19 +0200155qemu-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
bellard4fb240a2007-11-07 19:24:02 +0000156
Jes Sorensenc1b0b932010-10-26 10:39:19 +0200157qemu-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
aliguori3aa892d2009-01-21 18:13:02 +0000158
Jes Sorensenc1b0b932010-10-26 10:39:19 +0200159qemu-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
aliguori0a8e1ac2009-04-05 18:41:23 +0000160
Stuart Brady153859b2009-06-07 00:42:17 +0100161qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
162 $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@")
163
Jan Kiszka4091da42010-05-20 09:18:52 +0200164check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o: $(GENERATED_HEADERS)
165
Jan Kiszka945d3e62010-10-19 16:03:15 +0200166check-qint: check-qint.o qint.o qemu-malloc.o $(trace-obj-y)
167check-qstring: check-qstring.o qstring.o qemu-malloc.o $(trace-obj-y)
168check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qemu-malloc.o qlist.o $(trace-obj-y)
169check-qlist: check-qlist.o qlist.o qint.o qemu-malloc.o $(trace-obj-y)
170check-qfloat: check-qfloat.o qfloat.o qemu-malloc.o $(trace-obj-y)
171check-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 qemu-malloc.o $(trace-obj-y)
Luiz Capitulino33837ba2009-08-28 15:27:29 -0300172
bellard31e31b82003-02-18 22:55:36 +0000173clean:
bellard2d80ae82003-08-11 23:01:33 +0000174# avoid old build problems by removing potentially incorrect old files
Juan Quintela25be210f2009-10-07 02:41:00 +0200175 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. Tsirkindf2943b2010-10-26 17:53:41 +0200176 rm -f qemu-options.def
aurel3286e840e2008-12-07 15:21:23 +0000177 rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~
Corentin Chary3e230dd2010-07-07 20:57:52 +0200178 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 Swirl07b44ce2009-06-09 18:45:16 +0000179 rm -f qemu-img-cmds.h
Blue Swirld7489b72010-10-09 08:24:17 +0000180 rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
Daniel P. Berrangeb3d08c02010-11-12 13:20:24 +0000181 rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
182 rm -f trace-dtrace.h trace-dtrace.h-timestamp
bellard7d3505c2004-05-12 19:32:15 +0000183 $(MAKE) -C tests clean
Blue Swirl4d904532010-03-21 08:28:47 +0000184 for d in $(ALL_SUBDIRS) libhw32 libhw64 libuser libdis libdis-user; do \
Magnus Dammfc8e3202009-11-13 18:51:05 +0900185 if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
Michael S. Tsirkindf2943b2010-10-26 17:53:41 +0200186 rm -f $$d/qemu-options.def; \
bellard626df762003-08-10 21:39:31 +0000187 done
bellard31e31b82003-02-18 22:55:36 +0000188
bellard7d132992003-03-06 23:23:54 +0000189distclean: clean
Magnus Dammfc8e3202009-11-13 18:51:05 +0900190 rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
Paul Brooka992fe32009-11-22 16:25:30 +0000191 rm -f config-all-devices.mak
Magnus Dammfc8e3202009-11-13 18:51:05 +0900192 rm -f roms/seabios/config.mak roms/vgabios/config.mak
Hidetoshi Setoe1a068b2010-07-08 14:26:18 +0900193 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
194 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
Blue Swirl4d904532010-03-21 08:28:47 +0000195 for d in $(TARGET_DIRS) libhw32 libhw64 libuser libdis libdis-user; do \
bellardbc1b0502003-10-28 00:12:52 +0000196 rm -rf $$d || exit 1 ; \
bellard76bc6832003-08-10 23:41:46 +0000197 done
bellard7d132992003-03-06 23:23:54 +0000198
bellardfed4a9a2004-12-12 22:18:34 +0000199KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
200ar de en-us fi fr-be hr it lv nl pl ru th \
201common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
202
ths77755342008-11-27 15:45:16 +0000203ifdef INSTALL_BLOBS
Gerd Hoffmann3b3d4482010-08-23 12:10:46 +0200204BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin \
205vgabios-stdvga.bin vgabios-vmware.bin \
206ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
Stefan Weil5309e5f2010-03-04 14:44:41 -0600207gpxe-eepro100-80861209.rom \
208gpxe-eepro100-80861229.rom \
209pxe-e1000.bin \
Stefan Weil88e2b0a2009-11-02 19:59:06 +0100210pxe-ne2k_pci.bin pxe-pcnet.bin \
211pxe-rtl8139.bin pxe-virtio.bin \
Alexander Graf253d0942009-06-29 15:37:40 +0200212bamboo.dtb petalogix-s3adsp1800.dtb \
Alexander Graffe270d02010-04-20 19:37:13 +0200213multiboot.bin linuxboot.bin \
214s390-zipl.rom
ths77755342008-11-27 15:45:16 +0000215else
216BLOBS=
217endif
218
pbrook38954dc2006-04-30 23:54:18 +0000219install-doc: $(DOCS)
aliguori58f8aea2009-04-18 15:36:02 +0000220 $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
221 $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
Juan Quintela96d409e2009-08-03 14:47:00 +0200222ifdef CONFIG_POSIX
aliguori58f8aea2009-04-18 15:36:02 +0000223 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
224 $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
225 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
226 $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
pbrook38954dc2006-04-30 23:54:18 +0000227endif
228
john cooperb5ec5ce2010-02-20 11:14:59 -0600229install-sysconfig:
Andre Przywara990caaf2010-03-08 15:43:41 +0100230 $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
231 $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
john cooperb5ec5ce2010-02-20 11:14:59 -0600232
233install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
aliguori58f8aea2009-04-18 15:36:02 +0000234 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ths932a79d2007-10-20 18:29:34 +0000235ifneq ($(TOOLS),)
aliguori58f8aea2009-04-18 15:36:02 +0000236 $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
ths932a79d2007-10-20 18:29:34 +0000237endif
ths77755342008-11-27 15:45:16 +0000238ifneq ($(BLOBS),)
aliguori58f8aea2009-04-18 15:36:02 +0000239 $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
ths77755342008-11-27 15:45:16 +0000240 set -e; for x in $(BLOBS); do \
aliguori58f8aea2009-04-18 15:36:02 +0000241 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
pbrookad064842006-04-16 12:41:07 +0000242 done
ths77755342008-11-27 15:45:16 +0000243endif
aliguori58f8aea2009-04-18 15:36:02 +0000244 $(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
blueswir118be8d72008-03-05 18:16:09 +0000245 set -e; for x in $(KEYMAPS); do \
Anthony Liguori79fd42a2009-05-28 03:11:42 -0500246 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
pbrookad064842006-04-16 12:41:07 +0000247 done
bellard626df762003-08-10 21:39:31 +0000248 for d in $(TARGET_DIRS); do \
bellard7d3505c2004-05-12 19:32:15 +0000249 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +0000250 done
bellard612384d2003-03-22 17:31:19 +0000251
bellard367e86e2003-03-01 17:13:26 +0000252# various test targets
bellard9b0b8202007-11-14 10:34:57 +0000253test speed: all
bellard7d3505c2004-05-12 19:32:15 +0000254 $(MAKE) -C tests $@
bellard31e31b82003-02-18 22:55:36 +0000255
Alexandre Bique21d4e8e2009-08-07 15:43:11 +0100256.PHONY: TAGS
ths5fafdf22007-09-16 21:08:06 +0000257TAGS:
Alexandre Bique21d4e8e2009-08-07 15:43:11 +0100258 find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
bellard31e31b82003-02-18 22:55:36 +0000259
bellard6688bc62005-08-21 09:23:39 +0000260cscope:
261 rm -f ./cscope.*
aurel32ede46082008-10-01 21:46:58 +0000262 find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files
bellard6688bc62005-08-21 09:23:39 +0000263 cscope -b
264
bellard3ef693a2003-03-23 20:17:16 +0000265# documentation
Stefan Weil01668d92010-03-04 22:21:02 +0100266MAKEINFO=makeinfo
267MAKEINFOFLAGS=--no-headers --no-split --number-sections
Stefan Weil20cc9992010-01-29 23:16:50 +0100268TEXIFLAG=$(if $(V),,--quiet)
269%.dvi: %.texi
270 $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@")
271
bellard1f673132004-04-04 15:21:17 +0000272%.html: %.texi
Stefan Weil01668d92010-03-04 22:21:02 +0100273 $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
274 " GEN $@")
bellard3ef693a2003-03-23 20:17:16 +0000275
bellardf3548322006-04-30 22:51:54 +0000276%.info: %.texi
Stefan Weil01668d92010-03-04 22:21:02 +0100277 $(call quiet-command,$(MAKEINFO) $< -o $@," GEN $@")
bellardf3548322006-04-30 22:51:54 +0000278
Stefan Weil20cc9992010-01-29 23:16:50 +0100279%.pdf: %.texi
280 $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<," GEN $@")
blueswir15824d652009-03-28 06:44:27 +0000281
282qemu-options.texi: $(SRC_PATH)/qemu-options.hx
aliguori0d00e562009-04-05 17:40:46 +0000283 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
bellardf3548322006-04-30 22:51:54 +0000284
Luiz Capitulinoacd0a092010-09-30 16:00:22 -0300285qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
Blue Swirl23130862009-06-06 08:22:04 +0000286 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
287
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300288QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
Jan Kiszkab40292e2010-05-31 14:43:31 -0300289 $(call quiet-command,sh $(SRC_PATH)/hxtool -q < $< > $@," GEN $@")
290
Stuart Brady153859b2009-06-07 00:42:17 +0100291qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
292 $(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@," GEN $@")
293
Blue Swirl23130862009-06-06 08:22:04 +0000294qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
aliguori0d00e562009-04-05 17:40:46 +0000295 $(call quiet-command, \
296 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod && \
297 pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
298 " GEN $@")
bellard5a671352003-10-01 00:13:48 +0000299
Stuart Brady153859b2009-06-07 00:42:17 +0100300qemu-img.1: qemu-img.texi qemu-img-cmds.texi
aliguori0d00e562009-04-05 17:40:46 +0000301 $(call quiet-command, \
302 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod && \
303 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
304 " GEN $@")
bellardacd935e2004-11-15 22:57:26 +0000305
bellard7a5ca862008-05-27 21:13:40 +0000306qemu-nbd.8: qemu-nbd.texi
aliguori0d00e562009-04-05 17:40:46 +0000307 $(call quiet-command, \
308 perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod && \
309 pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
310 " GEN $@")
bellard7a5ca862008-05-27 21:13:40 +0000311
pbrook0cb3fb12006-05-14 12:07:53 +0000312dvi: qemu-doc.dvi qemu-tech.dvi
pbrook0cb3fb12006-05-14 12:07:53 +0000313html: qemu-doc.html qemu-tech.html
Stefan Weil20cc9992010-01-29 23:16:50 +0100314info: qemu-doc.info qemu-tech.info
315pdf: qemu-doc.pdf qemu-tech.pdf
pbrook0cb3fb12006-05-14 12:07:53 +0000316
Stefan Weil20cc9992010-01-29 23:16:50 +0100317qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
318 qemu-img.texi qemu-nbd.texi qemu-options.texi \
319 qemu-monitor.texi qemu-img-cmds.texi
aliguori818220f2008-09-24 01:13:40 +0000320
thsdf5cf722007-01-24 22:56:36 +0000321VERSION ?= $(shell cat VERSION)
322FILE = qemu-$(VERSION)
bellard586314f2003-03-03 15:02:29 +0000323
bellard1e43adf2003-09-30 20:54:24 +0000324# tar release (use 'make -k tar' on a checkouted tree)
bellard586314f2003-03-03 15:02:29 +0000325tar:
326 rm -rf /tmp/$(FILE)
bellard1e43adf2003-09-30 20:54:24 +0000327 cp -r . /tmp/$(FILE)
aurel3299c6c082008-04-22 20:45:30 +0000328 cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
bellard586314f2003-03-03 15:02:29 +0000329 rm -rf /tmp/$(FILE)
330
Stuart Brady4c0a6db2010-05-12 20:42:04 +0100331SYSTEM_TARGETS=$(filter %-softmmu,$(TARGET_DIRS))
332SYSTEM_PROGS=$(patsubst qemu-system-i386,qemu, \
333 $(patsubst %-softmmu,qemu-system-%, \
334 $(SYSTEM_TARGETS)))
335
336USER_TARGETS=$(filter %-user,$(TARGET_DIRS))
337USER_PROGS=$(patsubst %-bsd-user,qemu-%, \
338 $(patsubst %-darwin-user,qemu-%, \
339 $(patsubst %-linux-user,qemu-%, \
340 $(USER_TARGETS))))
341
bellard76b62fd2003-10-28 00:47:44 +0000342# generate a binary distribution
bellardd691f662003-03-24 21:58:34 +0000343tarbin:
blueswir118be8d72008-03-05 18:16:09 +0000344 cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
Stuart Brady4c0a6db2010-05-12 20:42:04 +0100345 $(patsubst %,$(bindir)/%, $(SYSTEM_PROGS)) \
346 $(patsubst %,$(bindir)/%, $(USER_PROGS)) \
aurel3240e8a532009-01-03 12:35:57 +0000347 $(bindir)/qemu-img \
348 $(bindir)/qemu-nbd \
bellard7efa4382004-05-12 18:54:06 +0000349 $(datadir)/bios.bin \
350 $(datadir)/vgabios.bin \
bellardde9258a2004-06-06 15:50:03 +0000351 $(datadir)/vgabios-cirrus.bin \
bellard637f6cd2004-06-21 19:54:47 +0000352 $(datadir)/ppc_rom.bin \
bellard0986ac32006-06-14 12:36:32 +0000353 $(datadir)/openbios-sparc32 \
blueswir1938255d2008-04-23 19:38:07 +0000354 $(datadir)/openbios-sparc64 \
aurel32e5d01b02009-01-09 11:01:31 +0000355 $(datadir)/openbios-ppc \
aurel3240e8a532009-01-03 12:35:57 +0000356 $(datadir)/pxe-ne2k_pci.bin \
bellard19c80e52007-02-05 21:22:42 +0000357 $(datadir)/pxe-rtl8139.bin \
aurel3240e8a532009-01-03 12:35:57 +0000358 $(datadir)/pxe-pcnet.bin \
aliguori29919902008-07-26 16:53:22 +0000359 $(datadir)/pxe-e1000.bin \
bellard1f50f8d2004-05-08 14:44:43 +0000360 $(docdir)/qemu-doc.html \
361 $(docdir)/qemu-tech.html \
aurel3240e8a532009-01-03 12:35:57 +0000362 $(mandir)/man1/qemu.1 \
363 $(mandir)/man1/qemu-img.1 \
bellard7a5ca862008-05-27 21:13:40 +0000364 $(mandir)/man8/qemu-nbd.8
bellardd691f662003-03-24 21:58:34 +0000365
bellard4fb240a2007-11-07 19:24:02 +0000366# Include automatically generated dependency files
Corentin Chary3e230dd2010-07-07 20:57:52 +0200367-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d)