xref: /qemu/Makefile (revision 388d4758)
10cb3fb1eSpbrook# Makefile for QEMU.
20cb3fb1eSpbrook
3*388d4758SLluís Vilanova# Always point to the root of the build tree
4*388d4758SLluís VilanovaBUILD_DIR=$(PWD)
5*388d4758SLluí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
10f527c579SJuan Quintela
1155d7e8f6Saurel32ifneq ($(wildcard config-host.mak),)
121ad2134fSPaul Brook# Put the all: rule here so that config-host.mak can contain dependencies.
131ad2134fSPaul Brookall: build-all
14ad064840Spbrookinclude config-host.mak
1517759187Saliguoriinclude $(SRC_PATH)/rules.mak
1659bc10eeSPaolo Bonziniconfig-host.mak: $(SRC_PATH)/configure
17e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
18e5efe7f5SJuan Quintela	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
1955d7e8f6Saurel32else
2055d7e8f6Saurel32config-host.mak:
2155d7e8f6Saurel32	@echo "Please call configure before running make!"
2255d7e8f6Saurel32	@exit 1
2355d7e8f6Saurel32endif
24766a487aSbellard
25d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
26d9ace8b3SJuan Quintela# We don't generate any of them
27d9ace8b3SJuan QuintelaMakefile: ;
28d9ace8b3SJuan Quintelaconfigure: ;
29d9ace8b3SJuan Quintela
30818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
3120cc9997SStefan Weil	pdf recurse-all speed tar tarbin test build-all
320cb3fb1eSpbrook
33076d2471SPaolo Bonzini$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
348c462f8fSpbrook
353e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
3667c0f08dSJuan Quintela
37cc8ae6deSpbrookifdef BUILD_DOCS
38b40292e7SJan KiszkaDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
39cc8ae6deSpbrookelse
40cc8ae6deSpbrookDOCS=
41cc8ae6deSpbrookendif
427d13299dSbellard
43*388d4758SLluís VilanovaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
441f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
45bd9141bbSPaul BrookSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
461f3d3c8fSJuan Quintela
471f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
4801d86a85SStefan Weil	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
491f3d3c8fSJuan Quintela
50bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
51bd9141bbSPaul Brook
52a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
534c3b5a48SBlue Swirl	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
54a992fe3dSPaul Brook	@if test -f $@; then \
55904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
56012f0879SStefan Weil	    mv $@.tmp $@; \
57012f0879SStefan Weil	    cp -p $@ $@.old; \
58012f0879SStefan Weil	  else \
59012f0879SStefan Weil	    if test -f $@.old; then \
60012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
61012f0879SStefan Weil	    else \
62a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
63012f0879SStefan Weil	    fi; \
6463e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
65a992fe3dSPaul Brook	    rm $@.tmp; \
66012f0879SStefan Weil	  fi; \
67a992fe3dSPaul Brook	 else \
68a992fe3dSPaul Brook	  mv $@.tmp $@; \
69012f0879SStefan Weil	  cp -p $@ $@.old; \
70a992fe3dSPaul Brook	 fi
71a992fe3dSPaul Brook
72a992fe3dSPaul Brookdefconfig:
73a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
74a992fe3dSPaul Brook
751f3d3c8fSJuan Quintela-include config-all-devices.mak
761215c6e7SJuan Quintela
77f527c579SJuan Quintelabuild-all: $(DOCS) $(TOOLS) recurse-all
78b9dea4fbSpbrook
791215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
801215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
81e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
824c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
831215c6e7SJuan Quintela
84cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
85cec7d0b6Spbrook
86f527c579SJuan Quintelasubdir-%: $(GENERATED_HEADERS)
870087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
884aa42531Spbrook
89b88bc808SStefan Weilifneq ($(wildcard config-host.mak),)
900e8c9214SAndreas Färberinclude $(SRC_PATH)/Makefile.objs
91b88bc808SStefan Weilendif
920e8c9214SAndreas Färber
930e8c9214SAndreas Färber$(common-obj-y): $(GENERATED_HEADERS)
9441a74826SAnthony Liguorisubdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
956774e44aSPaolo Bonzini
9691f16900SAndreas Färber$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
97c05ac895SPaul Brook
9891f16900SAndreas Färber$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
99add16157SBlue Swirl
100c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
101c05ac895SPaul Brookromsubdir-%:
102c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
103c05ac895SPaul Brook
104c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
105c05ac895SPaul Brook
106c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
1074aa42531Spbrook
10898b068a9SJuan Quintelaaudio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
1090e22fd2fSJuan Quintela
110a558ee17SJuan QuintelaQEMU_CFLAGS+=$(CURL_CFLAGS)
111769ce76dSAlexander Graf
112e18df141SAnthony LiguoriQEMU_CFLAGS+=$(GLIB_CFLAGS)
113e18df141SAnthony Liguori
1143e230dd2SCorentin Charyui/cocoa.o: ui/cocoa.m
1154fb240a4Sbellard
1163e230dd2SCorentin Charyui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
1170483755aSaliguori
1183e230dd2SCorentin Charyui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
1194d3b6f6eSbalrog
120a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
1214fb240a4Sbellard
1227948a665SBlue Swirlversion.o: $(SRC_PATH)/version.rc config-host.h
1239fe6de94SBlue Swirl	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
1249fe6de94SBlue Swirl
1259fe6de94SBlue Swirlversion-obj-$(CONFIG_WIN32) += version.o
1264fb240a4Sbellard######################################################################
12744dc0ca3SAlon Levy# Support building shared library libcacard
12844dc0ca3SAlon Levy
12944dc0ca3SAlon Levy.PHONY: libcacard.la install-libcacard
13044dc0ca3SAlon Levyifeq ($(LIBTOOL),)
13144dc0ca3SAlon Levylibcacard.la:
13244dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
13344dc0ca3SAlon Levy
13444dc0ca3SAlon Levyinstall-libcacard:
13544dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
13644dc0ca3SAlon Levyelse
13792f562ecSAnthony Liguorilibcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
13844dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
13944dc0ca3SAlon Levy
14044dc0ca3SAlon Levyinstall-libcacard: libcacard.la
14144dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
14244dc0ca3SAlon Levyendif
14344dc0ca3SAlon Levy######################################################################
1444fb240a4Sbellard
1453c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
14648ff7a62SMichael Rothqemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
147153859beSStuart Brady
148c1b0b93bSJes Sorensenqemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o
1494fb240a4Sbellard
150c1b0b93bSJes Sorensenqemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o
1513aa892d7Saliguori
152c1b0b93bSJes Sorensenqemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o
1530a8e1acdSaliguori
154153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
1554c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
156153859beSStuart Brady
157aa7ee42eSStefan Hajnoczicheck-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o test-coroutine.o: $(GENERATED_HEADERS)
1584091da4bSJan Kiszka
15992f562ecSAnthony LiguoriCHECK_PROG_DEPS = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o
160e71e00edSLuiz Capitulino
161e71e00edSLuiz Capitulinocheck-qint: check-qint.o qint.o $(CHECK_PROG_DEPS)
162e71e00edSLuiz Capitulinocheck-qstring: check-qstring.o qstring.o $(CHECK_PROG_DEPS)
163e71e00edSLuiz Capitulinocheck-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(CHECK_PROG_DEPS)
164e71e00edSLuiz Capitulinocheck-qlist: check-qlist.o qlist.o qint.o $(CHECK_PROG_DEPS)
165e71e00edSLuiz Capitulinocheck-qfloat: check-qfloat.o qfloat.o $(CHECK_PROG_DEPS)
166ef749d07SAnthony Liguoricheck-qjson: check-qjson.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o qjson.o json-streamer.o json-lexer.o json-parser.o error.o qerror.o qemu-error.o $(CHECK_PROG_DEPS)
167aa7ee42eSStefan Hajnoczitest-coroutine: test-coroutine.o qemu-timer-common.o async.o $(coroutine-obj-y) $(CHECK_PROG_DEPS)
16833837ba6SLuiz Capitulino
169640e5404SMichael Roth$(qapi-obj-y): $(GENERATED_HEADERS)
170640e5404SMichael Rothqapi-dir := qapi-generated
171e3d4d252SMichael Rothtest-visitor.o test-qmp-commands.o qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
172957f1f99SMichael Rothqemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
173640e5404SMichael Roth
174640e5404SMichael Roth$(qapi-dir)/test-qapi-types.c: $(qapi-dir)/test-qapi-types.h
175640e5404SMichael Roth$(qapi-dir)/test-qapi-types.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
176c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
177640e5404SMichael Roth$(qapi-dir)/test-qapi-visit.c: $(qapi-dir)/test-qapi-visit.h
178640e5404SMichael Roth$(qapi-dir)/test-qapi-visit.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
179c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
18069ed8366SMichael Roth$(qapi-dir)/test-qmp-commands.h: $(qapi-dir)/test-qmp-marshal.c
18169ed8366SMichael Roth$(qapi-dir)/test-qmp-marshal.c: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
182c886edfbSBlue Swirl	    $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
183640e5404SMichael Roth
184e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-types.c: $(qapi-dir)/qga-qapi-types.h
185e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-types.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
186c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
187e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-visit.c: $(qapi-dir)/qga-qapi-visit.h
188e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-visit.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
189c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
190e3d4d252SMichael Roth$(qapi-dir)/qga-qmp-marshal.c: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
191c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
192e3d4d252SMichael Roth
193640e5404SMichael Rothtest-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
19492f562ecSAnthony Liguoritest-visitor: test-visitor.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
195640e5404SMichael Roth
19669ed8366SMichael Rothtest-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y)
19792f562ecSAnthony Liguoritest-qmp-commands: test-qmp-commands.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
19869ed8366SMichael Roth
199016c77adSMichael RothQGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c)
200016c77adSMichael Roth$(QGALIB_GEN): $(GENERATED_HEADERS)
201957f1f99SMichael Roth$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
202957f1f99SMichael Roth
203957f1f99SMichael Rothqemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(trace-obj-y) $(qobject-obj-y) $(version-obj-y) $(addprefix $(qapi-dir)/, qga-qapi-visit.o qga-qapi-types.o qga-qmp-marshal.o)
20448ff7a62SMichael Roth
205111a38b0SRobert RelyeaQEMULIBS=libhw32 libhw64 libuser libdis libdis-user
206111a38b0SRobert Relyea
20731e31b8aSbellardclean:
2082d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
20925be210fSJuan 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
210df2943baSMichael S. Tsirkin	rm -f qemu-options.def
21148ff7a62SMichael Roth	rm -f *.o *.d *.a *.lo $(TOOLS) qemu-ga TAGS cscope.* *.pod *~ */*~
21244dc0ca3SAlon Levy	rm -Rf .libs
21313a286d5SMichael 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
21407b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
215edb47ec4SLluís	rm -f trace/*.o trace/*.d
216d7489b72SBlue Swirl	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
217b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
218b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.h trace-dtrace.h-timestamp
219640e5404SMichael Roth	rm -rf $(qapi-dir)
2207d3505c5Sbellard	$(MAKE) -C tests clean
221111a38b0SRobert Relyea	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
222fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
223df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
224626df76aSbellard        done
22531e31b8aSbellard
2267d13299dSbellarddistclean: clean
227fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
228a992fe3dSPaul Brook	rm -f config-all-devices.mak
229fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
2307a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
2317a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
2327a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
2337a734b8fSBrad Hards	rm -f qemu-doc.vr
234793553acSAlexandre Raymond	rm -f config.log
235e1a068b2SHidetoshi 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
236111a38b0SRobert Relyea	for d in $(TARGET_DIRS) $(QEMULIBS); do \
237bc1b050dSbellard	rm -rf $$d || exit 1 ; \
23876bc6838Sbellard        done
2397d13299dSbellard
240fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
241fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
242fed4a9adSbellardcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
243fed4a9adSbellard
24477755340Sthsifdef INSTALL_BLOBS
2453b3d448eSGerd HoffmannBLOBS=bios.bin vgabios.bin vgabios-cirrus.bin \
2467943a2faSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
2473b3d448eSGerd Hoffmannppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
2485ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
2495ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
25000914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
251fbd659b7SAlexander Grafmpc8544ds.dtb \
252fe270d04SAlexander Grafmultiboot.bin linuxboot.bin \
25339ac8455SDavid Gibsons390-zipl.rom \
254a9f8ad8fSDavid Gibsonspapr-rtas.bin slof.bin
25577755340Sthselse
25677755340SthsBLOBS=
25777755340Sthsendif
25877755340Sths
25938954dcaSpbrookinstall-doc: $(DOCS)
26058f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
26158f8aeadSaliguori	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
26296d409ebSJuan Quintelaifdef CONFIG_POSIX
26358f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
26458f8aeadSaliguori	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
26558f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
26658f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
26738954dcaSpbrookendif
26838954dcaSpbrook
269b5ec5ce0Sjohn cooperinstall-sysconfig:
270990caaf1SAndre Przywara	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
271990caaf1SAndre Przywara	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
272b5ec5ce0Sjohn cooper
273b5ec5ce0Sjohn cooperinstall: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
27458f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
275932a79dfSthsifneq ($(TOOLS),)
27658f8aeadSaliguori	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
277932a79dfSthsendif
27877755340Sthsifneq ($(BLOBS),)
27958f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
28077755340Sths	set -e; for x in $(BLOBS); do \
28158f8aeadSaliguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
282ad064840Spbrook	done
28377755340Sthsendif
28458f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
28518be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
28679fd42aaSAnthony Liguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
287ad064840Spbrook	done
288626df76aSbellard	for d in $(TARGET_DIRS); do \
2897d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
290626df76aSbellard        done
291612384d7Sbellard
292367e86e8Sbellard# various test targets
2939b0b8203Sbellardtest speed: all
2947d3505c5Sbellard	$(MAKE) -C tests $@
29531e31b8aSbellard
29621d4e8e3SAlexandre Bique.PHONY: TAGS
297367e86e8SbellardTAGS:
29821d4e8e3SAlexandre Bique	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
29931e31b8aSbellard
3006688bc6dSbellardcscope:
3016688bc6dSbellard	rm -f ./cscope.*
30245b75ae4SAlexandre Raymond	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
3036688bc6dSbellard	cscope -b
3046688bc6dSbellard
3053ef693a0Sbellard# documentation
30601668d98SStefan WeilMAKEINFO=makeinfo
30701668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
30820cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
30920cc9997SStefan Weil%.dvi: %.texi
31020cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
31120cc9997SStefan Weil
3121f673135Sbellard%.html: %.texi
31301668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
31401668d98SStefan Weil	"  GEN   $@")
3153ef693a0Sbellard
316f3548328Sbellard%.info: %.texi
31701668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
318f3548328Sbellard
31920cc9997SStefan Weil%.pdf: %.texi
32020cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
3215824d651Sblueswir1
3225824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
3234c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
324f3548328Sbellard
325acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
3264c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
3272313086aSBlue Swirl
32882a56f0dSLuiz CapitulinoQMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
3294c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
330b40292e7SJan Kiszka
331153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
3324c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
333153859beSStuart Brady
3342313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
3350d00e563Saliguori	$(call quiet-command, \
3364c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
3370d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
3380d00e563Saliguori	  "  GEN   $@")
3395a67135aSbellard
340153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
3410d00e563Saliguori	$(call quiet-command, \
3424c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
3430d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
3440d00e563Saliguori	  "  GEN   $@")
345acd935efSbellard
3467a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
3470d00e563Saliguori	$(call quiet-command, \
3484c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
3490d00e563Saliguori	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
3500d00e563Saliguori	  "  GEN   $@")
3517a5ca864Sbellard
3520cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
3530cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
35420cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
35520cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
3560cb3fb1eSpbrook
35720cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
35820cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
35920cc9997SStefan Weil	qemu-monitor.texi qemu-img-cmds.texi
360818220f5Saliguori
361df5cf721SthsVERSION ?= $(shell cat VERSION)
362df5cf721SthsFILE = qemu-$(VERSION)
363586314f2Sbellard
3641e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
365586314f2Sbellardtar:
366586314f2Sbellard	rm -rf /tmp/$(FILE)
3671e43adfcSbellard	cp -r . /tmp/$(FILE)
36899c6c082Saurel32	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
369586314f2Sbellard	rm -rf /tmp/$(FILE)
370586314f2Sbellard
3714c0a6db0SStuart BradySYSTEM_TARGETS=$(filter %-softmmu,$(TARGET_DIRS))
3729aed1e03SAnthony LiguoriSYSTEM_PROGS=$(patsubst %-softmmu,qemu-system-%, \
3739aed1e03SAnthony Liguori             $(SYSTEM_TARGETS))
3744c0a6db0SStuart Brady
3754c0a6db0SStuart BradyUSER_TARGETS=$(filter %-user,$(TARGET_DIRS))
3764c0a6db0SStuart BradyUSER_PROGS=$(patsubst %-bsd-user,qemu-%, \
3774c0a6db0SStuart Brady           $(patsubst %-darwin-user,qemu-%, \
3784c0a6db0SStuart Brady           $(patsubst %-linux-user,qemu-%, \
3794c0a6db0SStuart Brady           $(USER_TARGETS))))
3804c0a6db0SStuart Brady
38176b62fd0Sbellard# generate a binary distribution
382d691f669Sbellardtarbin:
38318be8d77Sblueswir1	cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
3844c0a6db0SStuart Brady	$(patsubst %,$(bindir)/%, $(SYSTEM_PROGS)) \
3854c0a6db0SStuart Brady	$(patsubst %,$(bindir)/%, $(USER_PROGS)) \
386b932cabaSbellard	$(bindir)/qemu-img \
3877a5ca864Sbellard	$(bindir)/qemu-nbd \
3887efa4387Sbellard	$(datadir)/bios.bin \
3897efa4387Sbellard	$(datadir)/vgabios.bin \
390de9258a8Sbellard	$(datadir)/vgabios-cirrus.bin \
391637f6cd7Sbellard	$(datadir)/ppc_rom.bin \
3920986ac3bSbellard	$(datadir)/openbios-sparc32 \
393938255d2Sblueswir1	$(datadir)/openbios-sparc64 \
394e5d01b06Saurel32	$(datadir)/openbios-ppc \
3955ee8ad71SAlex Williamson	$(datadir)/pxe-e1000.rom \
3965ee8ad71SAlex Williamson	$(datadir)/pxe-eepro100.rom \
3975ee8ad71SAlex Williamson	$(datadir)/pxe-ne2k_pci.rom \
3985ee8ad71SAlex Williamson	$(datadir)/pxe-pcnet.rom \
3995ee8ad71SAlex Williamson	$(datadir)/pxe-rtl8139.rom \
4005ee8ad71SAlex Williamson	$(datadir)/pxe-virtio.rom \
4011f50f8d1Sbellard	$(docdir)/qemu-doc.html \
4021f50f8d1Sbellard	$(docdir)/qemu-tech.html \
40340e8a53bSaurel32	$(mandir)/man1/qemu.1 \
40440e8a53bSaurel32	$(mandir)/man1/qemu-img.1 \
4057a5ca864Sbellard	$(mandir)/man8/qemu-nbd.8
406d691f669Sbellard
4074fb240a4Sbellard# Include automatically generated dependency files
40848ff7a62SMichael Roth-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
409