Statistics
| Branch: | Revision:

root / Makefile @ 48ff7a62

History | View | Annotate | Download (14.6 kB)

1 0cb3fb1e pbrook
# Makefile for QEMU.
2 0cb3fb1e pbrook
3 df2943ba Michael S. Tsirkin
GENERATED_HEADERS = config-host.h trace.h qemu-options.def
4 b3d08c02 Daniel P. Berrange
ifeq ($(TRACE_BACKEND),dtrace)
5 b3d08c02 Daniel P. Berrange
GENERATED_HEADERS += trace-dtrace.h
6 b3d08c02 Daniel P. Berrange
endif
7 f527c579 Juan Quintela
8 55d7e8f6 aurel32
ifneq ($(wildcard config-host.mak),)
9 1ad2134f Paul Brook
# Put the all: rule here so that config-host.mak can contain dependencies.
10 1ad2134f Paul Brook
all: build-all
11 ad064840 pbrook
include config-host.mak
12 17759187 aliguori
include $(SRC_PATH)/rules.mak
13 59bc10ee Paolo Bonzini
config-host.mak: $(SRC_PATH)/configure
14 e5efe7f5 Juan Quintela
	@echo $@ is out-of-date, running configure
15 e5efe7f5 Juan Quintela
	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
16 55d7e8f6 aurel32
else
17 55d7e8f6 aurel32
config-host.mak:
18 55d7e8f6 aurel32
	@echo "Please call configure before running make!"
19 55d7e8f6 aurel32
	@exit 1
20 55d7e8f6 aurel32
endif
21 766a487a bellard
22 d9ace8b3 Juan Quintela
# Don't try to regenerate Makefile or configure
23 d9ace8b3 Juan Quintela
# We don't generate any of them
24 d9ace8b3 Juan Quintela
Makefile: ;
25 d9ace8b3 Juan Quintela
configure: ;
26 d9ace8b3 Juan Quintela
27 818220f5 aliguori
.PHONY: all clean cscope distclean dvi html info install install-doc \
28 20cc9997 Stefan Weil
	pdf recurse-all speed tar tarbin test build-all
29 0cb3fb1e pbrook
30 076d2471 Paolo Bonzini
$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
31 8c462f8f pbrook
32 3e2e0e6b Juan Quintela
LIBS+=-lz $(LIBS_TOOLS)
33 67c0f08d Juan Quintela
34 cc8ae6de pbrook
ifdef BUILD_DOCS
35 b40292e7 Jan Kiszka
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
36 cc8ae6de pbrook
else
37 cc8ae6de pbrook
DOCS=
38 cc8ae6de pbrook
endif
39 aa05ae6f bellard
40 1215c6e7 Juan Quintela
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
41 1f3d3c8f Juan Quintela
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
42 bd9141bb Paul Brook
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
43 1f3d3c8f Juan Quintela
44 1f3d3c8f Juan Quintela
config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
45 01d86a85 Stefan Weil
	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
46 1f3d3c8f Juan Quintela
47 bd9141bb Paul Brook
-include $(SUBDIR_DEVICES_MAK_DEP)
48 bd9141bb Paul Brook
49 a992fe3d Paul Brook
%/config-devices.mak: default-configs/%.mak
50 4c3b5a48 Blue Swirl
	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
51 012f0879 Stefan Weil
	@if test -f $@; then \
52 904fe1fb Blue Swirl
	  if cmp -s $@.old $@; then \
53 bd9141bb Paul Brook
	    mv $@.tmp $@; \
54 bd9141bb Paul Brook
	    cp -p $@ $@.old; \
55 012f0879 Stefan Weil
	  else \
56 012f0879 Stefan Weil
	    if test -f $@.old; then \
57 012f0879 Stefan Weil
	      echo "WARNING: $@ (user modified) out of date.";\
58 012f0879 Stefan Weil
	    else \
59 012f0879 Stefan Weil
	      echo "WARNING: $@ out of date.";\
60 012f0879 Stefan Weil
	    fi; \
