Statistics
| Branch: | Revision:

root / Makefile @ 0c1fecdd

History | View | Annotate | Download (15.5 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 250b086e Lluís Vilanova
# All following code might depend on configuration variables
7 55d7e8f6 aurel32
ifneq ($(wildcard config-host.mak),)
8 1ad2134f Paul Brook
# Put the all: rule here so that config-host.mak can contain dependencies.
9 8f67aa82 Stefan Weil
all:
10 ad064840 pbrook
include config-host.mak
11 d1bd2423 Peter Maydell
12 d1bd2423 Peter Maydell
# Check that we're not trying to do an out-of-tree build from
13 d1bd2423 Peter Maydell
# a tree that's been used for an in-tree build.
14 d1bd2423 Peter Maydell
ifneq ($(realpath $(SRC_PATH)),$(realpath .))
15 d1bd2423 Peter Maydell
ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
16 d1bd2423 Peter Maydell
$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
17 d1bd2423 Peter Maydell
seems to have been used for an in-tree build. You can fix this by running \
18 d1bd2423 Peter Maydell
"make distclean && rm -rf *-linux-user *-softmmu" in your source tree)
19 d1bd2423 Peter Maydell
endif
20 d1bd2423 Peter Maydell
endif
21 d1bd2423 Peter Maydell
22 f3aa844b Paolo Bonzini
CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
23 f3aa844b Paolo Bonzini
CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
24 f3aa844b Paolo Bonzini
CONFIG_ALL=y
25 f3aa844b Paolo Bonzini
-include config-all-devices.mak
26 f3aa844b Paolo Bonzini
-include config-all-disas.mak
27 f3aa844b Paolo Bonzini
28 17759187 aliguori
include $(SRC_PATH)/rules.mak
29 59bc10ee Paolo Bonzini
config-host.mak: $(SRC_PATH)/configure
30 e5efe7f5 Juan Quintela
	@echo $@ is out-of-date, running configure
31 e5efe7f5 Juan Quintela
	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
32 55d7e8f6 aurel32
else
33 55d7e8f6 aurel32
config-host.mak:
34 7748b8cb Mike Frysinger
ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
35 55d7e8f6 aurel32
	@echo "Please call configure before running make!"
36 55d7e8f6 aurel32
	@exit 1
37 55d7e8f6 aurel32
endif
38 7748b8cb Mike Frysinger
endif
39 766a487a bellard
40 eac236ea Lluís Vilanova
GENERATED_HEADERS = config-host.h qemu-options.def
41 eac236ea Lluís Vilanova
GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
42 eac236ea Lluís Vilanova
GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
43 eac236ea Lluís Vilanova
44 45be2f5d Lluís Vilanova
GENERATED_HEADERS += trace/generated-events.h
45 45be2f5d Lluís Vilanova
GENERATED_SOURCES += trace/generated-events.c
46 45be2f5d Lluís Vilanova
47 eac236ea Lluís Vilanova
GENERATED_HEADERS += trace/generated-tracers.h
48 250b086e Lluís Vilanova
ifeq ($(TRACE_BACKEND),dtrace)
49 eac236ea Lluís Vilanova
GENERATED_HEADERS += trace/generated-tracers-dtrace.h
50 250b086e Lluís Vilanova
endif
51 eac236ea Lluís Vilanova
GENERATED_SOURCES += trace/generated-tracers.c
52 250b086e Lluís Vilanova
53 d9ace8b3 Juan Quintela
# Don't try to regenerate Makefile or configure
54 d9ace8b3 Juan Quintela
# We don't generate any of them
55 d9ace8b3 Juan Quintela
Makefile: ;
56 d9ace8b3 Juan Quintela
configure: ;
57 d9ace8b3 Juan Quintela
58 818220f5 aliguori
.PHONY: all clean cscope distclean dvi html info install install-doc \
59 34bb443e Anthony Liguori
	pdf recurse-all speed test dist
