Statistics
| Branch: | Revision:

root / Makefile @ 67ed96f9

History | View | Annotate | Download (13.6 kB)

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