61 012f0879 Stefan Weil
	    echo "Run \"make defconfig\" to regenerate."; \
62 012f0879 Stefan Weil
	    rm $@.tmp; \
63 012f0879 Stefan Weil
	  fi; \
64 a992fe3d Paul Brook
	 else \
65 012f0879 Stefan Weil
	  mv $@.tmp $@; \
66 012f0879 Stefan Weil
	  cp -p $@ $@.old; \
67 a992fe3d Paul Brook
	 fi
68 a992fe3d Paul Brook
69 a992fe3d Paul Brook
defconfig:
70 a992fe3d Paul Brook
	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
71 a992fe3d Paul Brook
72 1f3d3c8f Juan Quintela
-include config-all-devices.mak
73 1215c6e7 Juan Quintela
74 f527c579 Juan Quintela
build-all: $(DOCS) $(TOOLS) recurse-all
75 b9dea4fb pbrook
76 1215c6e7 Juan Quintela
config-host.h: config-host.h-timestamp
77 1215c6e7 Juan Quintela
config-host.h-timestamp: config-host.mak
78 e14056ad Blue Swirl
qemu-options.def: $(SRC_PATH)/qemu-options.hx
79 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
80 1215c6e7 Juan Quintela
81 cec7d0b6 pbrook
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
82 cec7d0b6 pbrook
83 f527c579 Juan Quintela
subdir-%: $(GENERATED_HEADERS)
84 0087375e Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
85 4aa42531 pbrook
86 b88bc808 Stefan Weil
ifneq ($(wildcard config-host.mak),)
87 0e8c9214 Andreas Färber
include $(SRC_PATH)/Makefile.objs
88 b88bc808 Stefan Weil
endif
89 0e8c9214 Andreas Färber
90 0e8c9214 Andreas Färber
$(common-obj-y): $(GENERATED_HEADERS)
91 6774e44a Paolo Bonzini
subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-malloc.o qemu-timer-common.o
92 6774e44a Paolo Bonzini
93 91f16900 Andreas Färber
$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
94 c05ac895 Paul Brook
95 91f16900 Andreas Färber
$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
96 add16157 Blue Swirl
97 c05ac895 Paul Brook
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
98 c05ac895 Paul Brook
romsubdir-%:
99 c05ac895 Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
100 c05ac895 Paul Brook
101 c05ac895 Paul Brook
ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
102 c05ac895 Paul Brook
103 c05ac895 Paul Brook
recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
104 83f64091 bellard
105 98b068a9 Juan Quintela
audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
106 0e22fd2f Juan Quintela
107 a558ee17 Juan Quintela
QEMU_CFLAGS+=$(CURL_CFLAGS)
108 769ce76d Alexander Graf
109 e18df141 Anthony Liguori
QEMU_CFLAGS+=$(GLIB_CFLAGS)
110 e18df141 Anthony Liguori
111 3e230dd2 Corentin Chary
ui/cocoa.o: ui/cocoa.m
112 4fb240a4 bellard
113 3e230dd2 Corentin Chary
ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
114 0483755a aliguori
115 3e230dd2 Corentin Chary
ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
116 fb599c9a balrog
117 a558ee17 Juan Quintela
bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
118 4fb240a4 bellard
119 9fe6de94 Blue Swirl
version.o: $(SRC_PATH)/version.rc config-host.mak
120 9fe6de94 Blue Swirl
	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
121 9fe6de94 Blue Swirl
122 9fe6de94 Blue Swirl
version-obj-$(CONFIG_WIN32) += version.o
123 4fb240a4 bellard
######################################################################
124 44dc0ca3 Alon Levy
# Support building shared library libcacard
125 44dc0ca3 Alon Levy
126 44dc0ca3 Alon Levy
.PHONY: libcacard.la install-libcacard
127 44dc0ca3 Alon Levy
ifeq ($(LIBTOOL),)
128 44dc0ca3 Alon Levy
libcacard.la:
129 44dc0ca3 Alon Levy
	@echo "libtool is missing, please install and rerun configure"; exit 1