60 0cb3fb1e pbrook
61 fec90ff0 Paolo Bonzini
$(call set-vpath, $(SRC_PATH))
62 8c462f8f pbrook
63 3e2e0e6b Juan Quintela
LIBS+=-lz $(LIBS_TOOLS)
64 67c0f08d Juan Quintela
65 7b93fadf Corey Bryant
HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
66 7b93fadf Corey Bryant
67 cc8ae6de pbrook
ifdef BUILD_DOCS
68 b40292e7 Jan Kiszka
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
69 983eef5a Meador Inge
ifdef CONFIG_VIRTFS
70 a2d8f1be M. Mohan Kumar
DOCS+=fsdev/virtfs-proxy-helper.1
71 983eef5a Meador Inge
endif
72 cc8ae6de pbrook
else
73 cc8ae6de pbrook
DOCS=
74 cc8ae6de pbrook
endif
75 aa05ae6f bellard
76 388d4758 Lluís Vilanova
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
77 1f3d3c8f Juan Quintela
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
78 88070801 Andreas Färber
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
79 1f3d3c8f Juan Quintela
80 8bdd3d49 Stefan Weil
ifeq ($(SUBDIR_DEVICES_MAK),)
81 8bdd3d49 Stefan Weil
config-all-devices.mak:
82 8bdd3d49 Stefan Weil
	$(call quiet-command,echo '# no devices' > $@,"  GEN   $@")
83 8bdd3d49 Stefan Weil
else
84 1f3d3c8f Juan Quintela
config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
85 bb585a78 Paolo Bonzini
	$(call quiet-command, sed -n \
86 bb585a78 Paolo Bonzini
             's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
87 bb585a78 Paolo Bonzini
             $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
88 bb585a78 Paolo Bonzini
             "  GEN   $@")
89 8bdd3d49 Stefan Weil
endif
90 1f3d3c8f Juan Quintela
91 bd9141bb Paul Brook
-include $(SUBDIR_DEVICES_MAK_DEP)
92 bd9141bb Paul Brook
93 a992fe3d Paul Brook
%/config-devices.mak: default-configs/%.mak
94 4c3b5a48 Blue Swirl
	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
95 012f0879 Stefan Weil
	@if test -f $@; then \
96 904fe1fb Blue Swirl
	  if cmp -s $@.old $@; then \
97 bd9141bb Paul Brook
	    mv $@.tmp $@; \
98 bd9141bb Paul Brook
	    cp -p $@ $@.old; \
99 012f0879 Stefan Weil
	  else \
100 012f0879 Stefan Weil
	    if test -f $@.old; then \
101 012f0879 Stefan Weil
	      echo "WARNING: $@ (user modified) out of date.";\
102 012f0879 Stefan Weil
	    else \
103 012f0879 Stefan Weil
	      echo "WARNING: $@ out of date.";\
104 012f0879 Stefan Weil
	    fi; \
105 012f0879 Stefan Weil
	    echo "Run \"make defconfig\" to regenerate."; \
106 012f0879 Stefan Weil
	    rm $@.tmp; \
107 012f0879 Stefan Weil
	  fi; \
108 a992fe3d Paul Brook
	 else \
109 012f0879 Stefan Weil
	  mv $@.tmp $@; \
110 012f0879 Stefan Weil
	  cp -p $@ $@.old; \
111 a992fe3d Paul Brook
	 fi
112 a992fe3d Paul Brook
113 a992fe3d Paul Brook
defconfig:
114 a992fe3d Paul Brook
	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
115 a992fe3d Paul Brook
116 992aeb8e Paolo Bonzini
ifneq ($(wildcard config-host.mak),)
117 992aeb8e Paolo Bonzini
include $(SRC_PATH)/Makefile.objs
118 992aeb8e Paolo Bonzini
include $(SRC_PATH)/tests/Makefile
119 992aeb8e Paolo Bonzini
endif
120 992aeb8e Paolo Bonzini
ifeq ($(CONFIG_SMARTCARD_NSS),y)
121 992aeb8e Paolo Bonzini
include $(SRC_PATH)/libcacard/Makefile
122 992aeb8e Paolo Bonzini
endif
123 992aeb8e Paolo Bonzini
124 8f67aa82 Stefan Weil
all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
125 b9dea4fb pbrook
126 1215c6e7 Juan Quintela
config-host.h: config-host.h-timestamp
127 1215c6e7 Juan Quintela
config-host.h-timestamp: config-host.mak
128 e14056ad Blue Swirl
qemu-options.def: $(SRC_PATH)/qemu-options.hx
129 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
130 1215c6e7 Juan Quintela
131 cec7d0b6 pbrook
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
132 916359f6 Andreas Färber
SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
133 916359f6 Andreas Färber
134 916359f6 Andreas Färber
$(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
135 cec7d0b6 pbrook
136 4115852b Paolo Bonzini
subdir-%:
137 0087375e Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
138 4aa42531 pbrook
139 e2134eb9 Gerd Hoffmann
subdir-pixman: pixman/Makefile
140 e2134eb9 Gerd Hoffmann
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pixman V="$(V)" all,)
141 e2134eb9 Gerd Hoffmann
142 e2134eb9 Gerd Hoffmann
pixman/Makefile: $(SRC_PATH)/pixman/configure
143 f9943cd5 Gerd Hoffmann
	(cd pixman; CFLAGS="$(CFLAGS) -fPIC $(extra_cflags) $(extra_ldflags)" $(SRC_PATH)/pixman/configure $(AUTOCONF_HOST) --disable-gtk --disable-shared --enable-static)
