xref: /openbmc/qemu/Makefile (revision 187c207d)
10cb3fb1eSpbrook# Makefile for QEMU.
20cb3fb1eSpbrook
3519e1693SStefan Weil# Always point to the root of the build tree (needs GNU make).
4519e1693SStefan WeilBUILD_DIR=$(CURDIR)
5388d4758SLluís Vilanova
6df2943baSMichael S. TsirkinGENERATED_HEADERS = config-host.h trace.h qemu-options.def
7b3d08c02SDaniel P. Berrangeifeq ($(TRACE_BACKEND),dtrace)
8b3d08c02SDaniel P. BerrangeGENERATED_HEADERS += trace-dtrace.h
9b3d08c02SDaniel P. Berrangeendif
10e3193601SAnthony LiguoriGENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
11611b7273SMichael S. TsirkinGENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
12f527c579SJuan Quintela
1355d7e8f6Saurel32ifneq ($(wildcard config-host.mak),)
141ad2134fSPaul Brook# Put the all: rule here so that config-host.mak can contain dependencies.
151ad2134fSPaul Brookall: build-all
16ad064840Spbrookinclude config-host.mak
1717759187Saliguoriinclude $(SRC_PATH)/rules.mak
1859bc10eeSPaolo Bonziniconfig-host.mak: $(SRC_PATH)/configure
19e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
20e5efe7f5SJuan Quintela	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
2155d7e8f6Saurel32else
2255d7e8f6Saurel32config-host.mak:
2355d7e8f6Saurel32	@echo "Please call configure before running make!"
2455d7e8f6Saurel32	@exit 1
2555d7e8f6Saurel32endif
26766a487aSbellard
27d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
28d9ace8b3SJuan Quintela# We don't generate any of them
29d9ace8b3SJuan QuintelaMakefile: ;
30d9ace8b3SJuan Quintelaconfigure: ;
31d9ace8b3SJuan Quintela
32818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
3320cc9997SStefan Weil	pdf recurse-all speed tar tarbin test build-all
340cb3fb1eSpbrook
35076d2471SPaolo Bonzini$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
368c462f8fSpbrook
373e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
3867c0f08dSJuan Quintela
397b93fadfSCorey BryantHELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
407b93fadfSCorey Bryant
41cc8ae6deSpbrookifdef BUILD_DOCS
42b40292e7SJan KiszkaDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
43a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1
44cc8ae6deSpbrookelse
45cc8ae6deSpbrookDOCS=
46cc8ae6deSpbrookendif
477d13299dSbellard
48388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
491f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
50bd9141bbSPaul BrookSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
511f3d3c8fSJuan Quintela
521f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
5301d86a85SStefan Weil	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
541f3d3c8fSJuan Quintela
55bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
56bd9141bbSPaul Brook
57a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
584c3b5a48SBlue Swirl	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
59a992fe3dSPaul Brook	@if test -f $@; then \
60904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
61012f0879SStefan Weil	    mv $@.tmp $@; \
62012f0879SStefan Weil	    cp -p $@ $@.old; \
63012f0879SStefan Weil	  else \
64012f0879SStefan Weil	    if test -f $@.old; then \
65012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
66012f0879SStefan Weil	    else \
67a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
68012f0879SStefan Weil	    fi; \
6963e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
70a992fe3dSPaul Brook	    rm $@.tmp; \
71012f0879SStefan Weil	  fi; \
72a992fe3dSPaul Brook	 else \
73a992fe3dSPaul Brook	  mv $@.tmp $@; \
74012f0879SStefan Weil	  cp -p $@ $@.old; \
75a992fe3dSPaul Brook	 fi
76a992fe3dSPaul Brook
77a992fe3dSPaul Brookdefconfig:
78a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
79a992fe3dSPaul Brook
801f3d3c8fSJuan Quintela-include config-all-devices.mak
811215c6e7SJuan Quintela
827b93fadfSCorey Bryantbuild-all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
83b9dea4fbSpbrook
841215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
851215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
86e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
874c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
881215c6e7SJuan Quintela
89cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
90cec7d0b6Spbrook
91f527c579SJuan Quintelasubdir-%: $(GENERATED_HEADERS)
920087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
934aa42531Spbrook
94b88bc808SStefan Weilifneq ($(wildcard config-host.mak),)
950e8c9214SAndreas Färberinclude $(SRC_PATH)/Makefile.objs
96b88bc808SStefan Weilendif
970e8c9214SAndreas Färber
980e8c9214SAndreas Färber$(common-obj-y): $(GENERATED_HEADERS)
9941a74826SAnthony Liguorisubdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
1006774e44aSPaolo Bonzini
10191f16900SAndreas Färber$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
102c05ac895SPaul Brook
10391f16900SAndreas Färber$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
104add16157SBlue Swirl
105c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
106c05ac895SPaul Brookromsubdir-%:
107c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
108c05ac895SPaul Brook
109c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
110c05ac895SPaul Brook
111c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
1124aa42531Spbrook
11398b068a9SJuan Quintelaaudio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
1140e22fd2fSJuan Quintela
115a558ee17SJuan QuintelaQEMU_CFLAGS+=$(CURL_CFLAGS)
116769ce76dSAlexander Graf
1172f28d2ffSAnthony LiguoriQEMU_CFLAGS += -I$(SRC_PATH)/include
1182f28d2ffSAnthony Liguori
1193e230dd2SCorentin Charyui/cocoa.o: ui/cocoa.m
1204fb240a4Sbellard
1213e230dd2SCorentin Charyui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
1220483755aSaliguori
1233e230dd2SCorentin Charyui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
1244d3b6f6eSbalrog
125a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
1264fb240a4Sbellard
1277948a665SBlue Swirlversion.o: $(SRC_PATH)/version.rc config-host.h
1289fe6de94SBlue Swirl	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
1299fe6de94SBlue Swirl
1309fe6de94SBlue Swirlversion-obj-$(CONFIG_WIN32) += version.o
1314fb240a4Sbellard######################################################################
13244dc0ca3SAlon Levy# Support building shared library libcacard
13344dc0ca3SAlon Levy
13444dc0ca3SAlon Levy.PHONY: libcacard.la install-libcacard
13544dc0ca3SAlon Levyifeq ($(LIBTOOL),)
13644dc0ca3SAlon Levylibcacard.la:
13744dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
13844dc0ca3SAlon Levy
13944dc0ca3SAlon Levyinstall-libcacard:
14044dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
14144dc0ca3SAlon Levyelse
14292f562ecSAnthony Liguorilibcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
14344dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
14444dc0ca3SAlon Levy
14544dc0ca3SAlon Levyinstall-libcacard: libcacard.la
14644dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
14744dc0ca3SAlon Levyendif
14844dc0ca3SAlon Levy######################################################################
1494fb240a4Sbellard
1503c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
15148ff7a62SMichael Rothqemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
152153859beSStuart Brady
153cbcfa041SPaolo Bonzinitools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
154cbcfa041SPaolo Bonzini	qemu-timer-common.o main-loop.o notify.o iohandler.o cutils.o async.o
155cbcfa041SPaolo Bonzinitools-obj-$(CONFIG_POSIX) += compatfd.o
1564fb240a4Sbellard
1574ab328d6SPaolo Bonziniqemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y)
1584ab328d6SPaolo Bonziniqemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
1594ab328d6SPaolo Bonziniqemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
1600a8e1acdSaliguori
1617b93fadfSCorey Bryantqemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
162*187c207dSPeter Maydellqemu-bridge-helper.o: $(GENERATED_HEADERS)
1637b93fadfSCorey Bryant
164ea75fc4eSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
16517bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
16617bff52bSM. Mohan Kumar
167153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
1684c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
169153859beSStuart Brady
170640e5404SMichael Roth$(qapi-obj-y): $(GENERATED_HEADERS)
1719b129408SMichael Rothqapi-dir := $(BUILD_DIR)/qapi-generated
172957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
173640e5404SMichael Roth
17419bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@))
1758d3bc517SAvi Kivity
176e454e2e2SAndreas Färberifneq ($(wildcard config-host.mak),)
177dbfe06c6SAnthony Liguoriinclude $(SRC_PATH)/tests/Makefile
178e454e2e2SAndreas Färberendif
179640e5404SMichael Roth
180599825c5SMichael S. Tsirkin$(qapi-dir)/qga-qapi-types.c $(qapi-dir)/qga-qapi-types.h :\
181599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
1828d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
183599825c5SMichael S. Tsirkin$(qapi-dir)/qga-qapi-visit.c $(qapi-dir)/qga-qapi-visit.h :\
184599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
1858d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
186599825c5SMichael S. Tsirkin$(qapi-dir)/qga-qmp-commands.h $(qapi-dir)/qga-qmp-marshal.c :\
187599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
1888d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
189e3d4d252SMichael Roth
190599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\
191599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
1928d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
193599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\
194599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py
1958d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
196599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\
197599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
1988d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
199e3193601SAnthony Liguori
2001b14254bSMichael S. TsirkinQGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
2011b14254bSMichael S. TsirkinQGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
2021b14254bSMichael S. Tsirkin$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
2031b14254bSMichael S. Tsirkin$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
204957f1f99SMichael Roth
2051b14254bSMichael S. Tsirkinqemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
20648ff7a62SMichael Roth
207111a38b0SRobert RelyeaQEMULIBS=libhw32 libhw64 libuser libdis libdis-user
208111a38b0SRobert Relyea
20931e31b8aSbellardclean:
2102d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
21125be210fSJuan 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
212df2943baSMichael S. Tsirkin	rm -f qemu-options.def
2137b93fadfSCorey Bryant	rm -f *.o *.d *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
21444dc0ca3SAlon Levy	rm -Rf .libs
21513a286d5SMichael Roth	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 qapi/*.o qapi/*.d qga/*.o qga/*.d
21607b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
217edb47ec4SLluís	rm -f trace/*.o trace/*.d
218d7489b72SBlue Swirl	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
219b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
220b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.h trace-dtrace.h-timestamp
221dcfa4868SAndreas Färber	rm -f $(GENERATED_HEADERS)
222611b7273SMichael S. Tsirkin	rm -f $(GENERATED_SOURCES)
223640e5404SMichael Roth	rm -rf $(qapi-dir)
224c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg clean
225111a38b0SRobert Relyea	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
226fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
227df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
228626df76aSbellard        done
22931e31b8aSbellard
2307d13299dSbellarddistclean: clean
231fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
232a992fe3dSPaul Brook	rm -f config-all-devices.mak
233fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
2347a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
2357a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
2367a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
2377a734b8fSBrad Hards	rm -f qemu-doc.vr
238793553acSAlexandre Raymond	rm -f config.log
23967ed96f9SPeter Maydell	rm -f linux-headers/asm
240e1a068b2SHidetoshi Seto	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
241111a38b0SRobert Relyea	for d in $(TARGET_DIRS) $(QEMULIBS); do \
242bc1b050dSbellard	rm -rf $$d || exit 1 ; \
24376bc6838Sbellard        done
2447d13299dSbellard
245fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
246fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
247fed4a9adSbellardcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
248fed4a9adSbellard
24977755340Sthsifdef INSTALL_BLOBS
2506329866fSPaolo BonziniBLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
2517943a2faSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
2523b3d448eSGerd Hoffmannppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
2535ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
2545ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
25500914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
256fbd659b7SAlexander Grafmpc8544ds.dtb \
257fe270d04SAlexander Grafmultiboot.bin linuxboot.bin \
25839ac8455SDavid Gibsons390-zipl.rom \
259753d11f2SRichard Hendersonspapr-rtas.bin slof.bin \
260753d11f2SRichard Hendersonpalcode-clipper
26177755340Sthselse
26277755340SthsBLOBS=
26377755340Sthsendif
26477755340Sths
26538954dcaSpbrookinstall-doc: $(DOCS)
26658f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
26758f8aeadSaliguori	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
26896d409ebSJuan Quintelaifdef CONFIG_POSIX
26958f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
27058f8aeadSaliguori	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
27158f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
27258f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
27338954dcaSpbrookendif
274a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
275a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
276a2d8f1beSM. Mohan Kumar	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
277a2d8f1beSM. Mohan Kumarendif
278b5ec5ce0Sjohn cooperinstall-sysconfig:
279990caaf1SAndre Przywara	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
280990caaf1SAndre Przywara	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
281b5ec5ce0Sjohn cooper
282b5ec5ce0Sjohn cooperinstall: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
28358f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
284932a79dfSthsifneq ($(TOOLS),)
28558f8aeadSaliguori	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
286932a79dfSthsendif
2877b93fadfSCorey Bryantifneq ($(HELPERS-y),)
2887b93fadfSCorey Bryant	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
2897b93fadfSCorey Bryant	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
2907b93fadfSCorey Bryantendif
29177755340Sthsifneq ($(BLOBS),)
29258f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
29377755340Sths	set -e; for x in $(BLOBS); do \
29458f8aeadSaliguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
295ad064840Spbrook	done
29677755340Sthsendif
29758f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
29818be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
29979fd42aaSAnthony Liguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
300ad064840Spbrook	done
301626df76aSbellard	for d in $(TARGET_DIRS); do \
3027d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
303626df76aSbellard        done
304612384d7Sbellard
305367e86e8Sbellard# various test targets
3069b0b8203Sbellardtest speed: all
307c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg $@
30831e31b8aSbellard
30921d4e8e3SAlexandre Bique.PHONY: TAGS
310367e86e8SbellardTAGS:
31121d4e8e3SAlexandre Bique	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
31231e31b8aSbellard
3136688bc6dSbellardcscope:
3146688bc6dSbellard	rm -f ./cscope.*
31545b75ae4SAlexandre Raymond	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
3166688bc6dSbellard	cscope -b
3176688bc6dSbellard
3183ef693a0Sbellard# documentation
31901668d98SStefan WeilMAKEINFO=makeinfo
32001668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
32120cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
32220cc9997SStefan Weil%.dvi: %.texi
32320cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
32420cc9997SStefan Weil
3251f673135Sbellard%.html: %.texi
32601668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
32701668d98SStefan Weil	"  GEN   $@")
3283ef693a0Sbellard
329f3548328Sbellard%.info: %.texi
33001668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
331f3548328Sbellard
33220cc9997SStefan Weil%.pdf: %.texi
33320cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
3345824d651Sblueswir1
3355824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
3364c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
337f3548328Sbellard
338acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
3394c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
3402313086aSBlue Swirl
34182a56f0dSLuiz CapitulinoQMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
3424c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
343b40292e7SJan Kiszka
344153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
3454c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
346153859beSStuart Brady
3472313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
3480d00e563Saliguori	$(call quiet-command, \
3494c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
3500d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
3510d00e563Saliguori	  "  GEN   $@")
3525a67135aSbellard
353153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
3540d00e563Saliguori	$(call quiet-command, \
3554c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
3560d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
3570d00e563Saliguori	  "  GEN   $@")
358acd935efSbellard
359a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
360a2d8f1beSM. Mohan Kumar	$(call quiet-command, \
361a2d8f1beSM. Mohan Kumar	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
362a2d8f1beSM. Mohan Kumar	  pod2man --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
363a2d8f1beSM. Mohan Kumar	  "  GEN   $@")
364a2d8f1beSM. Mohan Kumar
3657a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
3660d00e563Saliguori	$(call quiet-command, \
3674c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
3680d00e563Saliguori	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
3690d00e563Saliguori	  "  GEN   $@")
3707a5ca864Sbellard
3710cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
3720cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
37320cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
37420cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
3750cb3fb1eSpbrook
37620cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
37720cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
37820cc9997SStefan Weil	qemu-monitor.texi qemu-img-cmds.texi
379818220f5Saliguori
380df5cf721SthsVERSION ?= $(shell cat VERSION)
381df5cf721SthsFILE = qemu-$(VERSION)
382586314f2Sbellard
3831e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
384586314f2Sbellardtar:
385586314f2Sbellard	rm -rf /tmp/$(FILE)
3861e43adfcSbellard	cp -r . /tmp/$(FILE)
38799c6c082Saurel32	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
388586314f2Sbellard	rm -rf /tmp/$(FILE)
389586314f2Sbellard
3904fb240a4Sbellard# Include automatically generated dependency files
39148ff7a62SMichael Roth-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
392