xref: /openbmc/qemu/Makefile (revision e454e2e2)
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
39cc8ae6deSpbrookifdef BUILD_DOCS
40b40292e7SJan KiszkaDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
41a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1
42cc8ae6deSpbrookelse
43cc8ae6deSpbrookDOCS=
44cc8ae6deSpbrookendif
457d13299dSbellard
46388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
471f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
48bd9141bbSPaul BrookSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
491f3d3c8fSJuan Quintela
501f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
5101d86a85SStefan Weil	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
521f3d3c8fSJuan Quintela
53bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
54bd9141bbSPaul Brook
55a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
564c3b5a48SBlue Swirl	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
57a992fe3dSPaul Brook	@if test -f $@; then \
58904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
59012f0879SStefan Weil	    mv $@.tmp $@; \
60012f0879SStefan Weil	    cp -p $@ $@.old; \
61012f0879SStefan Weil	  else \
62012f0879SStefan Weil	    if test -f $@.old; then \
63012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
64012f0879SStefan Weil	    else \
65a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
66012f0879SStefan Weil	    fi; \
6763e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
68a992fe3dSPaul Brook	    rm $@.tmp; \
69012f0879SStefan Weil	  fi; \
70a992fe3dSPaul Brook	 else \
71a992fe3dSPaul Brook	  mv $@.tmp $@; \
72012f0879SStefan Weil	  cp -p $@ $@.old; \
73a992fe3dSPaul Brook	 fi
74a992fe3dSPaul Brook
75a992fe3dSPaul Brookdefconfig:
76a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
77a992fe3dSPaul Brook
781f3d3c8fSJuan Quintela-include config-all-devices.mak
791215c6e7SJuan Quintela
80ad65aa88SAnthony Liguoribuild-all: $(DOCS) $(TOOLS) recurse-all
81b9dea4fbSpbrook
821215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
831215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
84e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
854c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
861215c6e7SJuan Quintela
87cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
88cec7d0b6Spbrook
89f527c579SJuan Quintelasubdir-%: $(GENERATED_HEADERS)
900087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
914aa42531Spbrook
92b88bc808SStefan Weilifneq ($(wildcard config-host.mak),)
930e8c9214SAndreas Färberinclude $(SRC_PATH)/Makefile.objs
94b88bc808SStefan Weilendif
950e8c9214SAndreas Färber
960e8c9214SAndreas Färber$(common-obj-y): $(GENERATED_HEADERS)
9741a74826SAnthony Liguorisubdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
986774e44aSPaolo Bonzini
9991f16900SAndreas Färber$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
100c05ac895SPaul Brook
10191f16900SAndreas Färber$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
102add16157SBlue Swirl
103c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
104c05ac895SPaul Brookromsubdir-%:
105c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
106c05ac895SPaul Brook
107c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
108c05ac895SPaul Brook
109c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
1104aa42531Spbrook
11198b068a9SJuan Quintelaaudio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
1120e22fd2fSJuan Quintela
113a558ee17SJuan QuintelaQEMU_CFLAGS+=$(CURL_CFLAGS)
114769ce76dSAlexander Graf
115e18df141SAnthony LiguoriQEMU_CFLAGS+=$(GLIB_CFLAGS)
116e18df141SAnthony Liguori
1173e230dd2SCorentin Charyui/cocoa.o: ui/cocoa.m
1184fb240a4Sbellard
1193e230dd2SCorentin Charyui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
1200483755aSaliguori
1213e230dd2SCorentin Charyui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
1224d3b6f6eSbalrog
123a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
1244fb240a4Sbellard
1257948a665SBlue Swirlversion.o: $(SRC_PATH)/version.rc config-host.h
1269fe6de94SBlue Swirl	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
1279fe6de94SBlue Swirl
1289fe6de94SBlue Swirlversion-obj-$(CONFIG_WIN32) += version.o
1294fb240a4Sbellard######################################################################
13044dc0ca3SAlon Levy# Support building shared library libcacard
13144dc0ca3SAlon Levy
13244dc0ca3SAlon Levy.PHONY: libcacard.la install-libcacard
13344dc0ca3SAlon Levyifeq ($(LIBTOOL),)
13444dc0ca3SAlon Levylibcacard.la:
13544dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
13644dc0ca3SAlon Levy
13744dc0ca3SAlon Levyinstall-libcacard:
13844dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
13944dc0ca3SAlon Levyelse
14092f562ecSAnthony Liguorilibcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
14144dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
14244dc0ca3SAlon Levy
14344dc0ca3SAlon Levyinstall-libcacard: libcacard.la
14444dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
14544dc0ca3SAlon Levyendif
14644dc0ca3SAlon Levy######################################################################
1474fb240a4Sbellard
1483c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
14948ff7a62SMichael Rothqemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
150153859beSStuart Brady
151cbcfa041SPaolo Bonzinitools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
152cbcfa041SPaolo Bonzini	qemu-timer-common.o main-loop.o notify.o iohandler.o cutils.o async.o
153cbcfa041SPaolo Bonzinitools-obj-$(CONFIG_POSIX) += compatfd.o
1544fb240a4Sbellard
1554ab328d6SPaolo Bonziniqemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y)
1564ab328d6SPaolo Bonziniqemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
1574ab328d6SPaolo Bonziniqemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
1580a8e1acdSaliguori
159ea75fc4eSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
16017bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
16117bff52bSM. Mohan Kumar
162153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
1634c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
164153859beSStuart Brady
165640e5404SMichael Roth$(qapi-obj-y): $(GENERATED_HEADERS)
1669b129408SMichael Rothqapi-dir := $(BUILD_DIR)/qapi-generated
167957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
168640e5404SMichael Roth
16919bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@))
1708d3bc517SAvi Kivity
171*e454e2e2SAndreas Färberifneq ($(wildcard config-host.mak),)
172dbfe06c6SAnthony Liguoriinclude $(SRC_PATH)/tests/Makefile
173*e454e2e2SAndreas Färberendif
174640e5404SMichael Roth
175599825c5SMichael S. Tsirkin$(qapi-dir)/qga-qapi-types.c $(qapi-dir)/qga-qapi-types.h :\
176599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
1778d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
178599825c5SMichael S. Tsirkin$(qapi-dir)/qga-qapi-visit.c $(qapi-dir)/qga-qapi-visit.h :\
179599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
1808d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
181599825c5SMichael S. Tsirkin$(qapi-dir)/qga-qmp-commands.h $(qapi-dir)/qga-qmp-marshal.c :\
182599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
1838d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
184e3d4d252SMichael Roth
185599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\
186599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
1878d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
188599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\
189599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py
1908d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
191599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\
192599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
1938d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
194e3193601SAnthony Liguori
1951b14254bSMichael S. TsirkinQGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
1961b14254bSMichael S. TsirkinQGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
1971b14254bSMichael S. Tsirkin$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
1981b14254bSMichael S. Tsirkin$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
199957f1f99SMichael Roth
2001b14254bSMichael S. Tsirkinqemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
20148ff7a62SMichael Roth
202111a38b0SRobert RelyeaQEMULIBS=libhw32 libhw64 libuser libdis libdis-user
203111a38b0SRobert Relyea
20431e31b8aSbellardclean:
2052d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
20625be210fSJuan 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
207df2943baSMichael S. Tsirkin	rm -f qemu-options.def
208ad65aa88SAnthony Liguori	rm -f *.o *.d *.a *.lo $(TOOLS) qemu-ga TAGS cscope.* *.pod *~ */*~
20944dc0ca3SAlon Levy	rm -Rf .libs
21013a286d5SMichael 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
21107b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
212edb47ec4SLluís	rm -f trace/*.o trace/*.d
213d7489b72SBlue Swirl	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
214b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
215b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.h trace-dtrace.h-timestamp
216611b7273SMichael S. Tsirkin	rm -f $(GENERATED_SOURCES)
217640e5404SMichael Roth	rm -rf $(qapi-dir)
218c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg clean
219111a38b0SRobert Relyea	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
220fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
221df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
222626df76aSbellard        done
22331e31b8aSbellard
2247d13299dSbellarddistclean: clean
225fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
226a992fe3dSPaul Brook	rm -f config-all-devices.mak
227fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
2287a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
2297a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
2307a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
2317a734b8fSBrad Hards	rm -f qemu-doc.vr
232793553acSAlexandre Raymond	rm -f config.log
233e1a068b2SHidetoshi 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
234111a38b0SRobert Relyea	for d in $(TARGET_DIRS) $(QEMULIBS); do \
235bc1b050dSbellard	rm -rf $$d || exit 1 ; \
23676bc6838Sbellard        done
2377d13299dSbellard
238fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
239fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
240fed4a9adSbellardcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
241fed4a9adSbellard
24277755340Sthsifdef INSTALL_BLOBS
2436329866fSPaolo BonziniBLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
2447943a2faSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
2453b3d448eSGerd Hoffmannppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
2465ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
2475ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
24800914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
249fbd659b7SAlexander Grafmpc8544ds.dtb \
250fe270d04SAlexander Grafmultiboot.bin linuxboot.bin \
25139ac8455SDavid Gibsons390-zipl.rom \
252753d11f2SRichard Hendersonspapr-rtas.bin slof.bin \
253753d11f2SRichard Hendersonpalcode-clipper
25477755340Sthselse
25577755340SthsBLOBS=
25677755340Sthsendif
25777755340Sths
25838954dcaSpbrookinstall-doc: $(DOCS)
25958f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
26058f8aeadSaliguori	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
26196d409ebSJuan Quintelaifdef CONFIG_POSIX
26258f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
26358f8aeadSaliguori	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
26458f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
26558f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
26638954dcaSpbrookendif
267a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
268a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
269a2d8f1beSM. Mohan Kumar	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
270a2d8f1beSM. Mohan Kumarendif
271b5ec5ce0Sjohn cooperinstall-sysconfig:
272990caaf1SAndre Przywara	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
273990caaf1SAndre Przywara	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
274b5ec5ce0Sjohn cooper
275b5ec5ce0Sjohn cooperinstall: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
27658f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
277932a79dfSthsifneq ($(TOOLS),)
27858f8aeadSaliguori	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
279932a79dfSthsendif
28077755340Sthsifneq ($(BLOBS),)
28158f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
28277755340Sths	set -e; for x in $(BLOBS); do \
28358f8aeadSaliguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
284ad064840Spbrook	done
28577755340Sthsendif
28658f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
28718be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
28879fd42aaSAnthony Liguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
289ad064840Spbrook	done
290626df76aSbellard	for d in $(TARGET_DIRS); do \
2917d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
292626df76aSbellard        done
293612384d7Sbellard
294367e86e8Sbellard# various test targets
2959b0b8203Sbellardtest speed: all
296c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg $@
29731e31b8aSbellard
29821d4e8e3SAlexandre Bique.PHONY: TAGS
299367e86e8SbellardTAGS:
30021d4e8e3SAlexandre Bique	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
30131e31b8aSbellard
3026688bc6dSbellardcscope:
3036688bc6dSbellard	rm -f ./cscope.*
30445b75ae4SAlexandre Raymond	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
3056688bc6dSbellard	cscope -b
3066688bc6dSbellard
3073ef693a0Sbellard# documentation
30801668d98SStefan WeilMAKEINFO=makeinfo
30901668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
31020cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
31120cc9997SStefan Weil%.dvi: %.texi
31220cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
31320cc9997SStefan Weil
3141f673135Sbellard%.html: %.texi
31501668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
31601668d98SStefan Weil	"  GEN   $@")
3173ef693a0Sbellard
318f3548328Sbellard%.info: %.texi
31901668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
320f3548328Sbellard
32120cc9997SStefan Weil%.pdf: %.texi
32220cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
3235824d651Sblueswir1
3245824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
3254c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
326f3548328Sbellard
327acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
3284c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
3292313086aSBlue Swirl
33082a56f0dSLuiz CapitulinoQMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
3314c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
332b40292e7SJan Kiszka
333153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
3344c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
335153859beSStuart Brady
3362313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
3370d00e563Saliguori	$(call quiet-command, \
3384c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
3390d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
3400d00e563Saliguori	  "  GEN   $@")
3415a67135aSbellard
342153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
3430d00e563Saliguori	$(call quiet-command, \
3444c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
3450d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
3460d00e563Saliguori	  "  GEN   $@")
347acd935efSbellard
348a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
349a2d8f1beSM. Mohan Kumar	$(call quiet-command, \
350a2d8f1beSM. Mohan Kumar	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
351a2d8f1beSM. Mohan Kumar	  pod2man --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
352a2d8f1beSM. Mohan Kumar	  "  GEN   $@")
353a2d8f1beSM. Mohan Kumar
3547a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
3550d00e563Saliguori	$(call quiet-command, \
3564c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
3570d00e563Saliguori	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
3580d00e563Saliguori	  "  GEN   $@")
3597a5ca864Sbellard
3600cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
3610cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
36220cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
36320cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
3640cb3fb1eSpbrook
36520cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
36620cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
36720cc9997SStefan Weil	qemu-monitor.texi qemu-img-cmds.texi
368818220f5Saliguori
369df5cf721SthsVERSION ?= $(shell cat VERSION)
370df5cf721SthsFILE = qemu-$(VERSION)
371586314f2Sbellard
3721e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
373586314f2Sbellardtar:
374586314f2Sbellard	rm -rf /tmp/$(FILE)
3751e43adfcSbellard	cp -r . /tmp/$(FILE)
37699c6c082Saurel32	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
377586314f2Sbellard	rm -rf /tmp/$(FILE)
378586314f2Sbellard
3794fb240a4Sbellard# Include automatically generated dependency files
38048ff7a62SMichael Roth-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
381