144 e2134eb9 Gerd Hoffmann
145 e2134eb9 Gerd Hoffmann
$(SRC_PATH)/pixman/configure:
146 e2134eb9 Gerd Hoffmann
	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
147 e2134eb9 Gerd Hoffmann
148 a540f158 Peter Crosthwaite
DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
149 e3351000 Peter Crosthwaite
DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS) -I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
150 a540f158 Peter Crosthwaite
151 a540f158 Peter Crosthwaite
subdir-dtc:dtc/libfdt dtc/tests
152 e3351000 Peter Crosthwaite
	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
153 a540f158 Peter Crosthwaite
154 a540f158 Peter Crosthwaite
dtc/%:
155 a540f158 Peter Crosthwaite
	mkdir -p $@
156 a540f158 Peter Crosthwaite
157 82cb6b04 Paolo Bonzini
$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
158 add16157 Blue Swirl
159 c05ac895 Paul Brook
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
160 c05ac895 Paul Brook
romsubdir-%:
161 c05ac895 Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
162 c05ac895 Paul Brook
163 c05ac895 Paul Brook
ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
164 c05ac895 Paul Brook
165 c05ac895 Paul Brook
recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
166 83f64091 bellard
167 a558ee17 Juan Quintela
bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
168 4fb240a4 bellard
169 5354e4d2 Marc-André Lureau
version.o: $(SRC_PATH)/version.rc config-host.h | version.lo
170 9fe6de94 Blue Swirl
	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
171 5354e4d2 Marc-André Lureau
version.lo: $(SRC_PATH)/version.rc config-host.h
172 5354e4d2 Marc-André Lureau
	$(call quiet-command,$(LIBTOOL) --mode=compile --tag=RC $(WINDRES) -I. -o $@ $<,"lt RC   $(TARGET_DIR)$@")
173 9fe6de94 Blue Swirl
174 9fe6de94 Blue Swirl
version-obj-$(CONFIG_WIN32) += version.o
175 5354e4d2 Marc-André Lureau
version-lobj-$(CONFIG_WIN32) += $(if $(LIBTOOL),version.lo)
176 5354e4d2 Marc-André Lureau
Makefile: $(version-obj-y) $(version-lobj-y)
177 5354e4d2 Marc-André Lureau
178 3bc2f570 Paolo Bonzini
179 3bc2f570 Paolo Bonzini
######################################################################
180 8a090705 Paolo Bonzini
# Build libraries
181 3bc2f570 Paolo Bonzini
182 3bc2f570 Paolo Bonzini
libqemustub.a: $(stub-obj-y)
183 8a090705 Paolo Bonzini
libqemuutil.a: $(util-obj-y)
184 3bc2f570 Paolo Bonzini
185 4fb240a4 bellard
######################################################################
186 4fb240a4 bellard
187 3c089e15 Juan Quintela
qemu-img.o: qemu-img-cmds.h
188 153859be Stuart Brady
189 ff667e2e Paolo Bonzini
qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
190 ff667e2e Paolo Bonzini
qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
191 ff667e2e Paolo Bonzini
qemu-io$(EXESUF): qemu-io.o cmd.o $(block-obj-y) libqemuutil.a libqemustub.a
192 0a8e1acd aliguori
193 7b93fadf Corey Bryant
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
194 7b93fadf Corey Bryant
195 ff667e2e Paolo Bonzini
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a
196 17bff52b M. Mohan Kumar
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
197 17bff52b M. Mohan Kumar
198 153859be Stuart Brady
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
199 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
200 153859be Stuart Brady
201 957f1f99 Michael Roth
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
202 54c2e502 Dunrong Huang
qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
203 640e5404 Michael Roth
204 19bf7c87 Avi Kivity
gen-out-type = $(subst .,-,$(suffix $@))
205 8d3bc517 Avi Kivity
206 0521d375 Stefan Hajnoczi
qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
207 0521d375 Stefan Hajnoczi
208 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
209 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
210 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
211 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
212 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
213 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
214 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
215 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
216 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
217 e3d4d252 Michael Roth
218 599825c5 Michael S. Tsirkin
qapi-types.c qapi-types.h :\
219 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
220 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
221 599825c5 Michael S. Tsirkin
qapi-visit.c qapi-visit.h :\
222 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
223 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
224 599825c5 Michael S. Tsirkin
qmp-commands.h qmp-marshal.c :\
225 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
226 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
227 e3193601 Anthony Liguori
228 54c2e502 Dunrong Huang
QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
229 4115852b Paolo Bonzini
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
230 957f1f99 Michael Roth
231 ff667e2e Paolo Bonzini
qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
232 2870dc34 Paolo Bonzini
	$(call LINK, $^)
