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 34250b086eSLluís VilanovaGENERATED_HEADERS = config-host.h trace.h qemu-options.def 35250b086eSLluís Vilanovaifeq ($(TRACE_BACKEND),dtrace) 36250b086eSLluís VilanovaGENERATED_HEADERS += trace-dtrace.h 37250b086eSLluís Vilanovaendif 38250b086eSLluís VilanovaGENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h 3919ac36b5SLluís VilanovaGENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c trace.c 40250b086eSLluís Vilanova 41d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure 42d9ace8b3SJuan Quintela# We don't generate any of them 43d9ace8b3SJuan QuintelaMakefile: ; 44d9ace8b3SJuan Quintelaconfigure: ; 45d9ace8b3SJuan Quintela 46818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \ 4734bb443eSAnthony Liguori pdf recurse-all speed test dist 480cb3fb1eSpbrook 49fec90ff0SPaolo Bonzini$(call set-vpath, $(SRC_PATH)) 508c462f8fSpbrook 513e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS) 5267c0f08dSJuan Quintela 537b93fadfSCorey BryantHELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) 547b93fadfSCorey Bryant 55cc8ae6deSpbrookifdef BUILD_DOCS 56b40292e7SJan KiszkaDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt 57983eef5aSMeador Ingeifdef CONFIG_VIRTFS 58a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1 59983eef5aSMeador Ingeendif 60cc8ae6deSpbrookelse 61cc8ae6deSpbrookDOCS= 62cc8ae6deSpbrookendif 637d13299dSbellard 64388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR) 651f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS)) 66bd9141bbSPaul BrookSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS)) 671f3d3c8fSJuan Quintela 688bdd3d49SStefan Weilifeq ($(SUBDIR_DEVICES_MAK),) 698bdd3d49SStefan Weilconfig-all-devices.mak: 708bdd3d49SStefan Weil $(call quiet-command,echo '# no devices' > $@," GEN $@") 718bdd3d49SStefan Weilelse 721f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK) 7301d86a85SStefan Weil $(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@," GEN $@") 748bdd3d49SStefan Weilendif 751f3d3c8fSJuan Quintela 76bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP) 77bd9141bbSPaul Brook 78a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak 794c3b5a48SBlue Swirl $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, " GEN $@") 80a992fe3dSPaul Brook @if test -f $@; then \ 81904fe1fbSBlue Swirl if cmp -s $@.old $@; then \ 82012f0879SStefan Weil mv $@.tmp $@; \ 83012f0879SStefan Weil cp -p $@ $@.old; \ 84012f0879SStefan Weil else \ 85012f0879SStefan Weil if test -f $@.old; then \ 86012f0879SStefan Weil echo "WARNING: $@ (user modified) out of date.";\ 87012f0879SStefan Weil else \ 88a992fe3dSPaul Brook echo "WARNING: $@ out of date.";\ 89012f0879SStefan Weil fi; \ 9063e86b2eSStefan Weil echo "Run \"make defconfig\" to regenerate."; \ 91a992fe3dSPaul Brook rm $@.tmp; \ 92012f0879SStefan Weil fi; \ 93a992fe3dSPaul Brook else \ 94a992fe3dSPaul Brook mv $@.tmp $@; \ 95012f0879SStefan Weil cp -p $@ $@.old; \ 96a992fe3dSPaul Brook fi 97a992fe3dSPaul Brook 98a992fe3dSPaul Brookdefconfig: 99a992fe3dSPaul Brook rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK) 100a992fe3dSPaul Brook 1011f3d3c8fSJuan Quintela-include config-all-devices.mak 1021215c6e7SJuan Quintela 1038f67aa82SStefan Weilall: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all 104b9dea4fbSpbrook 1051215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp 1061215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak 107e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx 1084c3b5a48SBlue Swirl $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@") 1091215c6e7SJuan Quintela 110cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) 111cec7d0b6Spbrook 1124115852bSPaolo Bonzinisubdir-%: 1130087375eSPaul Brook $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,) 1144aa42531Spbrook 115b88bc808SStefan Weilifneq ($(wildcard config-host.mak),) 1160e8c9214SAndreas Färberinclude $(SRC_PATH)/Makefile.objs 117b88bc808SStefan Weilendif 1180e8c9214SAndreas Färber 11941a74826SAnthony Liguorisubdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o 1206774e44aSPaolo Bonzini 121e2134eb9SGerd Hoffmannsubdir-pixman: pixman/Makefile 122e2134eb9SGerd Hoffmann $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,) 123e2134eb9SGerd Hoffmann 124e2134eb9SGerd Hoffmannpixman/Makefile: $(SRC_PATH)/pixman/configure 125c28fa5a0SGerd Hoffmann (cd pixman; CFLAGS="$(CFLAGS) -fPIC" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static) 126e2134eb9SGerd Hoffmann 127e2134eb9SGerd Hoffmann$(SRC_PATH)/pixman/configure: 128e2134eb9SGerd Hoffmann (cd $(SRC_PATH)/pixman; autoreconf -v --install) 129e2134eb9SGerd Hoffmann 13016529cedSStefan Weil$(SUBDIR_RULES): libqemustub.a 13116529cedSStefan Weil 132ee20477dSPaolo Bonzini$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y) subdir-libdis 133c05ac895SPaul Brook 1344115852bSPaolo Bonzini$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser 135add16157SBlue Swirl 136c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) 137c05ac895SPaul Brookromsubdir-%: 138c05ac895SPaul Brook $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",) 139c05ac895SPaul Brook 140c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) 141c05ac895SPaul Brook 142c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) 1434aa42531Spbrook 14498b068a9SJuan Quintelaaudio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS) 1450e22fd2fSJuan Quintela 146a558ee17SJuan QuintelaQEMU_CFLAGS+=$(CURL_CFLAGS) 147769ce76dSAlexander Graf 1482f28d2ffSAnthony LiguoriQEMU_CFLAGS += -I$(SRC_PATH)/include 1492f28d2ffSAnthony Liguori 1503e230dd2SCorentin Charyui/cocoa.o: ui/cocoa.m 1514fb240a4Sbellard 1523d5a3f9aSPaolo Bonziniui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o hw/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS) 1530483755aSaliguori 1543e230dd2SCorentin Charyui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS) 1554d3b6f6eSbalrog 156a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS) 1574fb240a4Sbellard 1587948a665SBlue Swirlversion.o: $(SRC_PATH)/version.rc config-host.h 1599fe6de94SBlue Swirl $(call quiet-command,$(WINDRES) -I. -o $@ $<," RC $(TARGET_DIR)$@") 1609fe6de94SBlue Swirl 1619fe6de94SBlue Swirlversion-obj-$(CONFIG_WIN32) += version.o 1623bc2f570SPaolo Bonzini 1633bc2f570SPaolo Bonzini###################################################################### 1643bc2f570SPaolo Bonzini# Build library with stubs 1653bc2f570SPaolo Bonzini 1663bc2f570SPaolo Bonzinilibqemustub.a: $(stub-obj-y) 1673bc2f570SPaolo Bonzini 1684fb240a4Sbellard###################################################################### 16944dc0ca3SAlon Levy# Support building shared library libcacard 17044dc0ca3SAlon Levy 17144dc0ca3SAlon Levy.PHONY: libcacard.la install-libcacard 17244dc0ca3SAlon Levyifeq ($(LIBTOOL),) 17344dc0ca3SAlon Levylibcacard.la: 17444dc0ca3SAlon Levy @echo "libtool is missing, please install and rerun configure"; exit 1 17544dc0ca3SAlon Levy 17644dc0ca3SAlon Levyinstall-libcacard: 17744dc0ca3SAlon Levy @echo "libtool is missing, please install and rerun configure"; exit 1 17844dc0ca3SAlon Levyelse 1794115852bSPaolo Bonzinilibcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y))) 18044dc0ca3SAlon Levy $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,) 18144dc0ca3SAlon Levy 18244dc0ca3SAlon Levyinstall-libcacard: libcacard.la 18344dc0ca3SAlon Levy $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,) 18444dc0ca3SAlon Levyendif 18500c705fbSPaolo Bonzini 18644dc0ca3SAlon Levy###################################################################### 1874fb240a4Sbellard 1883c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h 189153859beSStuart Brady 190cbcfa041SPaolo Bonzinitools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \ 191136594f1SPaolo Bonzini main-loop.o iohandler.o error.o 192cbcfa041SPaolo Bonzinitools-obj-$(CONFIG_POSIX) += compatfd.o 1934fb240a4Sbellard 1943bc2f570SPaolo Bonziniqemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y) libqemustub.a 1953bc2f570SPaolo Bonziniqemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y) libqemustub.a 1963bc2f570SPaolo Bonziniqemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y) libqemustub.a 1970a8e1acdSaliguori 1987b93fadfSCorey Bryantqemu-bridge-helper$(EXESUF): qemu-bridge-helper.o 1997b93fadfSCorey Bryant 2003bc2f570SPaolo Bonzinivscclient$(EXESUF): $(libcacard-y) $(oslib-obj-y) $(trace-obj-y) libcacard/vscclient.o libqemustub.a 201adb696f3SCorey Bryant $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@") 202adb696f3SCorey Bryant 203ea75fc4eSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y) 20417bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap 20517bff52bSM. Mohan Kumar 206153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx 2074c3b5a48SBlue Swirl $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@") 208153859beSStuart Brady 209957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA) 21054c2e502SDunrong Huangqemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated 211640e5404SMichael Roth 21219bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@)) 2138d3bc517SAvi Kivity 214e454e2e2SAndreas Färberifneq ($(wildcard config-host.mak),) 215dbfe06c6SAnthony Liguoriinclude $(SRC_PATH)/tests/Makefile 216e454e2e2SAndreas Färberendif 217640e5404SMichael Roth 2180521d375SStefan Hajnocziqapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py 2190521d375SStefan Hajnoczi 22054c2e502SDunrong Huangqga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ 2210521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) 22254c2e502SDunrong Huang $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@") 22354c2e502SDunrong Huangqga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\ 2240521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) 22554c2e502SDunrong Huang $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@") 22654c2e502SDunrong Huangqga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\ 2270521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) 22854c2e502SDunrong Huang $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, " GEN $@") 229e3d4d252SMichael Roth 230599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\ 2310521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) 2328d3bc517SAvi Kivity $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, " GEN $@") 233599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\ 2340521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py) 2358d3bc517SAvi Kivity $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "." < $<, " GEN $@") 236599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\ 2370521d375SStefan Hajnoczi$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py) 2388d3bc517SAvi Kivity $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, " GEN $@") 239e3193601SAnthony Liguori 24054c2e502SDunrong HuangQGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h) 2414115852bSPaolo Bonzini$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) 242957f1f99SMichael Roth 2433bc2f570SPaolo Bonziniqemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(oslib-obj-y) $(trace-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) libqemustub.a 24448ff7a62SMichael Roth 245c9159fe9SStefan WeilQEMULIBS=libuser libdis libdis-user 246111a38b0SRobert Relyea 24731e31b8aSbellardclean: 2482d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files 24925be210fSJuan 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 250df2943baSMichael S. Tsirkin rm -f qemu-options.def 251e743ccecSPeter Maydell find . -name '*.[od]' -exec rm -f {} + 252e743ccecSPeter Maydell rm -f *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~ 25344dc0ca3SAlon Levy rm -Rf .libs 25407b44ce9SBlue Swirl rm -f qemu-img-cmds.h 255b3d08c02SDaniel P. Berrange rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp 25619ac36b5SLluís Vilanova @# May not be present in GENERATED_HEADERS 257b3d08c02SDaniel P. Berrange rm -f trace-dtrace.h trace-dtrace.h-timestamp 25819ac36b5SLluís Vilanova rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp) 25919ac36b5SLluís Vilanova rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp) 2608f0e5c6bSStefan Weil rm -rf qapi-generated 26154c2e502SDunrong Huang rm -rf qga/qapi-generated 262c09015ddSAnthony Liguori $(MAKE) -C tests/tcg clean 263111a38b0SRobert Relyea for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \ 264fc8e320eSMagnus Damm if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \ 265df2943baSMichael S. Tsirkin rm -f $$d/qemu-options.def; \ 266626df76aSbellard done 26731e31b8aSbellard 26834bb443eSAnthony LiguoriVERSION ?= $(shell cat VERSION) 26934bb443eSAnthony Liguori 27034bb443eSAnthony Liguoridist: qemu-$(VERSION).tar.bz2 27134bb443eSAnthony Liguori 27234bb443eSAnthony Liguoriqemu-%.tar.bz2: 27334bb443eSAnthony Liguori $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)" 27434bb443eSAnthony Liguori 2757d13299dSbellarddistclean: clean 276fc8e320eSMagnus Damm rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi 277a992fe3dSPaul Brook rm -f config-all-devices.mak 278fc8e320eSMagnus Damm rm -f roms/seabios/config.mak roms/vgabios/config.mak 2797a734b8fSBrad Hards rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi 2807a734b8fSBrad Hards rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys 2817a734b8fSBrad Hards rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp 2827a734b8fSBrad Hards rm -f qemu-doc.vr 283793553acSAlexandre Raymond rm -f config.log 28467ed96f9SPeter Maydell rm -f linux-headers/asm 285e1a068b2SHidetoshi 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 286111a38b0SRobert Relyea for d in $(TARGET_DIRS) $(QEMULIBS); do \ 287bc1b050dSbellard rm -rf $$d || exit 1 ; \ 28876bc6838Sbellard done 289*a85903ffSWenchao Xia if test -f pixman/config.log; then make -C pixman distclean; fi 2907d13299dSbellard 291fed4a9adSbellardKEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \ 292fed4a9adSbellardar de en-us fi fr-be hr it lv nl pl ru th \ 293471fbf4aSFrédéric Boiteuxcommon de-ch es fo fr-ca hu ja mk nl-be pt sl tr \ 294471fbf4aSFrédéric Boiteuxbepo 295fed4a9adSbellard 29677755340Sthsifdef INSTALL_BLOBS 2976329866fSPaolo BonziniBLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \ 2987943a2faSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \ 2993b3d448eSGerd Hoffmannppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \ 3005ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \ 3015ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \ 30294b26294SStefan Weilqemu-icon.bmp \ 30300914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ 3042a2af967SJan Kiszkamultiboot.bin linuxboot.bin kvmvapic.bin \ 30539ac8455SDavid Gibsons390-zipl.rom \ 306753d11f2SRichard Hendersonspapr-rtas.bin slof.bin \ 307753d11f2SRichard Hendersonpalcode-clipper 30877755340Sthselse 30977755340SthsBLOBS= 31077755340Sthsendif 31177755340Sths 31238954dcaSpbrookinstall-doc: $(DOCS) 313d7dd65baSEduardo Habkost $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" 314d7dd65baSEduardo Habkost $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)" 3150cd23fccSBruce Rogers $(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" 31696d409ebSJuan Quintelaifdef CONFIG_POSIX 31758f8aeadSaliguori $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" 31858f8aeadSaliguori $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" 31958f8aeadSaliguori $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" 32058f8aeadSaliguori $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" 32138954dcaSpbrookendif 322a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS 323a2d8f1beSM. Mohan Kumar $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" 324a2d8f1beSM. Mohan Kumar $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" 325a2d8f1beSM. Mohan Kumarendif 326b5ec5ce0Sjohn cooper 327e2d87bffSEduardo Habkostinstall-datadir: 328e2d87bffSEduardo Habkost $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" 329e2d87bffSEduardo Habkost 330e2d87bffSEduardo Habkostinstall-confdir: 331e2d87bffSEduardo Habkost $(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)" 332e2d87bffSEduardo Habkost 333e2d87bffSEduardo Habkostinstall-sysconfig: install-datadir install-confdir 334e2d87bffSEduardo Habkost $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)" 335e2d87bffSEduardo Habkost 336e2d87bffSEduardo Habkostinstall: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir 33758f8aeadSaliguori $(INSTALL_DIR) "$(DESTDIR)$(bindir)" 338932a79dfSthsifneq ($(TOOLS),) 33958f8aeadSaliguori $(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)" 340932a79dfSthsendif 3417b93fadfSCorey Bryantifneq ($(HELPERS-y),) 3427b93fadfSCorey Bryant $(INSTALL_DIR) "$(DESTDIR)$(libexecdir)" 3437b93fadfSCorey Bryant $(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)" 3447b93fadfSCorey Bryantendif 34577755340Sthsifneq ($(BLOBS),) 34677755340Sths set -e; for x in $(BLOBS); do \ 3476aae2a2eSEduardo Habkost $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ 348ad064840Spbrook done 34977755340Sthsendif 3506aae2a2eSEduardo Habkost $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" 35118be8d77Sblueswir1 set -e; for x in $(KEYMAPS); do \ 3526aae2a2eSEduardo Habkost $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ 353ad064840Spbrook done 354626df76aSbellard for d in $(TARGET_DIRS); do \ 3557d3505c5Sbellard $(MAKE) -C $$d $@ || exit 1 ; \ 356626df76aSbellard done 357612384d7Sbellard 358367e86e8Sbellard# various test targets 3599b0b8203Sbellardtest speed: all 360c09015ddSAnthony Liguori $(MAKE) -C tests/tcg $@ 36131e31b8aSbellard 36221d4e8e3SAlexandre Bique.PHONY: TAGS 363367e86e8SbellardTAGS: 36421d4e8e3SAlexandre Bique find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags 36531e31b8aSbellard 3666688bc6dSbellardcscope: 3676688bc6dSbellard rm -f ./cscope.* 36845b75ae4SAlexandre Raymond find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files 3696688bc6dSbellard cscope -b 3706688bc6dSbellard 3713ef693a0Sbellard# documentation 37201668d98SStefan WeilMAKEINFO=makeinfo 37301668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections 37420cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet) 37520cc9997SStefan Weil%.dvi: %.texi 37620cc9997SStefan Weil $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<," GEN $@") 37720cc9997SStefan Weil 3781f673135Sbellard%.html: %.texi 379952ef67cSStefan Weil $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \ 38001668d98SStefan Weil " GEN $@") 3813ef693a0Sbellard 382f3548328Sbellard%.info: %.texi 38301668d98SStefan Weil $(call quiet-command,$(MAKEINFO) $< -o $@," GEN $@") 384f3548328Sbellard 38520cc9997SStefan Weil%.pdf: %.texi 38620cc9997SStefan Weil $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<," GEN $@") 3875824d651Sblueswir1 3885824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx 3894c3b5a48SBlue Swirl $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") 390f3548328Sbellard 391acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx 3924c3b5a48SBlue Swirl $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") 3932313086aSBlue Swirl 39482a56f0dSLuiz CapitulinoQMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx 3954c3b5a48SBlue Swirl $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@," GEN $@") 396b40292e7SJan Kiszka 397153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx 3984c3b5a48SBlue Swirl $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") 399153859beSStuart Brady 4002313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi 4010d00e563Saliguori $(call quiet-command, \ 4024c3b5a48SBlue Swirl perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \ 4033179d694SMichael Tokarev $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \ 4040d00e563Saliguori " GEN $@") 4055a67135aSbellard 406153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi 4070d00e563Saliguori $(call quiet-command, \ 4084c3b5a48SBlue Swirl perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \ 4093179d694SMichael Tokarev $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \ 4100d00e563Saliguori " GEN $@") 411acd935efSbellard 412a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi 413a2d8f1beSM. Mohan Kumar $(call quiet-command, \ 414a2d8f1beSM. Mohan Kumar perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \ 4153179d694SMichael Tokarev $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \ 416a2d8f1beSM. Mohan Kumar " GEN $@") 417a2d8f1beSM. Mohan Kumar 4187a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi 4190d00e563Saliguori $(call quiet-command, \ 4204c3b5a48SBlue Swirl perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \ 4213179d694SMichael Tokarev $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \ 4220d00e563Saliguori " GEN $@") 4237a5ca864Sbellard 4240cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi 4250cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html 42620cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info 42720cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf 4280cb3fb1eSpbrook 42920cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ 43020cc9997SStefan Weil qemu-img.texi qemu-nbd.texi qemu-options.texi \ 43120cc9997SStefan Weil qemu-monitor.texi qemu-img-cmds.texi 432818220f5Saliguori 433cb5fc67dSAnthony Liguori# Add a dependency on the generated files, so that they are always 434cb5fc67dSAnthony Liguori# rebuilt before other object files 4357748b8cbSMike Frysingerifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) 436cb5fc67dSAnthony LiguoriMakefile: $(GENERATED_HEADERS) 4377748b8cbSMike Frysingerendif 438cb5fc67dSAnthony Liguori 4394fb240a4Sbellard# Include automatically generated dependency files 4401435ddb8SPaolo Bonzini# Dependencies in Makefile.objs files come from our recursive subdir rules 4411435ddb8SPaolo Bonzini-include $(wildcard *.d tests/*.d) 442