xref: /openbmc/qemu/Makefile (revision b1999e87)
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
6250b086eSLluís Vilanova# All following code might depend on configuration variables
755d7e8f6Saurel32ifneq ($(wildcard config-host.mak),)
81ad2134fSPaul Brook# Put the all: rule here so that config-host.mak can contain dependencies.
98f67aa82SStefan Weilall:
10ad064840Spbrookinclude config-host.mak
11d1bd2423SPeter Maydell
12d1bd2423SPeter Maydell# Check that we're not trying to do an out-of-tree build from
13d1bd2423SPeter Maydell# a tree that's been used for an in-tree build.
14d1bd2423SPeter Maydellifneq ($(realpath $(SRC_PATH)),$(realpath .))
15d1bd2423SPeter Maydellifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
16d1bd2423SPeter Maydell$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
17d1bd2423SPeter Maydellseems to have been used for an in-tree build. You can fix this by running \
18d1bd2423SPeter Maydell"make distclean && rm -rf *-linux-user *-softmmu" in your source tree)
19d1bd2423SPeter Maydellendif
20d1bd2423SPeter Maydellendif
21d1bd2423SPeter Maydell
2217759187Saliguoriinclude $(SRC_PATH)/rules.mak
2359bc10eeSPaolo Bonziniconfig-host.mak: $(SRC_PATH)/configure
24e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
25e5efe7f5SJuan Quintela	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
2655d7e8f6Saurel32else
2755d7e8f6Saurel32config-host.mak:
287748b8cbSMike Frysingerifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
2955d7e8f6Saurel32	@echo "Please call configure before running make!"
3055d7e8f6Saurel32	@exit 1
3155d7e8f6Saurel32endif
327748b8cbSMike Frysingerendif
33766a487aSbellard
34eac236eaSLluís VilanovaGENERATED_HEADERS = config-host.h qemu-options.def
35250b086eSLluís VilanovaGENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
36eac236eaSLluís VilanovaGENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
37eac236eaSLluís Vilanova
38eac236eaSLluís VilanovaGENERATED_HEADERS += trace/generated-tracers.h
39eac236eaSLluís Vilanovaifeq ($(TRACE_BACKEND),dtrace)
40eac236eaSLluís VilanovaGENERATED_HEADERS += trace/generated-tracers-dtrace.h
41eac236eaSLluís Vilanovaendif
42eac236eaSLluís VilanovaGENERATED_SOURCES += trace/generated-tracers.c
43250b086eSLluís Vilanova
44d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
45d9ace8b3SJuan Quintela# We don't generate any of them
46d9ace8b3SJuan QuintelaMakefile: ;
47d9ace8b3SJuan Quintelaconfigure: ;
48d9ace8b3SJuan Quintela
49818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
5034bb443eSAnthony Liguori	pdf recurse-all speed test dist
510cb3fb1eSpbrook
52fec90ff0SPaolo Bonzini$(call set-vpath, $(SRC_PATH))
538c462f8fSpbrook
543e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
5567c0f08dSJuan Quintela
567b93fadfSCorey BryantHELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
577b93fadfSCorey Bryant
58cc8ae6deSpbrookifdef BUILD_DOCS
59b40292e7SJan KiszkaDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
60983eef5aSMeador Ingeifdef CONFIG_VIRTFS
61a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1
62983eef5aSMeador Ingeendif
63cc8ae6deSpbrookelse
64cc8ae6deSpbrookDOCS=
65cc8ae6deSpbrookendif
667d13299dSbellard
67388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
681f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
6988070801SAndreas FärberSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
701f3d3c8fSJuan Quintela
718bdd3d49SStefan Weilifeq ($(SUBDIR_DEVICES_MAK),)
728bdd3d49SStefan Weilconfig-all-devices.mak:
738bdd3d49SStefan Weil	$(call quiet-command,echo '# no devices' > $@,"  GEN   $@")
748bdd3d49SStefan Weilelse
751f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
7601d86a85SStefan Weil	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
778bdd3d49SStefan Weilendif
781f3d3c8fSJuan Quintela
79bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
80bd9141bbSPaul Brook
81a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
824c3b5a48SBlue Swirl	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
83a992fe3dSPaul Brook	@if test -f $@; then \
84904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
85012f0879SStefan Weil	    mv $@.tmp $@; \
86012f0879SStefan Weil	    cp -p $@ $@.old; \
87012f0879SStefan Weil	  else \
88012f0879SStefan Weil	    if test -f $@.old; then \
89012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
90012f0879SStefan Weil	    else \
91a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
92012f0879SStefan Weil	    fi; \
9363e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
94a992fe3dSPaul Brook	    rm $@.tmp; \
95012f0879SStefan Weil	  fi; \
96a992fe3dSPaul Brook	 else \
97a992fe3dSPaul Brook	  mv $@.tmp $@; \
98012f0879SStefan Weil	  cp -p $@ $@.old; \
99a992fe3dSPaul Brook	 fi
100a992fe3dSPaul Brook
101a992fe3dSPaul Brookdefconfig:
102a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
103a992fe3dSPaul Brook
1041f3d3c8fSJuan Quintela-include config-all-devices.mak
10576cad711SPaolo Bonzini-include config-all-disas.mak
10600082344SPaolo BonziniCONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
10700082344SPaolo BonziniCONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
10882cb6b04SPaolo BonziniCONFIG_ALL=y
1091215c6e7SJuan Quintela
110992aeb8eSPaolo Bonziniifneq ($(wildcard config-host.mak),)
111992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/Makefile.objs
112992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/tests/Makefile
113992aeb8eSPaolo Bonziniendif
114992aeb8eSPaolo Bonziniifeq ($(CONFIG_SMARTCARD_NSS),y)
115992aeb8eSPaolo Bonziniinclude $(SRC_PATH)/libcacard/Makefile
116992aeb8eSPaolo Bonziniendif
117992aeb8eSPaolo Bonzini
1188f67aa82SStefan Weilall: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
119b9dea4fbSpbrook
1201215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
1211215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
122e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
1234c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
1241215c6e7SJuan Quintela
125cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
126916359f6SAndreas FärberSOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
127916359f6SAndreas Färber
128916359f6SAndreas Färber$(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
129cec7d0b6Spbrook
1304115852bSPaolo Bonzinisubdir-%:
1310087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
1324aa42531Spbrook
133e2134eb9SGerd Hoffmannsubdir-pixman: pixman/Makefile
134e2134eb9SGerd Hoffmann	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
135e2134eb9SGerd Hoffmann
136e2134eb9SGerd Hoffmannpixman/Makefile: $(SRC_PATH)/pixman/configure
137f9943cd5SGerd Hoffmann	(cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
138e2134eb9SGerd Hoffmann
139e2134eb9SGerd Hoffmann$(SRC_PATH)/pixman/configure:
140e2134eb9SGerd Hoffmann	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
141e2134eb9SGerd Hoffmann
14282cb6b04SPaolo Bonzini$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
143add16157SBlue Swirl
144c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
145c05ac895SPaul Brookromsubdir-%:
146c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
147c05ac895SPaul Brook
148c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
149c05ac895SPaul Brook
150c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
1514aa42531Spbrook
152a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
1534fb240a4Sbellard
1547948a665SBlue Swirlversion.o: $(SRC_PATH)/version.rc config-host.h
1559fe6de94SBlue Swirl	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
1569fe6de94SBlue Swirl
1579fe6de94SBlue Swirlversion-obj-$(CONFIG_WIN32) += version.o
158af381ebeSPaolo BonziniMakefile: $(version-obj-y)
1593bc2f570SPaolo Bonzini
1603bc2f570SPaolo Bonzini######################################################################
1618a090705SPaolo Bonzini# Build libraries
1623bc2f570SPaolo Bonzini
1633bc2f570SPaolo Bonzinilibqemustub.a: $(stub-obj-y)
1648a090705SPaolo Bonzinilibqemuutil.a: $(util-obj-y)
1653bc2f570SPaolo Bonzini
1664fb240a4Sbellard######################################################################
1674fb240a4Sbellard
1683c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
169153859beSStuart Brady
170ff667e2eSPaolo Bonziniqemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
171ff667e2eSPaolo Bonziniqemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
172ff667e2eSPaolo Bonziniqemu-io$(EXESUF): qemu-io.o cmd.o $(block-obj-y) libqemuutil.a libqemustub.a
1730a8e1acdSaliguori
1747b93fadfSCorey Bryantqemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
1757b93fadfSCorey Bryant
176ff667e2eSPaolo Bonzinifsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a
17717bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
17817bff52bSM. Mohan Kumar
179153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
1804c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
181153859beSStuart Brady
182957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
18354c2e502SDunrong Huangqemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
184640e5404SMichael Roth
18519bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@))
1868d3bc517SAvi Kivity
1870521d375SStefan Hajnocziqapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
1880521d375SStefan Hajnoczi
18954c2e502SDunrong Huangqga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
1902870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
19154c2e502SDunrong Huang	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
19254c2e502SDunrong Huangqga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
1932870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
19454c2e502SDunrong Huang	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
19554c2e502SDunrong Huangqga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
1962870dc34SPaolo Bonzini$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
19754c2e502SDunrong Huang	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
198e3d4d252SMichael Roth
199599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\
2000521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
2018d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
202599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\
2030521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
2048d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
205599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\
2060521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
2078d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
208e3193601SAnthony Liguori
20954c2e502SDunrong HuangQGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
2104115852bSPaolo Bonzini$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
211957f1f99SMichael Roth
212ff667e2eSPaolo Bonziniqemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
2132870dc34SPaolo Bonzini	$(call LINK, $^)
21448ff7a62SMichael Roth
21531e31b8aSbellardclean:
2162d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
21725be210fSJuan 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
218df2943baSMichael S. Tsirkin	rm -f qemu-options.def
2190c3c89d6SPaolo Bonzini	find . -name '*.[oda]' -type f -exec rm -f {} +
2200c3c89d6SPaolo Bonzini	find . -name '*.l[oa]' -type f -exec rm -f {} +
2210c3c89d6SPaolo Bonzini	rm -f $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
22244dc0ca3SAlon Levy	rm -Rf .libs
22307b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
22419ac36b5SLluís Vilanova	@# May not be present in GENERATED_HEADERS
225eac236eaSLluís Vilanova	rm -f trace/generated-tracers-dtrace.dtrace*
226eac236eaSLluís Vilanova	rm -f trace/generated-tracers-dtrace.h*
22719ac36b5SLluís Vilanova	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
22819ac36b5SLluís Vilanova	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
2298f0e5c6bSStefan Weil	rm -rf qapi-generated
23054c2e502SDunrong Huang	rm -rf qga/qapi-generated
231c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg clean
232781c0c33SStefan Hajnoczi	for d in $(ALL_SUBDIRS); do \
233fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
234df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
235626df76aSbellard        done
23631e31b8aSbellard
23734bb443eSAnthony LiguoriVERSION ?= $(shell cat VERSION)
23834bb443eSAnthony Liguori
23934bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2
24034bb443eSAnthony Liguori
24134bb443eSAnthony Liguoriqemu-%.tar.bz2:
24234bb443eSAnthony Liguori	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
24334bb443eSAnthony Liguori
2447d13299dSbellarddistclean: clean
245fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
24676cad711SPaolo Bonzini	rm -f config-all-devices.mak config-all-disas.mak
247fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
2487a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
2497a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
2507a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
2517a734b8fSBrad Hards	rm -f qemu-doc.vr
252793553acSAlexandre Raymond	rm -f config.log
25367ed96f9SPeter Maydell	rm -f linux-headers/asm
254e1a068b2SHidetoshi 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
2558e98e2e8SPaolo Bonzini	for d in $(TARGET_DIRS); do \
256bc1b050dSbellard	rm -rf $$d || exit 1 ; \
25776bc6838Sbellard        done
258a85903ffSWenchao Xia	if test -f pixman/config.log; then make -C pixman distclean; fi
2597d13299dSbellard
260fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
261fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
262471fbf4aSFrédéric Boiteuxcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
263471fbf4aSFrédéric Boiteuxbepo
264fed4a9adSbellard
26577755340Sthsifdef INSTALL_BLOBS
2666329866fSPaolo BonziniBLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
2677943a2faSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
2687e973bb2SLaszlo Ersekacpi-dsdt.aml q35-acpi-dsdt.aml \
2693b3d448eSGerd Hoffmannppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
2705ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
2715ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
27294b26294SStefan Weilqemu-icon.bmp \
27300914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
2742a2af967SJan Kiszkamultiboot.bin linuxboot.bin kvmvapic.bin \
27539ac8455SDavid Gibsons390-zipl.rom \
276753d11f2SRichard Hendersonspapr-rtas.bin slof.bin \
277753d11f2SRichard Hendersonpalcode-clipper
27877755340Sthselse
27977755340SthsBLOBS=
28077755340Sthsendif
28177755340Sths
28238954dcaSpbrookinstall-doc: $(DOCS)
283d7dd65baSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
284d7dd65baSEduardo Habkost	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
2850cd23fccSBruce Rogers	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
28696d409ebSJuan Quintelaifdef CONFIG_POSIX
28758f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
28858f8aeadSaliguori	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
28958f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
29058f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
29138954dcaSpbrookendif
292a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
293a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
294a2d8f1beSM. Mohan Kumar	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
295a2d8f1beSM. Mohan Kumarendif
296b5ec5ce0Sjohn cooper
297e2d87bffSEduardo Habkostinstall-datadir:
298e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
299e2d87bffSEduardo Habkost
300e2d87bffSEduardo Habkostinstall-confdir:
301e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
302e2d87bffSEduardo Habkost
303e2d87bffSEduardo Habkostinstall-sysconfig: install-datadir install-confdir
304e2d87bffSEduardo Habkost	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
305e2d87bffSEduardo Habkost
306e2d87bffSEduardo Habkostinstall: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir
30758f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
308932a79dfSthsifneq ($(TOOLS),)
30958f8aeadSaliguori	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
310932a79dfSthsendif
3117b93fadfSCorey Bryantifneq ($(HELPERS-y),)
3127b93fadfSCorey Bryant	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
3137b93fadfSCorey Bryant	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
3147b93fadfSCorey Bryantendif
31577755340Sthsifneq ($(BLOBS),)
31677755340Sths	set -e; for x in $(BLOBS); do \
3176aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
318ad064840Spbrook	done
31977755340Sthsendif
320834574eaSAnthony Liguoriifeq ($(CONFIG_GTK),y)
321834574eaSAnthony Liguori	$(MAKE) -C po $@
322834574eaSAnthony Liguoriendif
3236aae2a2eSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
32418be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
3256aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
326ad064840Spbrook	done
327626df76aSbellard	for d in $(TARGET_DIRS); do \
3287d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
329626df76aSbellard        done
330612384d7Sbellard
331367e86e8Sbellard# various test targets
3329b0b8203Sbellardtest speed: all
333c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg $@
33431e31b8aSbellard
33521d4e8e3SAlexandre Bique.PHONY: TAGS
336367e86e8SbellardTAGS:
337*b1999e87SDavid Gibson	rm -f $@
338*b1999e87SDavid Gibson	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
33931e31b8aSbellard
3406688bc6dSbellardcscope:
3416688bc6dSbellard	rm -f ./cscope.*
34245b75ae4SAlexandre Raymond	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
3436688bc6dSbellard	cscope -b
3446688bc6dSbellard
3453ef693a0Sbellard# documentation
34601668d98SStefan WeilMAKEINFO=makeinfo
34701668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
34820cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
34920cc9997SStefan Weil%.dvi: %.texi
35020cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
35120cc9997SStefan Weil
3521f673135Sbellard%.html: %.texi
353952ef67cSStefan Weil	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
35401668d98SStefan Weil	"  GEN   $@")
3553ef693a0Sbellard
356f3548328Sbellard%.info: %.texi
35701668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
358f3548328Sbellard
35920cc9997SStefan Weil%.pdf: %.texi
36020cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
3615824d651Sblueswir1
3625824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
3634c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
364f3548328Sbellard
365acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
3664c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
3672313086aSBlue Swirl
36882a56f0dSLuiz CapitulinoQMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
3694c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
370b40292e7SJan Kiszka
371153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
3724c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
373153859beSStuart Brady
3742313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
3750d00e563Saliguori	$(call quiet-command, \
3764c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
3773179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
3780d00e563Saliguori	  "  GEN   $@")
3795a67135aSbellard
380153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
3810d00e563Saliguori	$(call quiet-command, \
3824c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
3833179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
3840d00e563Saliguori	  "  GEN   $@")
385acd935efSbellard
386a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
387a2d8f1beSM. Mohan Kumar	$(call quiet-command, \
388a2d8f1beSM. Mohan Kumar	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
3893179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
390a2d8f1beSM. Mohan Kumar	  "  GEN   $@")
391a2d8f1beSM. Mohan Kumar
3927a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
3930d00e563Saliguori	$(call quiet-command, \
3944c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
3953179d694SMichael Tokarev	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
3960d00e563Saliguori	  "  GEN   $@")
3977a5ca864Sbellard
3980cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
3990cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
40020cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
40120cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
4020cb3fb1eSpbrook
40320cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
40420cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
40520cc9997SStefan Weil	qemu-monitor.texi qemu-img-cmds.texi
406818220f5Saliguori
407cb5fc67dSAnthony Liguori# Add a dependency on the generated files, so that they are always
408cb5fc67dSAnthony Liguori# rebuilt before other object files
4097748b8cbSMike Frysingerifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
410cb5fc67dSAnthony LiguoriMakefile: $(GENERATED_HEADERS)
4117748b8cbSMike Frysingerendif
412cb5fc67dSAnthony Liguori
4134fb240a4Sbellard# Include automatically generated dependency files
4141435ddb8SPaolo Bonzini# Dependencies in Makefile.objs files come from our recursive subdir rules
4151435ddb8SPaolo Bonzini-include $(wildcard *.d tests/*.d)
416