233 48ff7a62 Michael Roth
234 31e31b8a bellard
clean:
235 2d80ae89 bellard
# avoid old build problems by removing potentially incorrect old files
236 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
237 df2943ba Michael S. Tsirkin
	rm -f qemu-options.def
238 0c3c89d6 Paolo Bonzini
	find . -name '*.[oda]' -type f -exec rm -f {} +
239 0c3c89d6 Paolo Bonzini
	find . -name '*.l[oa]' -type f -exec rm -f {} +
240 0c3c89d6 Paolo Bonzini
	rm -f $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
241 44dc0ca3 Alon Levy
	rm -Rf .libs
242 07b44ce9 Blue Swirl
	rm -f qemu-img-cmds.h
243 19ac36b5 Lluís Vilanova
	@# May not be present in GENERATED_HEADERS
244 eac236ea Lluís Vilanova
	rm -f trace/generated-tracers-dtrace.dtrace*
245 eac236ea Lluís Vilanova
	rm -f trace/generated-tracers-dtrace.h*
246 19ac36b5 Lluís Vilanova
	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
247 19ac36b5 Lluís Vilanova
	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
248 8f0e5c6b Stefan Weil
	rm -rf qapi-generated
249 54c2e502 Dunrong Huang
	rm -rf qga/qapi-generated
250 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg clean
251 781c0c33 Stefan Hajnoczi
	for d in $(ALL_SUBDIRS); do \
252 fc8e320e Magnus Damm
	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
253 df2943ba Michael S. Tsirkin
	rm -f $$d/qemu-options.def; \
254 626df76a bellard
        done
255 31e31b8a bellard
256 34bb443e Anthony Liguori
VERSION ?= $(shell cat VERSION)
257 34bb443e Anthony Liguori
258 34bb443e Anthony Liguori
dist: qemu-$(VERSION).tar.bz2
259 34bb443e Anthony Liguori
260 34bb443e Anthony Liguori
qemu-%.tar.bz2:
261 34bb443e Anthony Liguori
	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
262 34bb443e Anthony Liguori
263 7d13299d bellard
distclean: clean
264 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
265 76cad711 Paolo Bonzini
	rm -f config-all-devices.mak config-all-disas.mak
266 fc8e320e Magnus Damm
	rm -f roms/seabios/config.mak roms/vgabios/config.mak
267 7a734b8f Brad Hards
	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
268 7a734b8f Brad Hards
	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
269 7a734b8f Brad Hards
	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
270 7a734b8f Brad Hards
	rm -f qemu-doc.vr
271 793553ac Alexandre Raymond
	rm -f config.log
272 67ed96f9 Peter Maydell
	rm -f linux-headers/asm
273 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
274 8e98e2e8 Paolo Bonzini
	for d in $(TARGET_DIRS); do \
275 bc1b050d bellard
	rm -rf $$d || exit 1 ; \
276 76bc6838 bellard
        done
