xref: /qemu/Makefile (revision c1bb0dce)
10cb3fb1eSpbrook# Makefile for QEMU.
20cb3fb1eSpbrook
3f527c579SJuan Quintela# This needs to be defined before rules.mak
4a992fe3dSPaul BrookGENERATED_HEADERS = config-host.h
5f527c579SJuan Quintela
655d7e8f6Saurel32ifneq ($(wildcard config-host.mak),)
71ad2134fSPaul Brook# Put the all: rule here so that config-host.mak can contain dependencies.
81ad2134fSPaul Brookall: build-all
9ad064840Spbrookinclude config-host.mak
1017759187Saliguoriinclude $(SRC_PATH)/rules.mak
11e5efe7f5SJuan Quintelaconfig-host.mak: configure
12e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
13e5efe7f5SJuan Quintela	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
1455d7e8f6Saurel32else
1555d7e8f6Saurel32config-host.mak:
1655d7e8f6Saurel32	@echo "Please call configure before running make!"
1755d7e8f6Saurel32	@exit 1
1855d7e8f6Saurel32endif
19766a487aSbellard
20d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
21d9ace8b3SJuan Quintela# We don't generate any of them
22d9ace8b3SJuan QuintelaMakefile: ;
23d9ace8b3SJuan Quintelaconfigure: ;
24d9ace8b3SJuan Quintela
25818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
269c927650SJuan Quintela	recurse-all speed tar tarbin test build-all
270cb3fb1eSpbrook
288c462f8fSpbrookVPATH=$(SRC_PATH):$(SRC_PATH)/hw
298c462f8fSpbrook
303e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
3167c0f08dSJuan Quintela
32cc8ae6deSpbrookifdef BUILD_DOCS
337a5ca864SbellardDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
34cc8ae6deSpbrookelse
35cc8ae6deSpbrookDOCS=
36cc8ae6deSpbrookendif
377d13299dSbellard
381215c6e7SJuan QuintelaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
391f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
401f3d3c8fSJuan Quintela
411f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
4201d86a85SStefan Weil	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
431f3d3c8fSJuan Quintela
44a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
45a992fe3dSPaul Brook	$(call quiet-command,cat $< > $@.tmp, "  GEN   $@")
46a992fe3dSPaul Brook	@if test -f $@ ; then \
47a992fe3dSPaul Brook	  echo "WARNING: $@ out of date." ;\
4863e86b2eSStefan Weil	  echo "Run \"make defconfig\" to regenerate." ; \
49a992fe3dSPaul Brook	  rm $@.tmp ; \
50a992fe3dSPaul Brook	 else \
51a992fe3dSPaul Brook	  mv $@.tmp $@ ; \
52a992fe3dSPaul Brook	 fi
53a992fe3dSPaul Brook
54a992fe3dSPaul Brookdefconfig:
55a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
56a992fe3dSPaul Brook
571f3d3c8fSJuan Quintela-include config-all-devices.mak
581215c6e7SJuan Quintela
59f527c579SJuan Quintelabuild-all: $(DOCS) $(TOOLS) recurse-all
60b9dea4fbSpbrook
611215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
621215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
631215c6e7SJuan Quintela
64cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
65cec7d0b6Spbrook
66f527c579SJuan Quintelasubdir-%: $(GENERATED_HEADERS)
670087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
684aa42531Spbrook
69cec7d0b6Spbrook$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
70c05ac895SPaul Brook
71add16157SBlue Swirl$(filter %-user,$(SUBDIR_RULES)): libuser.a
72add16157SBlue Swirl
73*c1bb0dceSJuergen Locklibuser.a: $(GENERATED_HEADERS)
746a8a2803SBlue Swirl	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libuser V="$(V)" TARGET_DIR="libuser/" all,)
75add16157SBlue Swirl
76c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
77c05ac895SPaul Brookromsubdir-%:
78c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
79c05ac895SPaul Brook
80c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
81c05ac895SPaul Brook
82c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
834aa42531Spbrook
84faf07963Spbrook#######################################################################
852a01000fSLuiz Capitulino# QObject
862a01000fSLuiz Capitulinoqobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o
872a01000fSLuiz Capitulinoqobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o
882a01000fSLuiz Capitulinoqobject-obj-y += qerror.o
892a01000fSLuiz Capitulino
902a01000fSLuiz Capitulino#######################################################################
91319f08eaSJuan Quintela# block-obj-y is code used by both qemu system emulation and qemu-img
92faf07963Spbrook
93319f08eaSJuan Quintelablock-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
94a25a0ef5SAnthony Liguoriblock-obj-y += nbd.o block.o aio.o aes.o osdep.o
954dd75c70SChristoph Hellwigblock-obj-$(CONFIG_POSIX) += posix-aio-compat.o
965c6c3a6cSChristoph Hellwigblock-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
971a65ba76SJuan Quintela
989aebd98aSStefan Weilblock-nested-y += cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
991a65ba76SJuan Quintelablock-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o
1001a65ba76SJuan Quintelablock-nested-y += parallels.o nbd.o
101eeb6d45bSJuan Quintelablock-nested-$(CONFIG_WIN32) += raw-win32.o
102eeb6d45bSJuan Quintelablock-nested-$(CONFIG_POSIX) += raw-posix.o
1031a65ba76SJuan Quintelablock-nested-$(CONFIG_CURL) += curl.o
1041a65ba76SJuan Quintela
1051a65ba76SJuan Quintelablock-obj-y +=  $(addprefix block/, $(block-nested-y))
106769ce76dSAlexander Graf
107e1144d00SMark McLoughlinnet-obj-y = net.o
108f1d078c3SMark McLoughlinnet-nested-y = queue.o checksum.o util.o
10942281ac9SMark McLoughlinnet-nested-y += socket.o
1101abecf77SMark McLoughlinnet-nested-y += dump.o
1115281d757SMark McLoughlinnet-nested-$(CONFIG_POSIX) += tap.o
112c28b1c10SMark McLoughlinnet-nested-$(CONFIG_LINUX) += tap-linux.o
11333ad161aSMark McLoughlinnet-nested-$(CONFIG_WIN32) += tap-win32.o
114e7e92325SMark McLoughlinnet-nested-$(CONFIG_BSD) += tap-bsd.o
115966ea5ecSMark McLoughlinnet-nested-$(CONFIG_SOLARIS) += tap-solaris.o
11688b3ec02SMark McLoughlinnet-nested-$(CONFIG_AIX) += tap-aix.o
11768ac40d2SMark McLoughlinnet-nested-$(CONFIG_SLIRP) += slirp.o
1185c361cc3SMark McLoughlinnet-nested-$(CONFIG_VDE) += vde.o
119e1144d00SMark McLoughlinnet-obj-y += $(addprefix net/, $(net-nested-y))
120e1144d00SMark McLoughlin
1214fb240a4Sbellard######################################################################
1222e2ea909Sbellard# libqemu_common.a: Target independent part of system emulation. The
1234fb240a4Sbellard# long term path is to suppress *all* target specific code in case of
1244fb240a4Sbellard# system emulation, i.e. a single QEMU executable should support all
1254fb240a4Sbellard# CPUs and machines.
12647cea614Sbellard
1276ef859b3SJuan Quintelaobj-y = $(block-obj-y)
128e1144d00SMark McLoughlinobj-y += $(net-obj-y)
1292a01000fSLuiz Capitulinoobj-y += $(qobject-obj-y)
13034005a00SKirill A. Shutemovobj-y += readline.o console.o
131cd01b4a3Saliguori
132c2b023b6SBlue Swirlobj-y += tcg-runtime.o host-utils.o
1335f74377cSJuan Quintelaobj-y += irq.o ioport.o
1345f74377cSJuan Quintelaobj-$(CONFIG_PTIMER) += ptimer.o
135ae573db3SJuan Quintelaobj-$(CONFIG_MAX7310) += max7310.o
136976ca9abSJuan Quintelaobj-$(CONFIG_WM8750) += wm8750.o
13792eb6b4eSJuan Quintelaobj-$(CONFIG_TWL92230) += twl92230.o
1383c848e2aSJuan Quintelaobj-$(CONFIG_TSC2005) += tsc2005.o
13903aba0e3SJuan Quintelaobj-$(CONFIG_LM832X) += lm832x.o
140d9b44620SJuan Quintelaobj-$(CONFIG_TMP105) += tmp105.o
1414aa5b83fSJuan Quintelaobj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
1426a559be5SJuan Quintelaobj-$(CONFIG_SSD0303) += ssd0303.o
14354bcf074SJuan Quintelaobj-$(CONFIG_SSD0323) += ssd0323.o
14420a4afc4SJuan Quintelaobj-$(CONFIG_ADS7846) += ads7846.o
145ee99ca01SJuan Quintelaobj-$(CONFIG_MAX111X) += max111x.o
1461dfe3943SPaul Brookobj-$(CONFIG_DS1338) += ds1338.o
147ee99ca01SJuan Quintelaobj-y += i2c.o smbus.o smbus_eeprom.o
148d9b44620SJuan Quintelaobj-y += eeprom93xx.o
1496ef859b3SJuan Quintelaobj-y += scsi-disk.o cdrom.o
150d52affa7SGerd Hoffmannobj-y += scsi-generic.o scsi-bus.o
1516ef859b3SJuan Quintelaobj-y += usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
152806b6024SGerd Hoffmannobj-y += usb-serial.o usb-net.o usb-bus.o
153c62c4551SJuan Quintelaobj-$(CONFIG_SSI) += ssi.o
15493a60400SJuan Quintelaobj-$(CONFIG_SSI_SD) += ssi-sd.o
155b21fd8e6SJuan Quintelaobj-$(CONFIG_SD) += sd.o
1566ef859b3SJuan Quintelaobj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
1576ef859b3SJuan Quintelaobj-y += bt-hci-csr.o
158f7105843SMark McLoughlinobj-y += buffered_file.o migration.o migration-tcp.o qemu-sockets.o
1597200ac3cSMark McLoughlinobj-y += qemu-char.o aio.o savevm.o
1606ef859b3SJuan Quintelaobj-y += msmouse.o ps2.o
161c62c4551SJuan Quintelaobj-y += qdev.o qdev-properties.o
162ec072cedSAnthony Liguoriobj-y += qemu-config.o block-migration.o
16387ecb68bSpbrook
1640e22fd2fSJuan Quintelaobj-$(CONFIG_BRLAPI) += baum.o
1655ac1fad3SPaolo Bonziniobj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
1664fb240a4Sbellard
16798b068a9SJuan Quintelaaudio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
1680e22fd2fSJuan Quintela
1690e22fd2fSJuan Quintelaaudio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
1700e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_SDL) += sdlaudio.o
1710e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_OSS) += ossaudio.o
1720e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_COREAUDIO) += coreaudio.o
1730e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_ALSA) += alsaaudio.o
1740e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_DSOUND) += dsoundaudio.o
1750e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_FMOD) += fmodaudio.o
1760e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_ESD) += esdaudio.o
1770e22fd2fSJuan Quintelaaudio-obj-$(CONFIG_PA) += paaudio.o
178d5631638Smalcaudio-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
17967f86e8eSJuan Quintelaaudio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
180d5631638Smalcaudio-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
181eda959bdSJuan Quintelaaudio-obj-y += wavcapture.o
1826ef859b3SJuan Quintelaobj-y += $(addprefix audio/, $(audio-obj-y))
1834fb240a4Sbellard
1846ef859b3SJuan Quintelaobj-y += keymaps.o
1850e22fd2fSJuan Quintelaobj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
1860e22fd2fSJuan Quintelaobj-$(CONFIG_CURSES) += curses.o
1876ef859b3SJuan Quintelaobj-y += vnc.o acl.o d3des.o
1880e22fd2fSJuan Quintelaobj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
1890e22fd2fSJuan Quintelaobj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
1900e22fd2fSJuan Quintelaobj-$(CONFIG_COCOA) += cocoa.o
1910e22fd2fSJuan Quintelaobj-$(CONFIG_IOTHREAD) += qemu-thread.o
192e5d355d1Saliguori
193f835ed1cSJuan Quintelaslirp-obj-y = cksum.o if.o ip_icmp.o ip_input.o ip_output.o
194f835ed1cSJuan Quintelaslirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
195f835ed1cSJuan Quintelaslirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o
1960e22fd2fSJuan Quintelaobj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
1974fb240a4Sbellard
1982567f579SBlue Swirl# xen backend driver support
1990e22fd2fSJuan Quintelaobj-$(CONFIG_XEN) += xen_backend.o xen_devconfig.o
2000e22fd2fSJuan Quintelaobj-$(CONFIG_XEN) += xen_console.o xenfb.o xen_disk.o xen_nic.o
2012567f579SBlue Swirl
202a558ee17SJuan QuintelaQEMU_CFLAGS+=$(CURL_CFLAGS)
203769ce76dSAlexander Graf
2044fb240a4Sbellardcocoa.o: cocoa.m
2054fb240a4Sbellard
2060483755aSaliguorikeymaps.o: keymaps.c keymaps.h
2070483755aSaliguori
208c18a2c36SStefano Stabellinisdl_zoom.o: sdl_zoom.c sdl_zoom.h sdl_zoom_template.h
209c18a2c36SStefano Stabellini
210c18a2c36SStefano Stabellinisdl.o: sdl.c keymaps.h sdl_keysym.h sdl_zoom.h
211807544e2Saliguori
212a558ee17SJuan Quintelasdl.o audio/sdlaudio.o sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
2134fb240a4Sbellard
21476655d6dSaliguoriacl.o: acl.h acl.c
21576655d6dSaliguori
2162f9606b3Saliguorivnc.h: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
2175fb6c7a8Saliguori
21876655d6dSaliguorivnc.o: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
219807544e2Saliguori
220a558ee17SJuan Quintelavnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
2214fb240a4Sbellard
2225fb6c7a8Saliguorivnc-tls.o: vnc-tls.c vnc.h
2235fb6c7a8Saliguori
2245fb6c7a8Saliguorivnc-auth-vencrypt.o: vnc-auth-vencrypt.c vnc.h
2255fb6c7a8Saliguori
2262f9606b3Saliguorivnc-auth-sasl.o: vnc-auth-sasl.c vnc.h
2272f9606b3Saliguori
2280483755aSaliguoricurses.o: curses.c keymaps.h curses_keys.h
2294d3b6f6eSbalrog
230a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
2314fb240a4Sbellard
2326ef859b3SJuan Quintelalibqemu_common.a: $(obj-y)
2334fb240a4Sbellard
2344fb240a4Sbellard######################################################################
2354fb240a4Sbellard
236a73e8e43SStefan Weilqemu-img.o: qemu-img-cmds.h
237153859beSStuart Brady
238d15e5465SLuiz Capitulinoqemu-img$(EXESUF): qemu-img.o qemu-tool.o $(block-obj-y) $(qobject-obj-y)
2394fb240a4Sbellard
240d15e5465SLuiz Capitulinoqemu-nbd$(EXESUF):  qemu-nbd.o qemu-tool.o $(block-obj-y) $(qobject-obj-y)
2413aa892d7Saliguori
242d15e5465SLuiz Capitulinoqemu-io$(EXESUF):  qemu-io.o qemu-tool.o cmd.o $(block-obj-y) $(qobject-obj-y)
2430a8e1acdSaliguori
244153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
245153859beSStuart Brady	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $@")
246153859beSStuart Brady
24733837ba6SLuiz Capitulinocheck-qint: check-qint.o qint.o qemu-malloc.o
2485de65a07SLuiz Capitulinocheck-qstring: check-qstring.o qstring.o qemu-malloc.o
249f2e17508SLuiz Capitulinocheck-qdict: check-qdict.o qdict.o qint.o qstring.o qbool.o qemu-malloc.o qlist.o
2503aa3dcffSLuiz Capitulinocheck-qlist: check-qlist.o qlist.o qint.o qemu-malloc.o
2519c9efb6bSAnthony Liguoricheck-qfloat: check-qfloat.o qfloat.o qemu-malloc.o
252422c46a8SAnthony Liguoricheck-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
25333837ba6SLuiz Capitulino
25431e31b8aSbellardclean:
2552d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
25625be210fSJuan Quintela	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
25786e840eeSaurel32	rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~
258e1144d00SMark McLoughlin	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d
25907b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
2607d3505c5Sbellard	$(MAKE) -C tests clean
261add16157SBlue Swirl	for d in $(ALL_SUBDIRS) libhw32 libhw64 libuser; do \
262fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
263626df76aSbellard        done
26431e31b8aSbellard
2657d13299dSbellarddistclean: clean
266fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
267a992fe3dSPaul Brook	rm -f config-all-devices.mak
268fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
2690cb3fb1eSpbrook	rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
270add16157SBlue Swirl	for d in $(TARGET_DIRS) libhw32 libhw64 libuser; do \
271bc1b050dSbellard	rm -rf $$d || exit 1 ; \
27276bc6838Sbellard        done
2737d13299dSbellard
274fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
275fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
276fed4a9adSbellardcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
277fed4a9adSbellard
27877755340Sthsifdef INSTALL_BLOBS
27977755340SthsBLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
280e5d01b06Saurel32video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
28188e2b0a5SStefan Weilpxe-e1000.bin pxe-i82559er.bin \
28288e2b0a5SStefan Weilpxe-ne2k_pci.bin pxe-pcnet.bin \
28388e2b0a5SStefan Weilpxe-rtl8139.bin pxe-virtio.bin \
284253d0942SAlexander Grafbamboo.dtb petalogix-s3adsp1800.dtb \
285cfc6d90aSAlexander Grafmultiboot.bin linuxboot.bin
28677755340Sthselse
28777755340SthsBLOBS=
28877755340Sthsendif
28977755340Sths
29038954dcaSpbrookinstall-doc: $(DOCS)
29158f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
29258f8aeadSaliguori	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
29396d409ebSJuan Quintelaifdef CONFIG_POSIX
29458f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
29558f8aeadSaliguori	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
29658f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
29758f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
29838954dcaSpbrookendif
29938954dcaSpbrook
30038954dcaSpbrookinstall: all $(if $(BUILD_DOCS),install-doc)
30158f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
302932a79dfSthsifneq ($(TOOLS),)
30358f8aeadSaliguori	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
304932a79dfSthsendif
30577755340Sthsifneq ($(BLOBS),)
30658f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
30777755340Sths	set -e; for x in $(BLOBS); do \
30858f8aeadSaliguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
309ad064840Spbrook	done
31077755340Sthsendif
31158f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
31218be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
31379fd42aaSAnthony Liguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
314ad064840Spbrook	done
315626df76aSbellard	for d in $(TARGET_DIRS); do \
3167d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
317626df76aSbellard        done
318612384d7Sbellard
319367e86e8Sbellard# various test targets
3209b0b8203Sbellardtest speed: all
3217d3505c5Sbellard	$(MAKE) -C tests $@
32231e31b8aSbellard
32321d4e8e3SAlexandre Bique.PHONY: TAGS
324367e86e8SbellardTAGS:
32521d4e8e3SAlexandre Bique	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
32631e31b8aSbellard
3276688bc6dSbellardcscope:
3286688bc6dSbellard	rm -f ./cscope.*
329ede46085Saurel32	find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files
3306688bc6dSbellard	cscope -b
3316688bc6dSbellard
3323ef693a0Sbellard# documentation
3331f673135Sbellard%.html: %.texi
3340d00e563Saliguori	$(call quiet-command,texi2html -I=. -monolithic -number $<,"  GEN   $@")
3353ef693a0Sbellard
336f3548328Sbellard%.info: %.texi
3370d00e563Saliguori	$(call quiet-command,makeinfo -I . $< -o $@,"  GEN   $@")
338f3548328Sbellard
339f3548328Sbellard%.dvi: %.texi
3400d00e563Saliguori	$(call quiet-command,texi2dvi -I . $<,"  GEN   $@")
3415824d651Sblueswir1
3425824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
3430d00e563Saliguori	$(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
344f3548328Sbellard
3452313086aSBlue Swirlqemu-monitor.texi: $(SRC_PATH)/qemu-monitor.hx
3462313086aSBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
3472313086aSBlue Swirl
348153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
349153859beSStuart Brady	$(call quiet-command,sh $(SRC_PATH)/hxtool -t < $< > $@,"  GEN   $@")
350153859beSStuart Brady
3512313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
3520d00e563Saliguori	$(call quiet-command, \
3530d00e563Saliguori	  perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu.pod && \
3540d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
3550d00e563Saliguori	  "  GEN   $@")
3565a67135aSbellard
357153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
3580d00e563Saliguori	$(call quiet-command, \
3590d00e563Saliguori	  perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-img.pod && \
3600d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
3610d00e563Saliguori	  "  GEN   $@")
362acd935efSbellard
3637a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
3640d00e563Saliguori	$(call quiet-command, \
3650d00e563Saliguori	  perl -Ww -- $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod && \
3660d00e563Saliguori	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
3670d00e563Saliguori	  "  GEN   $@")
3687a5ca864Sbellard
3690cb3fb1eSpbrookinfo: qemu-doc.info qemu-tech.info
3700cb3fb1eSpbrook
3710cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
3720cb3fb1eSpbrook
3730cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
3740cb3fb1eSpbrook
375153859beSStuart Bradyqemu-doc.dvi qemu-doc.html qemu-doc.info: qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-monitor.texi qemu-img-cmds.texi
376818220f5Saliguori
377df5cf721SthsVERSION ?= $(shell cat VERSION)
378df5cf721SthsFILE = qemu-$(VERSION)
379586314f2Sbellard
3801e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
381586314f2Sbellardtar:
382586314f2Sbellard	rm -rf /tmp/$(FILE)
3831e43adfcSbellard	cp -r . /tmp/$(FILE)
38499c6c082Saurel32	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
385586314f2Sbellard	rm -rf /tmp/$(FILE)
386586314f2Sbellard
38776b62fd0Sbellard# generate a binary distribution
388d691f669Sbellardtarbin:
38918be8d77Sblueswir1	cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
39043095f31Sbellard	$(bindir)/qemu \
39143095f31Sbellard	$(bindir)/qemu-system-x86_64 \
39240e8a53bSaurel32	$(bindir)/qemu-system-arm \
39340e8a53bSaurel32	$(bindir)/qemu-system-cris \
39440e8a53bSaurel32	$(bindir)/qemu-system-m68k \
395bc6291a1SEdgar E. Iglesias	$(bindir)/qemu-system-microblaze \
39693856aacSbellard	$(bindir)/qemu-system-mips \
39738260998Spbrook	$(bindir)/qemu-system-mipsel \
398fbe4f65bSths	$(bindir)/qemu-system-mips64 \
399fbe4f65bSths	$(bindir)/qemu-system-mips64el \
40040e8a53bSaurel32	$(bindir)/qemu-system-ppc \
40140e8a53bSaurel32	$(bindir)/qemu-system-ppcemb \
40240e8a53bSaurel32	$(bindir)/qemu-system-ppc64 \
403ff1aaf65Sths	$(bindir)/qemu-system-sh4 \
40485ffbdfcSths	$(bindir)/qemu-system-sh4eb \
40540e8a53bSaurel32	$(bindir)/qemu-system-sparc \
4067efa4387Sbellard	$(bindir)/qemu-i386 \
407f0403c03Sbellard	$(bindir)/qemu-x86_64 \
40840e8a53bSaurel32	$(bindir)/qemu-alpha \
4097efa4387Sbellard	$(bindir)/qemu-arm \
410ea31eb5bSbellard	$(bindir)/qemu-armeb \
41140e8a53bSaurel32	$(bindir)/qemu-cris \
41240e8a53bSaurel32	$(bindir)/qemu-m68k \
413bc6291a1SEdgar E. Iglesias	$(bindir)/qemu-microblaze \
41440e8a53bSaurel32	$(bindir)/qemu-mips \
41540e8a53bSaurel32	$(bindir)/qemu-mipsel \
4167efa4387Sbellard	$(bindir)/qemu-ppc \
417d4082e95Sj_mayer	$(bindir)/qemu-ppc64 \
418f0403c03Sbellard	$(bindir)/qemu-ppc64abi32 \
419ff1aaf65Sths	$(bindir)/qemu-sh4 \
42085ffbdfcSths	$(bindir)/qemu-sh4eb \
42140e8a53bSaurel32	$(bindir)/qemu-sparc \
42240e8a53bSaurel32	$(bindir)/qemu-sparc64 \
42340e8a53bSaurel32	$(bindir)/qemu-sparc32plus \
424b932cabaSbellard	$(bindir)/qemu-img \
4257a5ca864Sbellard	$(bindir)/qemu-nbd \
4267efa4387Sbellard	$(datadir)/bios.bin \
4277efa4387Sbellard	$(datadir)/vgabios.bin \
428de9258a8Sbellard	$(datadir)/vgabios-cirrus.bin \
429637f6cd7Sbellard	$(datadir)/ppc_rom.bin \
430d5295253Sbellard	$(datadir)/video.x \
4310986ac3bSbellard	$(datadir)/openbios-sparc32 \
432938255d2Sblueswir1	$(datadir)/openbios-sparc64 \
433e5d01b06Saurel32	$(datadir)/openbios-ppc \
43419c80e50Sbellard	$(datadir)/pxe-ne2k_pci.bin \
43519c80e50Sbellard	$(datadir)/pxe-rtl8139.bin \
43619c80e50Sbellard	$(datadir)/pxe-pcnet.bin \
4372991990bSaliguori	$(datadir)/pxe-e1000.bin \
4381f50f8d1Sbellard	$(docdir)/qemu-doc.html \
4391f50f8d1Sbellard	$(docdir)/qemu-tech.html \
44040e8a53bSaurel32	$(mandir)/man1/qemu.1 \
44140e8a53bSaurel32	$(mandir)/man1/qemu-img.1 \
4427a5ca864Sbellard	$(mandir)/man8/qemu-nbd.8
443d691f669Sbellard
4444fb240a4Sbellard# Include automatically generated dependency files
445e1144d00SMark McLoughlin-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d)
446