130 44dc0ca3 Alon Levy
131 44dc0ca3 Alon Levy
install-libcacard:
132 44dc0ca3 Alon Levy
	@echo "libtool is missing, please install and rerun configure"; exit 1
133 44dc0ca3 Alon Levy
else
134 44dc0ca3 Alon Levy
libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
135 44dc0ca3 Alon Levy
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
136 44dc0ca3 Alon Levy
137 44dc0ca3 Alon Levy
install-libcacard: libcacard.la
138 44dc0ca3 Alon Levy
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
139 44dc0ca3 Alon Levy
endif
140 44dc0ca3 Alon Levy
######################################################################
141 4fb240a4 bellard
142 3c089e15 Juan Quintela
qemu-img.o: qemu-img-cmds.h
143 48ff7a62 Michael Roth
qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
144 153859be Stuart Brady
145 c1b0b93b Jes Sorensen
qemu-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
146 0e8c9214 Andreas Färber
147 c1b0b93b Jes Sorensen
qemu-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
148 0e8c9214 Andreas Färber
149 c1b0b93b Jes Sorensen
qemu-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
150 0a8e1acd aliguori
151 153859be Stuart Brady
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
152 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
153 153859be Stuart Brady
154 4091da4b Jan Kiszka
check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o: $(GENERATED_HEADERS)
155 4091da4b Jan Kiszka
156 ef749d07 Anthony Liguori
CHECK_PROG_DEPS = qemu-malloc.o $(oslib-obj-y) $(trace-obj-y) qemu-tool.o
157 e71e00ed Luiz Capitulino
158 e71e00ed Luiz Capitulino
check-qint: check-qint.o qint.o $(CHECK_PROG_DEPS)
159 e71e00ed Luiz Capitulino
check-qstring: check-qstring.o qstring.o $(CHECK_PROG_DEPS)
160 e71e00ed Luiz Capitulino
check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(CHECK_PROG_DEPS)
161 e71e00ed Luiz Capitulino
check-qlist: check-qlist.o qlist.o qint.o $(CHECK_PROG_DEPS)
162 e71e00ed Luiz Capitulino
check-qfloat: check-qfloat.o qfloat.o $(CHECK_PROG_DEPS)
163 ef749d07 Anthony Liguori
check-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)
164 33837ba6 Luiz Capitulino
165 640e5404 Michael Roth
$(qapi-obj-y): $(GENERATED_HEADERS)
166 640e5404 Michael Roth
qapi-dir := qapi-generated
167 69ed8366 Michael Roth
test-visitor.o test-qmp-commands.o: QEMU_CFLAGS += -I $(qapi-dir)
168 640e5404 Michael Roth
169 640e5404 Michael Roth
$(qapi-dir)/test-qapi-types.c: $(qapi-dir)/test-qapi-types.h
170 640e5404 Michael Roth
$(qapi-dir)/test-qapi-types.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
171 640e5404 Michael Roth
	$(call quiet-command,python $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
172 640e5404 Michael Roth
$(qapi-dir)/test-qapi-visit.c: $(qapi-dir)/test-qapi-visit.h
173 640e5404 Michael Roth
$(qapi-dir)/test-qapi-visit.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
174 640e5404 Michael Roth
	$(call quiet-command,python $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
175 69ed8366 Michael Roth
$(qapi-dir)/test-qmp-commands.h: $(qapi-dir)/test-qmp-marshal.c
176 69ed8366 Michael Roth
$(qapi-dir)/test-qmp-marshal.c: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
177 69ed8366 Michael Roth
	    $(call quiet-command,python $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
178 640e5404 Michael Roth
179 640e5404 Michael Roth
test-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
180 640e5404 Michael Roth
test-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
181 640e5404 Michael Roth
182 69ed8366 Michael Roth
test-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)
183 69ed8366 Michael Roth
test-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
184 69ed8366 Michael Roth
185 13a286d5 Michael Roth
QGALIB=qga/guest-agent-command-state.o
186 13a286d5 Michael Roth
187 48ff7a62 Michael Roth
qemu-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
188 48ff7a62 Michael Roth
189 111a38b0 Robert Relyea
QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
190 111a38b0 Robert Relyea
191 31e31b8a bellard
clean:
192 2d80ae89 bellard
# avoid old build problems by removing potentially incorrect old files
193 25be210f Juan 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
194 df2943ba Michael S. Tsirkin
	rm -f qemu-options.def
195 48ff7a62 Michael Roth
	rm -f *.o *.d *.a *.lo $(TOOLS) qemu-ga TAGS cscope.* *.pod *~ */*~
196 44dc0ca3 Alon Levy
	rm -Rf .libs
197 13a286d5 Michael 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
198 07b44ce9 Blue Swirl
	rm -f qemu-img-cmds.h
199 d7489b72 Blue Swirl
	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
200 b3d08c02 Daniel P. Berrange
	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
201 b3d08c02 Daniel P. Berrange
	rm -f trace-dtrace.h trace-dtrace.h-timestamp
202 640e5404 Michael Roth
	rm -rf $(qapi-dir)
203 7d3505c5 bellard
	$(MAKE) -C tests clean
204 111a38b0 Robert Relyea
	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
205 fc8e320e Magnus Damm
	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
206 df2943ba Michael S. Tsirkin
	rm -f $$d/qemu-options.def; \
207 626df76a bellard
        done
208 31e31b8a bellard
209 7d13299d bellard
distclean: clean
210 fc8e320e Magnus Damm
	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
211 a992fe3d Paul Brook
	rm -f config-all-devices.mak
212 fc8e320e Magnus Damm
	rm -f roms/seabios/config.mak roms/vgabios/config.mak
213 7a734b8f Brad Hards
	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
214 7a734b8f Brad Hards
	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
215 7a734b8f Brad Hards
	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
216 7a734b8f Brad Hards
	rm -f qemu-doc.vr
217 e1a068b2 Hidetoshi 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
218 111a38b0 Robert Relyea
	for d in $(TARGET_DIRS) $(QEMULIBS); do \
219 bc1b050d bellard
	rm -rf $$d || exit 1 ; \
220 76bc6838 bellard
        done
221 7d13299d bellard
222 fed4a9ad bellard
KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
223 fed4a9ad bellard
ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
224 fed4a9ad bellard
common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
225 fed4a9ad bellard
226 77755340 ths
ifdef INSTALL_BLOBS
227 3b3d448e Gerd Hoffmann
BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin \
228 7943a2fa Gerd Hoffmann
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
229 3b3d448e Gerd Hoffmann
ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
230 5ee8ad71 Alex Williamson
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
231 5ee8ad71 Alex Williamson
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
232 00914b7d Michal Simek
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
233 fbd659b7 Alexander Graf
mpc8544ds.dtb \
234 fe270d04 Alexander Graf
multiboot.bin linuxboot.bin \
235 39ac8455 David Gibson
s390-zipl.rom \
236 a9f8ad8f David Gibson
spapr-rtas.bin slof.bin
237 77755340 ths
else
238 77755340 ths
BLOBS=
239 77755340 ths
endif
240 77755340 ths
241 38954dca pbrook
install-doc: $(DOCS)
242 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
243 58f8aead aliguori
	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
244 96d409eb Juan Quintela
ifdef CONFIG_POSIX
245 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
246 58f8aead aliguori
	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
247 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
248 58f8aead aliguori
	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
249 38954dca pbrook
endif
250 38954dca pbrook
251 b5ec5ce0 john cooper
install-sysconfig:
252 990caaf1 Andre Przywara
	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
253 990caaf1 Andre Przywara
	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
254 b5ec5ce0 john cooper
255 b5ec5ce0 john cooper
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
256 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
257 932a79df ths
ifneq ($(TOOLS),)
258 58f8aead aliguori
	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
259 932a79df ths
endif
260 77755340 ths
ifneq ($(BLOBS),)
261 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
262 77755340 ths
	set -e; for x in $(BLOBS); do \
263 58f8aead aliguori
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
264 ad064840 pbrook
	done
265 77755340 ths
endif
266 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
267 18be8d77 blueswir1
	set -e; for x in $(KEYMAPS); do \
268 79fd42aa Anthony Liguori
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
269 ad064840 pbrook
	done
270 626df76a bellard
	for d in $(TARGET_DIRS); do \
271 7d3505c5 bellard
	$(MAKE) -C $$d $@ || exit 1 ; \
272 626df76a bellard
        done
273 612384d7 bellard
274 367e86e8 bellard
# various test targets
275 9b0b8203 bellard
test speed: all
276 7d3505c5 bellard
	$(MAKE) -C tests $@
277 31e31b8a bellard
278 21d4e8e3 Alexandre Bique
.PHONY: TAGS
279 5fafdf24 ths
TAGS:
280 21d4e8e3 Alexandre Bique
	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
281 31e31b8a bellard
282 6688bc6d bellard
cscope:
283 6688bc6d bellard
	rm -f ./cscope.*
284 ede46085 aurel32
	find . -name "*.[ch]" -print | sed 's,^\./,,' > ./cscope.files
285 6688bc6d bellard
	cscope -b
286 6688bc6d bellard
287 3ef693a0 bellard
# documentation
288 01668d98 Stefan Weil
MAKEINFO=makeinfo
289 01668d98 Stefan Weil
MAKEINFOFLAGS=--no-headers --no-split --number-sections
290 20cc9997 Stefan Weil
TEXIFLAG=$(if $(V),,--quiet)
291 20cc9997 Stefan Weil
%.dvi: %.texi
292 20cc9997 Stefan Weil
	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
293 20cc9997 Stefan Weil
294 1f673135 bellard
%.html: %.texi
295 01668d98 Stefan Weil
	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
296 01668d98 Stefan Weil
	"  GEN   $@")
297 3ef693a0 bellard
298 f3548328 bellard
%.info: %.texi
299 01668d98 Stefan Weil
	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
300 f3548328 bellard
301 20cc9997 Stefan Weil
%.pdf: %.texi
302 20cc9997 Stefan Weil
	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
303 5824d651 blueswir1
304 5824d651 blueswir1
qemu-options.texi: $(SRC_PATH)/qemu-options.hx
305 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
306 f3548328 bellard
307 acd0a093 Luiz Capitulino
qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
308 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
309 2313086a Blue Swirl
310 82a56f0d Luiz Capitulino
QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
311 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
312 b40292e7 Jan Kiszka
313 153859be Stuart Brady
qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
314 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
315 153859be Stuart Brady
316 2313086a Blue Swirl
qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
317 0d00e563 aliguori
	$(call quiet-command, \
318 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
319 0d00e563 aliguori
	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
320 0d00e563 aliguori
	  "  GEN   $@")
321 5a67135a bellard
322 153859be Stuart Brady
qemu-img.1: qemu-img.texi qemu-img-cmds.texi
323 0d00e563 aliguori
	$(call quiet-command, \
324 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
325 0d00e563 aliguori
	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
326 0d00e563 aliguori
	  "  GEN   $@")
327 acd935ef bellard
328 7a5ca864 bellard
qemu-nbd.8: qemu-nbd.texi
329 0d00e563 aliguori
	$(call quiet-command, \
330 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
331 0d00e563 aliguori
	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
332 0d00e563 aliguori
	  "  GEN   $@")
333 7a5ca864 bellard
334 0cb3fb1e pbrook
dvi: qemu-doc.dvi qemu-tech.dvi
335 0cb3fb1e pbrook
html: qemu-doc.html qemu-tech.html
336 20cc9997 Stefan Weil
info: qemu-doc.info qemu-tech.info
337 20cc9997 Stefan Weil
pdf: qemu-doc.pdf qemu-tech.pdf
338 0cb3fb1e pbrook
339 20cc9997 Stefan Weil
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
340 20cc9997 Stefan Weil
	qemu-img.texi qemu-nbd.texi qemu-options.texi \
341 20cc9997 Stefan Weil
	qemu-monitor.texi qemu-img-cmds.texi
342 818220f5 aliguori
343 df5cf721 ths
VERSION ?= $(shell cat VERSION)
344 df5cf721 ths
FILE = qemu-$(VERSION)
345 586314f2 bellard
346 1e43adfc bellard
# tar release (use 'make -k tar' on a checkouted tree)
347 586314f2 bellard
tar:
348 586314f2 bellard
	rm -rf /tmp/$(FILE)
349 1e43adfc bellard
	cp -r . /tmp/$(FILE)
350 99c6c082 aurel32
	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
351 586314f2 bellard
	rm -rf /tmp/$(FILE)
352 586314f2 bellard
353 4c0a6db0 Stuart Brady
SYSTEM_TARGETS=$(filter %-softmmu,$(TARGET_DIRS))
354 4c0a6db0 Stuart Brady
SYSTEM_PROGS=$(patsubst qemu-system-i386,qemu, \
355 4c0a6db0 Stuart Brady
             $(patsubst %-softmmu,qemu-system-%, \
356 4c0a6db0 Stuart Brady
             $(SYSTEM_TARGETS)))
357 4c0a6db0 Stuart Brady
358 4c0a6db0 Stuart Brady
USER_TARGETS=$(filter %-user,$(TARGET_DIRS))
359 4c0a6db0 Stuart Brady
USER_PROGS=$(patsubst %-bsd-user,qemu-%, \
360 4c0a6db0 Stuart Brady
           $(patsubst %-darwin-user,qemu-%, \
361 4c0a6db0 Stuart Brady
           $(patsubst %-linux-user,qemu-%, \
362 4c0a6db0 Stuart Brady
           $(USER_TARGETS))))
363 4c0a6db0 Stuart Brady
364 76b62fd0 bellard
# generate a binary distribution
365 d691f669 bellard
tarbin:
366 18be8d77 blueswir1
	cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
367 4c0a6db0 Stuart Brady
	$(patsubst %,$(bindir)/%, $(SYSTEM_PROGS)) \
368 4c0a6db0 Stuart Brady
	$(patsubst %,$(bindir)/%, $(USER_PROGS)) \
369 40e8a53b aurel32
	$(bindir)/qemu-img \
370 40e8a53b aurel32
	$(bindir)/qemu-nbd \
371 7efa4387 bellard
	$(datadir)/bios.bin \
372 7efa4387 bellard
	$(datadir)/vgabios.bin \
373 de9258a8 bellard
	$(datadir)/vgabios-cirrus.bin \
374 637f6cd7 bellard
	$(datadir)/ppc_rom.bin \
375 0986ac3b bellard
	$(datadir)/openbios-sparc32 \
376 938255d2 blueswir1
	$(datadir)/openbios-sparc64 \
377 e5d01b06 aurel32
	$(datadir)/openbios-ppc \
378 5ee8ad71 Alex Williamson
	$(datadir)/pxe-e1000.rom \
379 5ee8ad71 Alex Williamson
	$(datadir)/pxe-eepro100.rom \
380 5ee8ad71 Alex Williamson
	$(datadir)/pxe-ne2k_pci.rom \
381 5ee8ad71 Alex Williamson
	$(datadir)/pxe-pcnet.rom \
382 5ee8ad71 Alex Williamson
	$(datadir)/pxe-rtl8139.rom \
383 5ee8ad71 Alex Williamson
	$(datadir)/pxe-virtio.rom \
384 1f50f8d1 bellard
	$(docdir)/qemu-doc.html \
385 1f50f8d1 bellard
	$(docdir)/qemu-tech.html \
386 40e8a53b aurel32
	$(mandir)/man1/qemu.1 \
387 40e8a53b aurel32
	$(mandir)/man1/qemu-img.1 \
388 7a5ca864 bellard
	$(mandir)/man8/qemu-nbd.8
389 d691f669 bellard
390 4fb240a4 bellard
# Include automatically generated dependency files
391 48ff7a62 Michael Roth
-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)