277 a85903ff Wenchao Xia
	if test -f pixman/config.log; then make -C pixman distclean; fi
278 a540f158 Peter Crosthwaite
	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
279 7d13299d bellard
280 fed4a9ad bellard
KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
281 fed4a9ad bellard
ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
282 471fbf4a Frédéric Boiteux
common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
283 471fbf4a Frédéric Boiteux
bepo
284 fed4a9ad bellard
285 77755340 ths
ifdef INSTALL_BLOBS
286 6329866f Paolo Bonzini
BLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
287 7943a2fa Gerd Hoffmann
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
288 7e973bb2 Laszlo Ersek
acpi-dsdt.aml q35-acpi-dsdt.aml \
289 3b3d448e Gerd Hoffmann
ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
290 5ee8ad71 Alex Williamson
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
291 5ee8ad71 Alex Williamson
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
292 9fd02979 Sander Eikelenboom
efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
293 9fd02979 Sander Eikelenboom
efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
294 94b26294 Stefan Weil
qemu-icon.bmp \
295 00914b7d Michal Simek
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
296 2a2af967 Jan Kiszka
multiboot.bin linuxboot.bin kvmvapic.bin \
297 39ac8455 David Gibson
s390-zipl.rom \
298 0c1fecdd Alexander Graf
s390-ccw.img \
299 753d11f2 Richard Henderson
spapr-rtas.bin slof.bin \
300 753d11f2 Richard Henderson
palcode-clipper
301 77755340 ths
else
302 77755340 ths
BLOBS=
303 77755340 ths
endif
304 77755340 ths
305 38954dca pbrook
install-doc: $(DOCS)
306 d7dd65ba Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
307 d7dd65ba Eduardo Habkost
	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
308 0cd23fcc Bruce Rogers
	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
309 96d409eb Juan Quintela
ifdef CONFIG_POSIX
310 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
311 58f8aead aliguori
	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
312 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
313 58f8aead aliguori
	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
314 38954dca pbrook
endif
315 a2d8f1be M. Mohan Kumar
ifdef CONFIG_VIRTFS
316 a2d8f1be M. Mohan Kumar
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
317 a2d8f1be M. Mohan Kumar
	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
318 a2d8f1be M. Mohan Kumar
endif
319 e2d87bff Eduardo Habkost
320 e2d87bff Eduardo Habkost
install-datadir:
321 e2d87bff Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
322 e2d87bff Eduardo Habkost
323 e2d87bff Eduardo Habkost
install-confdir:
324 80465e80 Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
325 e2d87bff Eduardo Habkost
326 e2d87bff Eduardo Habkost
install-sysconfig: install-datadir install-confdir
327 80465e80 Eduardo Habkost
	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
328 b5ec5ce0 john cooper
329 e2d87bff Eduardo Habkost
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir
330 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
331 932a79df ths
ifneq ($(TOOLS),)
332 58f8aead aliguori
	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
333 932a79df ths
endif
334 7b93fadf Corey Bryant
ifneq ($(HELPERS-y),)
335 7b93fadf Corey Bryant
	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
336 7b93fadf Corey Bryant
	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
337 7b93fadf Corey Bryant
endif
338 77755340 ths
ifneq ($(BLOBS),)
339 77755340 ths
	set -e; for x in $(BLOBS); do \
340 6aae2a2e Eduardo Habkost
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
341 ad064840 pbrook
	done
342 77755340 ths
endif
343 834574ea Anthony Liguori
ifeq ($(CONFIG_GTK),y)
344 834574ea Anthony Liguori
	$(MAKE) -C po $@
345 834574ea Anthony Liguori
endif
346 6aae2a2e Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
347 18be8d77 blueswir1
	set -e; for x in $(KEYMAPS); do \
348 6aae2a2e Eduardo Habkost
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
349 ad064840 pbrook
	done
350 626df76a bellard
	for d in $(TARGET_DIRS); do \
351 7d3505c5 bellard
	$(MAKE) -C $$d $@ || exit 1 ; \
352 626df76a bellard
        done
353 612384d7 bellard
354 367e86e8 bellard
# various test targets
355 9b0b8203 bellard
test speed: all
356 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg $@
357 31e31b8a bellard
358 21d4e8e3 Alexandre Bique
.PHONY: TAGS
359 5fafdf24 ths
TAGS:
360 b1999e87 David Gibson
	rm -f $@
