xref: /qemu/Makefile (revision 793553ac)
10cb3fb1eSpbrook# Makefile for QEMU.
20cb3fb1eSpbrook
3df2943baSMichael S. TsirkinGENERATED_HEADERS = config-host.h trace.h qemu-options.def
4b3d08c02SDaniel P. Berrangeifeq ($(TRACE_BACKEND),dtrace)
5b3d08c02SDaniel P. BerrangeGENERATED_HEADERS += trace-dtrace.h
6b3d08c02SDaniel P. Berrangeendif
7f527c579SJuan Quintela
855d7e8f6Saurel32ifneq ($(wildcard config-host.mak),)
91ad2134fSPaul Brook# Put the all: rule here so that config-host.mak can contain dependencies.
101ad2134fSPaul Brookall: build-all
11ad064840Spbrookinclude config-host.mak
1217759187Saliguoriinclude $(SRC_PATH)/rules.mak
1359bc10eeSPaolo Bonziniconfig-host.mak: $(SRC_PATH)/configure
14e5efe7f5SJuan Quintela	@echo $@ is out-of-date, running configure
15e5efe7f5SJuan Quintela	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
1655d7e8f6Saurel32else
1755d7e8f6Saurel32config-host.mak:
1855d7e8f6Saurel32	@echo "Please call configure before running make!"
1955d7e8f6Saurel32	@exit 1
2055d7e8f6Saurel32endif
21766a487aSbellard
22d9ace8b3SJuan Quintela# Don't try to regenerate Makefile or configure
23d9ace8b3SJuan Quintela# We don't generate any of them
24d9ace8b3SJuan QuintelaMakefile: ;
25d9ace8b3SJuan Quintelaconfigure: ;
26d9ace8b3SJuan Quintela
27818220f5Saliguori.PHONY: all clean cscope distclean dvi html info install install-doc \
2820cc9997SStefan Weil	pdf recurse-all speed tar tarbin test build-all
290cb3fb1eSpbrook
30076d2471SPaolo Bonzini$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
318c462f8fSpbrook
323e2e0e6bSJuan QuintelaLIBS+=-lz $(LIBS_TOOLS)
3367c0f08dSJuan Quintela
34cc8ae6deSpbrookifdef BUILD_DOCS
35b40292e7SJan KiszkaDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
36cc8ae6deSpbrookelse
37cc8ae6deSpbrookDOCS=
38cc8ae6deSpbrookendif
397d13299dSbellard
401215c6e7SJuan QuintelaSUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
411f3d3c8fSJuan QuintelaSUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
42bd9141bbSPaul BrookSUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
431f3d3c8fSJuan Quintela
441f3d3c8fSJuan Quintelaconfig-all-devices.mak: $(SUBDIR_DEVICES_MAK)
4501d86a85SStefan Weil	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
461f3d3c8fSJuan Quintela
47bd9141bbSPaul Brook-include $(SUBDIR_DEVICES_MAK_DEP)
48bd9141bbSPaul Brook
49a992fe3dSPaul Brook%/config-devices.mak: default-configs/%.mak
504c3b5a48SBlue Swirl	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
51a992fe3dSPaul Brook	@if test -f $@; then \
52904fe1fbSBlue Swirl	  if cmp -s $@.old $@; then \
53012f0879SStefan Weil	    mv $@.tmp $@; \
54012f0879SStefan Weil	    cp -p $@ $@.old; \
55012f0879SStefan Weil	  else \
56012f0879SStefan Weil	    if test -f $@.old; then \
57012f0879SStefan Weil	      echo "WARNING: $@ (user modified) out of date.";\
58012f0879SStefan Weil	    else \
59a992fe3dSPaul Brook	      echo "WARNING: $@ out of date.";\
60012f0879SStefan Weil	    fi; \
6163e86b2eSStefan Weil	    echo "Run \"make defconfig\" to regenerate."; \
62a992fe3dSPaul Brook	    rm $@.tmp; \
63012f0879SStefan Weil	  fi; \
64a992fe3dSPaul Brook	 else \
65a992fe3dSPaul Brook	  mv $@.tmp $@; \
66012f0879SStefan Weil	  cp -p $@ $@.old; \
67a992fe3dSPaul Brook	 fi
68a992fe3dSPaul Brook
69a992fe3dSPaul Brookdefconfig:
70a992fe3dSPaul Brook	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
71a992fe3dSPaul Brook
721f3d3c8fSJuan Quintela-include config-all-devices.mak
731215c6e7SJuan Quintela
74f527c579SJuan Quintelabuild-all: $(DOCS) $(TOOLS) recurse-all
75b9dea4fbSpbrook
761215c6e7SJuan Quintelaconfig-host.h: config-host.h-timestamp
771215c6e7SJuan Quintelaconfig-host.h-timestamp: config-host.mak
78e14056adSBlue Swirlqemu-options.def: $(SRC_PATH)/qemu-options.hx
794c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
801215c6e7SJuan Quintela
81cec7d0b6SpbrookSUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
82cec7d0b6Spbrook
83f527c579SJuan Quintelasubdir-%: $(GENERATED_HEADERS)
840087375eSPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
854aa42531Spbrook
86b88bc808SStefan Weilifneq ($(wildcard config-host.mak),)
870e8c9214SAndreas Färberinclude $(SRC_PATH)/Makefile.objs
88b88bc808SStefan Weilendif
890e8c9214SAndreas Färber
900e8c9214SAndreas Färber$(common-obj-y): $(GENERATED_HEADERS)
916774e44aSPaolo Bonzinisubdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-malloc.o qemu-timer-common.o
926774e44aSPaolo Bonzini
9391f16900SAndreas Färber$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
94c05ac895SPaul Brook
9591f16900SAndreas Färber$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
96add16157SBlue Swirl
97c05ac895SPaul BrookROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
98c05ac895SPaul Brookromsubdir-%:
99c05ac895SPaul Brook	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
100c05ac895SPaul Brook
101c05ac895SPaul BrookALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
102c05ac895SPaul Brook
103c05ac895SPaul Brookrecurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
1044aa42531Spbrook
10598b068a9SJuan Quintelaaudio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
1060e22fd2fSJuan Quintela
107a558ee17SJuan QuintelaQEMU_CFLAGS+=$(CURL_CFLAGS)
108769ce76dSAlexander Graf
109e18df141SAnthony LiguoriQEMU_CFLAGS+=$(GLIB_CFLAGS)
110e18df141SAnthony Liguori
1113e230dd2SCorentin Charyui/cocoa.o: ui/cocoa.m
1124fb240a4Sbellard
1133e230dd2SCorentin Charyui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
1140483755aSaliguori
1153e230dd2SCorentin Charyui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
1164d3b6f6eSbalrog
117a558ee17SJuan Quintelabt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
1184fb240a4Sbellard
1199fe6de94SBlue Swirlversion.o: $(SRC_PATH)/version.rc config-host.mak
1209fe6de94SBlue Swirl	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
1219fe6de94SBlue Swirl
1229fe6de94SBlue Swirlversion-obj-$(CONFIG_WIN32) += version.o
1234fb240a4Sbellard######################################################################
12444dc0ca3SAlon Levy# Support building shared library libcacard
12544dc0ca3SAlon Levy
12644dc0ca3SAlon Levy.PHONY: libcacard.la install-libcacard
12744dc0ca3SAlon Levyifeq ($(LIBTOOL),)
12844dc0ca3SAlon Levylibcacard.la:
12944dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
13044dc0ca3SAlon Levy
13144dc0ca3SAlon Levyinstall-libcacard:
13244dc0ca3SAlon Levy	@echo "libtool is missing, please install and rerun configure"; exit 1
13344dc0ca3SAlon Levyelse
13444dc0ca3SAlon Levylibcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
13544dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
13644dc0ca3SAlon Levy
13744dc0ca3SAlon Levyinstall-libcacard: libcacard.la
13844dc0ca3SAlon Levy	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
13944dc0ca3SAlon Levyendif
14044dc0ca3SAlon Levy######################################################################
1414fb240a4Sbellard
1423c089e15SJuan Quintelaqemu-img.o: qemu-img-cmds.h
14348ff7a62SMichael Rothqemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
144153859beSStuart Brady
145c1b0b93bSJes 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
1464fb240a4Sbellard
147c1b0b93bSJes 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
1483aa892d7Saliguori
149c1b0b93bSJes 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
1500a8e1acdSaliguori
151153859beSStuart Bradyqemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
1524c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
153153859beSStuart Brady
1544091da4bSJan Kiszkacheck-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o: $(GENERATED_HEADERS)
1554091da4bSJan Kiszka
156ef749d07SAnthony LiguoriCHECK_PROG_DEPS = qemu-malloc.o $(oslib-obj-y) $(trace-obj-y) qemu-tool.o
157e71e00edSLuiz Capitulino
158e71e00edSLuiz Capitulinocheck-qint: check-qint.o qint.o $(CHECK_PROG_DEPS)
159e71e00edSLuiz Capitulinocheck-qstring: check-qstring.o qstring.o $(CHECK_PROG_DEPS)
160e71e00edSLuiz Capitulinocheck-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(CHECK_PROG_DEPS)
161e71e00edSLuiz Capitulinocheck-qlist: check-qlist.o qlist.o qint.o $(CHECK_PROG_DEPS)
162e71e00edSLuiz Capitulinocheck-qfloat: check-qfloat.o qfloat.o $(CHECK_PROG_DEPS)
163ef749d07SAnthony 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)
16433837ba6SLuiz Capitulino
165640e5404SMichael Roth$(qapi-obj-y): $(GENERATED_HEADERS)
166640e5404SMichael Rothqapi-dir := qapi-generated
167e3d4d252SMichael Rothtest-visitor.o test-qmp-commands.o qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
168640e5404SMichael Roth
169640e5404SMichael Roth$(qapi-dir)/test-qapi-types.c: $(qapi-dir)/test-qapi-types.h
170640e5404SMichael Roth$(qapi-dir)/test-qapi-types.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
171c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
172640e5404SMichael Roth$(qapi-dir)/test-qapi-visit.c: $(qapi-dir)/test-qapi-visit.h
173640e5404SMichael Roth$(qapi-dir)/test-qapi-visit.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
174c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
17569ed8366SMichael Roth$(qapi-dir)/test-qmp-commands.h: $(qapi-dir)/test-qmp-marshal.c
17669ed8366SMichael Roth$(qapi-dir)/test-qmp-marshal.c: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
177c886edfbSBlue Swirl	    $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
178640e5404SMichael Roth
179e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-types.c: $(qapi-dir)/qga-qapi-types.h
180e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-types.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
181c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
182e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-visit.c: $(qapi-dir)/qga-qapi-visit.h
183e3d4d252SMichael Roth$(qapi-dir)/qga-qapi-visit.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
184c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
185e3d4d252SMichael Roth$(qapi-dir)/qga-qmp-marshal.c: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
186c886edfbSBlue Swirl	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
187e3d4d252SMichael Roth
188640e5404SMichael 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)
189640e5404SMichael Rothtest-visitor: test-visitor.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.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
190640e5404SMichael Roth
19169ed8366SMichael 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)
19269ed8366SMichael Rothtest-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 qemu-malloc.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
19369ed8366SMichael Roth
194e3d4d252SMichael RothQGALIB=qga/guest-agent-command-state.o qga/guest-agent-commands.o
195016c77adSMichael RothQGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c)
19613a286d5SMichael Roth
197016c77adSMichael Roth$(QGALIB_GEN): $(GENERATED_HEADERS)
198016c77adSMichael Roth$(QGALIB) qemu-ga.o: $(QGALIB_GEN) $(qapi-obj-y)
199e3d4d252SMichael Rothqemu-ga$(EXESUF): qemu-ga.o $(QGALIB) qemu-tool.o qemu-error.o error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) $(qapi-obj-y) qemu-timer-common.o qemu-sockets.o module.o qapi/qmp-dispatch.o qapi/qmp-registry.o $(qapi-dir)/qga-qapi-visit.o $(qapi-dir)/qga-qapi-types.o $(qapi-dir)/qga-qmp-marshal.o
20048ff7a62SMichael Roth
201111a38b0SRobert RelyeaQEMULIBS=libhw32 libhw64 libuser libdis libdis-user
202111a38b0SRobert Relyea
20331e31b8aSbellardclean:
2042d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
20525be210fSJuan 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
206df2943baSMichael S. Tsirkin	rm -f qemu-options.def
20748ff7a62SMichael Roth	rm -f *.o *.d *.a *.lo $(TOOLS) qemu-ga TAGS cscope.* *.pod *~ */*~
20844dc0ca3SAlon Levy	rm -Rf .libs
20913a286d5SMichael 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
21007b44ce9SBlue Swirl	rm -f qemu-img-cmds.h
211d7489b72SBlue Swirl	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
212b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
213b3d08c02SDaniel P. Berrange	rm -f trace-dtrace.h trace-dtrace.h-timestamp
214640e5404SMichael Roth	rm -rf $(qapi-dir)
2157d3505c5Sbellard	$(MAKE) -C tests clean
216111a38b0SRobert Relyea	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
217fc8e320eSMagnus Damm	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
218df2943baSMichael S. Tsirkin	rm -f $$d/qemu-options.def; \
219626df76aSbellard        done
22031e31b8aSbellard
2217d13299dSbellarddistclean: clean
222fc8e320eSMagnus Damm	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
223a992fe3dSPaul Brook	rm -f config-all-devices.mak
224fc8e320eSMagnus Damm	rm -f roms/seabios/config.mak roms/vgabios/config.mak
2257a734b8fSBrad Hards	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
2267a734b8fSBrad Hards	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
2277a734b8fSBrad Hards	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
2287a734b8fSBrad Hards	rm -f qemu-doc.vr
229*793553acSAlexandre Raymond	rm -f config.log
230e1a068b2SHidetoshi 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
231111a38b0SRobert Relyea	for d in $(TARGET_DIRS) $(QEMULIBS); do \
232bc1b050dSbellard	rm -rf $$d || exit 1 ; \
23376bc6838Sbellard        done
2347d13299dSbellard
235fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
236fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
237fed4a9adSbellardcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
238fed4a9adSbellard
23977755340Sthsifdef INSTALL_BLOBS
2403b3d448eSGerd HoffmannBLOBS=bios.bin vgabios.bin vgabios-cirrus.bin \
2417943a2faSGerd Hoffmannvgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
2423b3d448eSGerd Hoffmannppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
2435ee8ad71SAlex Williamsonpxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
2445ee8ad71SAlex Williamsonpxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
24500914b7dSMichal Simekbamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
246fbd659b7SAlexander Grafmpc8544ds.dtb \
247fe270d04SAlexander Grafmultiboot.bin linuxboot.bin \
24839ac8455SDavid Gibsons390-zipl.rom \
249a9f8ad8fSDavid Gibsonspapr-rtas.bin slof.bin
25077755340Sthselse
25177755340SthsBLOBS=
25277755340Sthsendif
25377755340Sths
25438954dcaSpbrookinstall-doc: $(DOCS)
25558f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
25658f8aeadSaliguori	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
25796d409ebSJuan Quintelaifdef CONFIG_POSIX
25858f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
25958f8aeadSaliguori	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
26058f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
26158f8aeadSaliguori	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
26238954dcaSpbrookendif
26338954dcaSpbrook
264b5ec5ce0Sjohn cooperinstall-sysconfig:
265990caaf1SAndre Przywara	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
266990caaf1SAndre Przywara	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
267b5ec5ce0Sjohn cooper
268b5ec5ce0Sjohn cooperinstall: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
26958f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
270932a79dfSthsifneq ($(TOOLS),)
27158f8aeadSaliguori	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
272932a79dfSthsendif
27377755340Sthsifneq ($(BLOBS),)
27458f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
27577755340Sths	set -e; for x in $(BLOBS); do \
27658f8aeadSaliguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
277ad064840Spbrook	done
27877755340Sthsendif
27958f8aeadSaliguori	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
28018be8d77Sblueswir1	set -e; for x in $(KEYMAPS); do \
28179fd42aaSAnthony Liguori		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
282ad064840Spbrook	done
283626df76aSbellard	for d in $(TARGET_DIRS); do \
2847d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
285626df76aSbellard        done
286612384d7Sbellard
287367e86e8Sbellard# various test targets
2889b0b8203Sbellardtest speed: all
2897d3505c5Sbellard	$(MAKE) -C tests $@
29031e31b8aSbellard
29121d4e8e3SAlexandre Bique.PHONY: TAGS
292367e86e8SbellardTAGS:
29321d4e8e3SAlexandre Bique	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
29431e31b8aSbellard
2956688bc6dSbellardcscope:
2966688bc6dSbellard	rm -f ./cscope.*
29745b75ae4SAlexandre Raymond	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
2986688bc6dSbellard	cscope -b
2996688bc6dSbellard
3003ef693a0Sbellard# documentation
30101668d98SStefan WeilMAKEINFO=makeinfo
30201668d98SStefan WeilMAKEINFOFLAGS=--no-headers --no-split --number-sections
30320cc9997SStefan WeilTEXIFLAG=$(if $(V),,--quiet)
30420cc9997SStefan Weil%.dvi: %.texi
30520cc9997SStefan Weil	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
30620cc9997SStefan Weil
3071f673135Sbellard%.html: %.texi
30801668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
30901668d98SStefan Weil	"  GEN   $@")
3103ef693a0Sbellard
311f3548328Sbellard%.info: %.texi
31201668d98SStefan Weil	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
313f3548328Sbellard
31420cc9997SStefan Weil%.pdf: %.texi
31520cc9997SStefan Weil	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
3165824d651Sblueswir1
3175824d651Sblueswir1qemu-options.texi: $(SRC_PATH)/qemu-options.hx
3184c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
319f3548328Sbellard
320acd0a093SLuiz Capitulinoqemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
3214c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
3222313086aSBlue Swirl
32382a56f0dSLuiz CapitulinoQMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
3244c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
325b40292e7SJan Kiszka
326153859beSStuart Bradyqemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
3274c3b5a48SBlue Swirl	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
328153859beSStuart Brady
3292313086aSBlue Swirlqemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
3300d00e563Saliguori	$(call quiet-command, \
3314c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
3320d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
3330d00e563Saliguori	  "  GEN   $@")
3345a67135aSbellard
335153859beSStuart Bradyqemu-img.1: qemu-img.texi qemu-img-cmds.texi
3360d00e563Saliguori	$(call quiet-command, \
3374c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
3380d00e563Saliguori	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
3390d00e563Saliguori	  "  GEN   $@")
340acd935efSbellard
3417a5ca864Sbellardqemu-nbd.8: qemu-nbd.texi
3420d00e563Saliguori	$(call quiet-command, \
3434c3b5a48SBlue Swirl	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
3440d00e563Saliguori	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
3450d00e563Saliguori	  "  GEN   $@")
3467a5ca864Sbellard
3470cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi
3480cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html
34920cc9997SStefan Weilinfo: qemu-doc.info qemu-tech.info
35020cc9997SStefan Weilpdf: qemu-doc.pdf qemu-tech.pdf
3510cb3fb1eSpbrook
35220cc9997SStefan Weilqemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
35320cc9997SStefan Weil	qemu-img.texi qemu-nbd.texi qemu-options.texi \
35420cc9997SStefan Weil	qemu-monitor.texi qemu-img-cmds.texi
355818220f5Saliguori
356df5cf721SthsVERSION ?= $(shell cat VERSION)
357df5cf721SthsFILE = qemu-$(VERSION)
358586314f2Sbellard
3591e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
360586314f2Sbellardtar:
361586314f2Sbellard	rm -rf /tmp/$(FILE)
3621e43adfcSbellard	cp -r . /tmp/$(FILE)
36399c6c082Saurel32	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
364586314f2Sbellard	rm -rf /tmp/$(FILE)
365586314f2Sbellard
3664c0a6db0SStuart BradySYSTEM_TARGETS=$(filter %-softmmu,$(TARGET_DIRS))
3674c0a6db0SStuart BradySYSTEM_PROGS=$(patsubst qemu-system-i386,qemu, \
3684c0a6db0SStuart Brady             $(patsubst %-softmmu,qemu-system-%, \
3694c0a6db0SStuart Brady             $(SYSTEM_TARGETS)))
3704c0a6db0SStuart Brady
3714c0a6db0SStuart BradyUSER_TARGETS=$(filter %-user,$(TARGET_DIRS))
3724c0a6db0SStuart BradyUSER_PROGS=$(patsubst %-bsd-user,qemu-%, \
3734c0a6db0SStuart Brady           $(patsubst %-darwin-user,qemu-%, \
3744c0a6db0SStuart Brady           $(patsubst %-linux-user,qemu-%, \
3754c0a6db0SStuart Brady           $(USER_TARGETS))))
3764c0a6db0SStuart Brady
37776b62fd0Sbellard# generate a binary distribution
378d691f669Sbellardtarbin:
37918be8d77Sblueswir1	cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
3804c0a6db0SStuart Brady	$(patsubst %,$(bindir)/%, $(SYSTEM_PROGS)) \
3814c0a6db0SStuart Brady	$(patsubst %,$(bindir)/%, $(USER_PROGS)) \
382b932cabaSbellard	$(bindir)/qemu-img \
3837a5ca864Sbellard	$(bindir)/qemu-nbd \
3847efa4387Sbellard	$(datadir)/bios.bin \
3857efa4387Sbellard	$(datadir)/vgabios.bin \
386de9258a8Sbellard	$(datadir)/vgabios-cirrus.bin \
387637f6cd7Sbellard	$(datadir)/ppc_rom.bin \
3880986ac3bSbellard	$(datadir)/openbios-sparc32 \
389938255d2Sblueswir1	$(datadir)/openbios-sparc64 \
390e5d01b06Saurel32	$(datadir)/openbios-ppc \
3915ee8ad71SAlex Williamson	$(datadir)/pxe-e1000.rom \
3925ee8ad71SAlex Williamson	$(datadir)/pxe-eepro100.rom \
3935ee8ad71SAlex Williamson	$(datadir)/pxe-ne2k_pci.rom \
3945ee8ad71SAlex Williamson	$(datadir)/pxe-pcnet.rom \
3955ee8ad71SAlex Williamson	$(datadir)/pxe-rtl8139.rom \
3965ee8ad71SAlex Williamson	$(datadir)/pxe-virtio.rom \
3971f50f8d1Sbellard	$(docdir)/qemu-doc.html \
3981f50f8d1Sbellard	$(docdir)/qemu-tech.html \
39940e8a53bSaurel32	$(mandir)/man1/qemu.1 \
40040e8a53bSaurel32	$(mandir)/man1/qemu-img.1 \
4017a5ca864Sbellard	$(mandir)/man8/qemu-nbd.8
402d691f669Sbellard
4034fb240a4Sbellard# Include automatically generated dependency files
40448ff7a62SMichael Roth-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
405