xref: /openbmc/qemu/Makefile (revision 8f67aa82)
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.
9*8f67aa82SStefan Weilall:
10ad064840Spbrookinclude config-host.mak
1117759187Saliguoriinclude $(SRC_PATH)/rules.mak
1259bc10eeSPaolo Bonziniconfig-host.mak: $(SRC_PATH)/configure
13e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
14e5efe7f5SJuan Quintela	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
1555d7e8f6Saurel32else
1655d7e8f6Saurel32config-host.mak:
1755d7e8f6Saurel32	@echo "Please call configure before running make!"
1855d7e8f6Saurel32	@exit 1
1955d7e8f6Saurel32endif
20766a487aSbellard
21250b086eSLluís VilanovaGENERATED_HEADERS = config-host.h trace.h qemu-options.def
22250b086eSLluís Vilanovaifeq ($(TRACE_BACKEND),dtrace)
23250b086eSLluís VilanovaGENERATED_HEADERS += trace-dtrace.h
24250b086eSLluís Vilanovaendif
25250b086eSLluís VilanovaGENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
2619ac36b5SLluís VilanovaGENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c trace.c
27250b086eSLluís Vilanova
28d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
29d9ace8b3SJuan Quintela# We don't generate any of them
30d9ace8b3SJuan QuintelaMakefile: ;
31d9ace8b3SJuan Quintelaconfigure: ;
32d9ace8b3SJuan Quintela
33818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
34*8f67aa82SStefan Weil	pdf recurse-all speed tar tarbin test
350cb3fb1eSpbrook
36fec90ff0SPaolo Bonzini$(call set-vpath, $(SRC_PATH))
378c462f8fSpbrook
383e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
3967c0f08dSJuan Quintela
407b93fadfSCorey BryantHELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
417b93fadfSCorey Bryant
42cc8ae6deSpbrookifdef BUILD_DOCS
43b40292e7SJan KiszkaDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
44983eef5aSMeador Ingeifdef CONFIG_VIRTFS
45a2d8f1beSM. Mohan KumarDOCS+=fsdev/virtfs-proxy-helper.1
46983eef5aSMeador Ingeendif
47cc8ae6deSpbrookelse
48cc8ae6deSpbrookDOCS=
49cc8ae6deSpbrookendif
507d13299dSbellard
51388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
521f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
53bd9141bbSPaul BrookSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
541f3d3c8fSJuan Quintela
551f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
5601d86a85SStefan Weil	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
571f3d3c8fSJuan Quintela
58bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
59bd9141bbSPaul Brook
60a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
614c3b5a48SBlue Swirl	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
62a992fe3dSPaul Brook	@if test -f $@; then \
63904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
64012f0879SStefan Weil	    mv $@.tmp $@; \
65012f0879SStefan Weil	    cp -p $@ $@.old; \
66012f0879SStefan Weil	  else \
67012f0879SStefan Weil	    if test -f $@.old; then \
68012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
69012f0879SStefan Weil	    else \
70a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
71012f0879SStefan Weil	    fi; \
7263e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
73a992fe3dSPaul Brook	    rm $@.tmp; \
74012f0879SStefan Weil	  fi; \
75a992fe3dSPaul Brook	 else \
76a992fe3dSPaul Brook	  mv $@.tmp $@; \
77012f0879SStefan Weil	  cp -p $@ $@.old; \
78a992fe3dSPaul Brook	 fi
79a992fe3dSPaul Brook
80a992fe3dSPaul Brookdefconfig:
81a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
82a992fe3dSPaul Brook
831f3d3c8fSJuan Quintela-include config-all-devices.mak
841215c6e7SJuan Quintela
85*8f67aa82SStefan Weilall: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
86b9dea4fbSpbrook
871215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
881215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
89e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
904c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
911215c6e7SJuan Quintela
92cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
93cec7d0b6Spbrook
944115852bSPaolo Bonzinisubdir-%:
950087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
964aa42531Spbrook
97b88bc808SStefan Weilifneq ($(wildcard config-host.mak),)
980e8c9214SAndreas Färberinclude $(SRC_PATH)/Makefile.objs
99b88bc808SStefan Weilendif
1000e8c9214SAndreas Färber
10141a74826SAnthony Liguorisubdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
1026774e44aSPaolo Bonzini
103ee20477dSPaolo Bonzini$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) $(extra-obj-y) subdir-libdis
104c05ac895SPaul Brook
1054115852bSPaolo Bonzini$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
106add16157SBlue Swirl
107c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
108c05ac895SPaul Brookromsubdir-%:
109c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
110c05ac895SPaul Brook
111c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
112c05ac895SPaul Brook
113c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
1144aa42531Spbrook
11598b068a9SJuan Quintelaaudio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
1160e22fd2fSJuan Quintela
117a558ee17SJuan QuintelaQEMU_CFLAGS+=$(CURL_CFLAGS)
118769ce76dSAlexander Graf
1192f28d2ffSAnthony LiguoriQEMU_CFLAGS += -I$(SRC_PATH)/include
1202f28d2ffSAnthony Liguori
1213e230dd2SCorentin Charyui/cocoa.o: ui/cocoa.m
1224fb240a4Sbellard
1233d5a3f9aSPaolo Bonziniui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o hw/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
1240483755aSaliguori
1253e230dd2SCorentin Charyui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
1264d3b6f6eSbalrog
127a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
1284fb240a4Sbellard
1297948a665SBlue Swirlversion.o: $(SRC_PATH)/version.rc config-host.h
1309fe6de94SBlue Swirl	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
1319fe6de94SBlue Swirl
1329fe6de94SBlue Swirlversion-obj-$(CONFIG_WIN32) += version.o
1334fb240a4Sbellard######################################################################
13444dc0ca3SAlon Levy# Support building shared library libcacard
13544dc0ca3SAlon Levy
13644dc0ca3SAlon Levy.PHONY: libcacard.la install-libcacard
13744dc0ca3SAlon Levyifeq ($(LIBTOOL),)
13844dc0ca3SAlon Levylibcacard.la:
13944dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
14044dc0ca3SAlon Levy
14144dc0ca3SAlon Levyinstall-libcacard:
14244dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
14344dc0ca3SAlon Levyelse
1444115852bSPaolo Bonzinilibcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
14544dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
14644dc0ca3SAlon Levy
14744dc0ca3SAlon Levyinstall-libcacard: libcacard.la
14844dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
14944dc0ca3SAlon Levyendif
15000c705fbSPaolo Bonzini
15147ecbdf0SBlue Swirlvscclient$(EXESUF): $(libcacard-y) $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o libcacard/vscclient.o
15247ecbdf0SBlue Swirl	$(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(libcacard_libs) $(LIBS),"  LINK  $@")
15300c705fbSPaolo Bonzini
15444dc0ca3SAlon Levy######################################################################
1554fb240a4Sbellard
1563c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
157153859beSStuart Brady
158cbcfa041SPaolo Bonzinitools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
1593d9b4925SMichael Tokarev	qemu-timer-common.o main-loop.o notify.o \
1603d9b4925SMichael Tokarev	iohandler.o cutils.o iov.o async.o
161cbcfa041SPaolo Bonzinitools-obj-$(CONFIG_POSIX) += compatfd.o
1624fb240a4Sbellard
1634ab328d6SPaolo Bonziniqemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y)
1644ab328d6SPaolo Bonziniqemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
1654ab328d6SPaolo Bonziniqemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
1660a8e1acdSaliguori
1677b93fadfSCorey Bryantqemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
1687b93fadfSCorey Bryant
169ea75fc4eSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
17017bff52bSM. Mohan Kumarfsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
17117bff52bSM. Mohan Kumar
172153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
1734c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
174153859beSStuart Brady
175957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
1768f0e5c6bSStefan Weilqemu-ga$(EXESUF): QEMU_CFLAGS += -I qapi-generated
177640e5404SMichael Roth
17819bf7c87SAvi Kivitygen-out-type = $(subst .,-,$(suffix $@))
1798d3bc517SAvi Kivity
180e454e2e2SAndreas Färberifneq ($(wildcard config-host.mak),)
181dbfe06c6SAnthony Liguoriinclude $(SRC_PATH)/tests/Makefile
182e454e2e2SAndreas Färberendif
183640e5404SMichael Roth
1848f0e5c6bSStefan Weilqapi-generated/qga-qapi-types.c qapi-generated/qga-qapi-types.h :\
185599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
1868f0e5c6bSStefan Weil	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qapi-generated -p "qga-" < $<, "  GEN   $@")
1878f0e5c6bSStefan Weilqapi-generated/qga-qapi-visit.c qapi-generated/qga-qapi-visit.h :\
188599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
1898f0e5c6bSStefan Weil	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qapi-generated -p "qga-" < $<, "  GEN   $@")
1908f0e5c6bSStefan Weilqapi-generated/qga-qmp-commands.h qapi-generated/qga-qmp-marshal.c :\
191599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
1928f0e5c6bSStefan Weil	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qapi-generated -p "qga-" < $<, "  GEN   $@")
193e3d4d252SMichael Roth
194599825c5SMichael S. Tsirkinqapi-types.c qapi-types.h :\
195599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
1968d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
197599825c5SMichael S. Tsirkinqapi-visit.c qapi-visit.h :\
198599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py
1998d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
200599825c5SMichael S. Tsirkinqmp-commands.h qmp-marshal.c :\
201599825c5SMichael S. Tsirkin$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
2028d3bc517SAvi Kivity	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
203e3193601SAnthony Liguori
2048f0e5c6bSStefan WeilQGALIB_OBJ=$(addprefix qapi-generated/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
2058f0e5c6bSStefan WeilQGALIB_GEN=$(addprefix qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
2064115852bSPaolo Bonzini$(QGALIB_OBJ): $(QGALIB_GEN)
2074115852bSPaolo Bonzini$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
208957f1f99SMichael Roth
209d8ca685aSMichael Rothqemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(tools-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
21048ff7a62SMichael Roth
211111a38b0SRobert RelyeaQEMULIBS=libhw32 libhw64 libuser libdis libdis-user
212111a38b0SRobert Relyea
21331e31b8aSbellardclean:
2142d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
21525be210fSJuan 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
216df2943baSMichael S. Tsirkin	rm -f qemu-options.def
2177b93fadfSCorey Bryant	rm -f *.o *.d *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
21844dc0ca3SAlon Levy	rm -Rf .libs
21913a286d5SMichael 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
22053fbf7b5SAnthony PERARD	rm -f qom/*.o qom/*.d
2213d5a3f9aSPaolo Bonzini	rm -f usb/*.o usb/*.d hw/*.o hw/*.d
22207b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
223edb47ec4SLluís	rm -f trace/*.o trace/*.d
224b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
22519ac36b5SLluís Vilanova	@# May not be present in GENERATED_HEADERS
226b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.h trace-dtrace.h-timestamp
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
230c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg clean
231111a38b0SRobert Relyea	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
232fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
233df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
234626df76aSbellard        done
23531e31b8aSbellard
2367d13299dSbellarddistclean: clean
237fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
238a992fe3dSPaul Brook	rm -f config-all-devices.mak
239fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
2407a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
2417a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
2427a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
2437a734b8fSBrad Hards	rm -f qemu-doc.vr
244793553acSAlexandre Raymond	rm -f config.log
24567ed96f9SPeter Maydell	rm -f linux-headers/asm
246e1a068b2SHidetoshi 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
247111a38b0SRobert Relyea	for d in $(TARGET_DIRS) $(QEMULIBS); do \
248bc1b050dSbellard	rm -rf $$d || exit 1 ; \
24976bc6838Sbellard        done
2507d13299dSbellard
251fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
252fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
253471fbf4aSFrédéric Boiteuxcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
254471fbf4aSFrédéric Boiteuxbepo
255fed4a9adSbellard
25677755340Sthsifdef INSTALL_BLOBS
2576329866fSPaolo BonziniBLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
2587943a2faSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
2593b3d448eSGerd Hoffmannppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
2605ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
2615ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
26294b26294SStefan Weilqemu-icon.bmp \
26300914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
2642a2af967SJan Kiszkamultiboot.bin linuxboot.bin kvmvapic.bin \
26539ac8455SDavid Gibsons390-zipl.rom \
266753d11f2SRichard Hendersonspapr-rtas.bin slof.bin \
267753d11f2SRichard Hendersonpalcode-clipper
26877755340Sthselse
26977755340SthsBLOBS=
27077755340Sthsendif
27177755340Sths
27238954dcaSpbrookinstall-doc: $(DOCS)
273d7dd65baSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
274d7dd65baSEduardo Habkost	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
2750cd23fccSBruce Rogers	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
27696d409ebSJuan Quintelaifdef CONFIG_POSIX
27758f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
27858f8aeadSaliguori	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
27958f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
28058f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
28138954dcaSpbrookendif
282a2d8f1beSM. Mohan Kumarifdef CONFIG_VIRTFS
283a2d8f1beSM. Mohan Kumar	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
284a2d8f1beSM. Mohan Kumar	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
285a2d8f1beSM. Mohan Kumarendif
286b5ec5ce0Sjohn cooper
287e2d87bffSEduardo Habkostinstall-datadir:
288e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
289e2d87bffSEduardo Habkost
290e2d87bffSEduardo Habkostinstall-confdir:
291e2d87bffSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
292e2d87bffSEduardo Habkost
293e2d87bffSEduardo Habkostinstall-sysconfig: install-datadir install-confdir
294e2d87bffSEduardo Habkost	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
295e2d87bffSEduardo Habkost	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/cpus-x86_64.conf "$(DESTDIR)$(qemu_datadir)"
296e2d87bffSEduardo Habkost
297e2d87bffSEduardo Habkostinstall: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir
29858f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
299932a79dfSthsifneq ($(TOOLS),)
30058f8aeadSaliguori	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
301932a79dfSthsendif
3027b93fadfSCorey Bryantifneq ($(HELPERS-y),)
3037b93fadfSCorey Bryant	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
3047b93fadfSCorey Bryant	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
3057b93fadfSCorey Bryantendif
30677755340Sthsifneq ($(BLOBS),)
30777755340Sths	set -e; for x in $(BLOBS); do \
3086aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
309ad064840Spbrook	done
31077755340Sthsendif
3116aae2a2eSEduardo Habkost	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
31218be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
3136aae2a2eSEduardo Habkost		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
314ad064840Spbrook	done
315626df76aSbellard	for d in $(TARGET_DIRS); do \
3167d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
317626df76aSbellard        done
318612384d7Sbellard
319367e86e8Sbellard# various test targets
3209b0b8203Sbellardtest speed: all
321c09015ddSAnthony Liguori	$(MAKE) -C tests/tcg $@
32231e31b8aSbellard
32321d4e8e3SAlexandre Bique.PHONY: TAGS
324367e86e8SbellardTAGS:
32521d4e8e3SAlexandre Bique	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
32631e31b8aSbellard
3276688bc6dSbellardcscope:
3286688bc6dSbellard	rm -f ./cscope.*
32945b75ae4SAlexandre Raymond	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
3306688bc6dSbellard	cscope -b
3316688bc6dSbellard
3323ef693a0Sbellard# documentation
33301668d98SStefan WeilMAKEINFO=makeinfo
33401668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
33520cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
33620cc9997SStefan Weil%.dvi: %.texi
33720cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
33820cc9997SStefan Weil
3391f673135Sbellard%.html: %.texi
340952ef67cSStefan Weil	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
34101668d98SStefan Weil	"  GEN   $@")
3423ef693a0Sbellard
343f3548328Sbellard%.info: %.texi
34401668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
345f3548328Sbellard
34620cc9997SStefan Weil%.pdf: %.texi
34720cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
3485824d651Sblueswir1
3495824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
3504c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
351f3548328Sbellard
352acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
3534c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
3542313086aSBlue Swirl
35582a56f0dSLuiz CapitulinoQMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
3564c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
357b40292e7SJan Kiszka
358153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
3594c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
360153859beSStuart Brady
3612313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
3620d00e563Saliguori	$(call quiet-command, \
3634c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
3643179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
3650d00e563Saliguori	  "  GEN   $@")
3665a67135aSbellard
367153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
3680d00e563Saliguori	$(call quiet-command, \
3694c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
3703179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
3710d00e563Saliguori	  "  GEN   $@")
372acd935efSbellard
373a2d8f1beSM. Mohan Kumarfsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
374a2d8f1beSM. Mohan Kumar	$(call quiet-command, \
375a2d8f1beSM. Mohan Kumar	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
3763179d694SMichael Tokarev	  $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
377a2d8f1beSM. Mohan Kumar	  "  GEN   $@")
378a2d8f1beSM. Mohan Kumar
3797a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
3800d00e563Saliguori	$(call quiet-command, \
3814c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
3823179d694SMichael Tokarev	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
3830d00e563Saliguori	  "  GEN   $@")
3847a5ca864Sbellard
3850cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
3860cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
38720cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
38820cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
3890cb3fb1eSpbrook
39020cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
39120cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
39220cc9997SStefan Weil	qemu-monitor.texi qemu-img-cmds.texi
393818220f5Saliguori
394df5cf721SthsVERSION ?= $(shell cat VERSION)
395df5cf721SthsFILE = qemu-$(VERSION)
396586314f2Sbellard
3971e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
398586314f2Sbellardtar:
399586314f2Sbellard	rm -rf /tmp/$(FILE)
4001e43adfcSbellard	cp -r . /tmp/$(FILE)
40199c6c082Saurel32	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
402586314f2Sbellard	rm -rf /tmp/$(FILE)
403586314f2Sbellard
4044115852bSPaolo Bonzini# Add a dependency on the generated files, so that they are always
4054115852bSPaolo Bonzini# rebuilt before other object files
4064115852bSPaolo BonziniMakefile: $(GENERATED_HEADERS)
4074115852bSPaolo Bonzini
4084fb240a4Sbellard# Include automatically generated dependency files
409dcff25f2SAnthony Liguori# All subdir dependencies come automatically from our recursive subdir rules
410dcff25f2SAnthony Liguori-include $(wildcard *.d)
411