361 b1999e87 David Gibson
	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
362 31e31b8a bellard
363 6688bc6d bellard
cscope:
364 6688bc6d bellard
	rm -f ./cscope.*
365 45b75ae4 Alexandre Raymond
	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
366 6688bc6d bellard
	cscope -b
367 6688bc6d bellard
368 3ef693a0 bellard
# documentation
369 01668d98 Stefan Weil
MAKEINFO=makeinfo
370 01668d98 Stefan Weil
MAKEINFOFLAGS=--no-headers --no-split --number-sections
371 20cc9997 Stefan Weil
TEXIFLAG=$(if $(V),,--quiet)
372 20cc9997 Stefan Weil
%.dvi: %.texi
373 20cc9997 Stefan Weil
	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
374 20cc9997 Stefan Weil
375 1f673135 bellard
%.html: %.texi
376 952ef67c Stefan Weil
	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
377 01668d98 Stefan Weil
	"  GEN   $@")
378 3ef693a0 bellard
379 f3548328 bellard
%.info: %.texi
380 01668d98 Stefan Weil
	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
381 f3548328 bellard
382 20cc9997 Stefan Weil
%.pdf: %.texi
383 20cc9997 Stefan Weil
	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
384 5824d651 blueswir1
385 5824d651 blueswir1
qemu-options.texi: $(SRC_PATH)/qemu-options.hx
386 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
387 f3548328 bellard
388 acd0a093 Luiz Capitulino
qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
389 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
390 2313086a Blue Swirl
391 82a56f0d Luiz Capitulino
QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
392 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
393 b40292e7 Jan Kiszka
394 153859be Stuart Brady
qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
395 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
396 153859be Stuart Brady
397 2313086a Blue Swirl
qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
398 0d00e563 aliguori
	$(call quiet-command, \
399 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
400 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
401 0d00e563 aliguori
	  "  GEN   $@")
402 5a67135a bellard
403 153859be Stuart Brady
qemu-img.1: qemu-img.texi qemu-img-cmds.texi
404 0d00e563 aliguori
	$(call quiet-command, \
405 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
406 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
407 0d00e563 aliguori
	  "  GEN   $@")
408 acd935ef bellard
409 a2d8f1be M. Mohan Kumar
fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
410 a2d8f1be M. Mohan Kumar
	$(call quiet-command, \
411 a2d8f1be M. Mohan Kumar
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
412 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
413 a2d8f1be M. Mohan Kumar
	  "  GEN   $@")
414 a2d8f1be M. Mohan Kumar
415 7a5ca864 bellard
qemu-nbd.8: qemu-nbd.texi
416 0d00e563 aliguori
	$(call quiet-command, \
417 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
418 3179d694 Michael Tokarev
	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
419 0d00e563 aliguori
	  "  GEN   $@")
420 7a5ca864 bellard
421 0cb3fb1e pbrook
dvi: qemu-doc.dvi qemu-tech.dvi
422 0cb3fb1e pbrook
html: qemu-doc.html qemu-tech.html
423 20cc9997 Stefan Weil
info: qemu-doc.info qemu-tech.info
424 20cc9997 Stefan Weil
pdf: qemu-doc.pdf qemu-tech.pdf
425 0cb3fb1e pbrook
426 20cc9997 Stefan Weil
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
427 20cc9997 Stefan Weil
	qemu-img.texi qemu-nbd.texi qemu-options.texi \
428 20cc9997 Stefan Weil
	qemu-monitor.texi qemu-img-cmds.texi
429 818220f5 aliguori
430 cb5fc67d Anthony Liguori
# Add a dependency on the generated files, so that they are always
431 cb5fc67d Anthony Liguori
# rebuilt before other object files
432 7748b8cb Mike Frysinger
ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
433 cb5fc67d Anthony Liguori
Makefile: $(GENERATED_HEADERS)
434 7748b8cb Mike Frysinger
endif
435 cb5fc67d Anthony Liguori
436 4fb240a4 bellard
# Include automatically generated dependency files
437 1435ddb8 Paolo Bonzini
# Dependencies in Makefile.objs files come from our recursive subdir rules
438 1435ddb8 Paolo Bonzini
-include $(wildcard *.d tests/*.d)