Statistics
| Branch: | Revision:

root / Makefile @ 6821cdc7

History | View | Annotate | Download (15.3 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 5354e4d2 Marc-André Lureau
version.lo: $(SRC_PATH)/version.rc config-host.h
171 9fe6de94 Blue Swirl
172 9fe6de94 Blue Swirl
version-obj-$(CONFIG_WIN32) += version.o
173 5354e4d2 Marc-André Lureau
version-lobj-$(CONFIG_WIN32) += $(if $(LIBTOOL),version.lo)
174 5354e4d2 Marc-André Lureau
Makefile: $(version-obj-y) $(version-lobj-y)
175 5354e4d2 Marc-André Lureau
176 3bc2f570 Paolo Bonzini
177 3bc2f570 Paolo Bonzini
######################################################################
178 8a090705 Paolo Bonzini
# Build libraries
179 3bc2f570 Paolo Bonzini
180 3bc2f570 Paolo Bonzini
libqemustub.a: $(stub-obj-y)
181 8a090705 Paolo Bonzini
libqemuutil.a: $(util-obj-y)
182 3bc2f570 Paolo Bonzini
183 4fb240a4 bellard
######################################################################
184 4fb240a4 bellard
185 3c089e15 Juan Quintela
qemu-img.o: qemu-img-cmds.h
186 153859be Stuart Brady
187 ff667e2e Paolo Bonzini
qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
188 ff667e2e Paolo Bonzini
qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
189 ff667e2e Paolo Bonzini
qemu-io$(EXESUF): qemu-io.o cmd.o $(block-obj-y) libqemuutil.a libqemustub.a
190 0a8e1acd aliguori
191 7b93fadf Corey Bryant
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
192 7b93fadf Corey Bryant
193 ff667e2e Paolo Bonzini
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o libqemuutil.a libqemustub.a
194 17bff52b M. Mohan Kumar
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
195 17bff52b M. Mohan Kumar
196 153859be Stuart Brady
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
197 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
198 153859be Stuart Brady
199 957f1f99 Michael Roth
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
200 54c2e502 Dunrong Huang
qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
201 640e5404 Michael Roth
202 19bf7c87 Avi Kivity
gen-out-type = $(subst .,-,$(suffix $@))
203 8d3bc517 Avi Kivity
204 0521d375 Stefan Hajnoczi
qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
205 0521d375 Stefan Hajnoczi
206 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
207 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
208 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
209 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
210 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
211 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
212 54c2e502 Dunrong Huang
qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
213 2870dc34 Paolo Bonzini
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
214 54c2e502 Dunrong Huang
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o qga/qapi-generated -p "qga-" < $<, "  GEN   $@")
215 e3d4d252 Michael Roth
216 599825c5 Michael S. Tsirkin
qapi-types.c qapi-types.h :\
217 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
218 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
219 599825c5 Michael S. Tsirkin
qapi-visit.c qapi-visit.h :\
220 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
221 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
222 599825c5 Michael S. Tsirkin
qmp-commands.h qmp-marshal.c :\
223 0521d375 Stefan Hajnoczi
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
224 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
225 e3193601 Anthony Liguori
226 54c2e502 Dunrong Huang
QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
227 4115852b Paolo Bonzini
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
228 957f1f99 Michael Roth
229 ff667e2e Paolo Bonzini
qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
230 2870dc34 Paolo Bonzini
	$(call LINK, $^)
231 48ff7a62 Michael Roth
232 31e31b8a bellard
clean:
233 2d80ae89 bellard
# avoid old build problems by removing potentially incorrect old files
234 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
235 df2943ba Michael S. Tsirkin
	rm -f qemu-options.def
236 0c3c89d6 Paolo Bonzini
	find . -name '*.[oda]' -type f -exec rm -f {} +
237 0c3c89d6 Paolo Bonzini
	find . -name '*.l[oa]' -type f -exec rm -f {} +
238 0c3c89d6 Paolo Bonzini
	rm -f $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
239 44dc0ca3 Alon Levy
	rm -Rf .libs
240 07b44ce9 Blue Swirl
	rm -f qemu-img-cmds.h
241 19ac36b5 Lluís Vilanova
	@# May not be present in GENERATED_HEADERS
242 eac236ea Lluís Vilanova
	rm -f trace/generated-tracers-dtrace.dtrace*
243 eac236ea Lluís Vilanova
	rm -f trace/generated-tracers-dtrace.h*
244 19ac36b5 Lluís Vilanova
	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
245 19ac36b5 Lluís Vilanova
	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
246 8f0e5c6b Stefan Weil
	rm -rf qapi-generated
247 54c2e502 Dunrong Huang
	rm -rf qga/qapi-generated
248 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg clean
249 781c0c33 Stefan Hajnoczi
	for d in $(ALL_SUBDIRS); do \
250 fc8e320e Magnus Damm
	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
251 df2943ba Michael S. Tsirkin
	rm -f $$d/qemu-options.def; \
252 626df76a bellard
        done
253 31e31b8a bellard
254 34bb443e Anthony Liguori
VERSION ?= $(shell cat VERSION)
255 34bb443e Anthony Liguori
256 34bb443e Anthony Liguori
dist: qemu-$(VERSION).tar.bz2
257 34bb443e Anthony Liguori
258 34bb443e Anthony Liguori
qemu-%.tar.bz2:
259 34bb443e Anthony Liguori
	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
260 34bb443e Anthony Liguori
261 7d13299d bellard
distclean: clean
262 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
263 76cad711 Paolo Bonzini
	rm -f config-all-devices.mak config-all-disas.mak
264 fc8e320e Magnus Damm
	rm -f roms/seabios/config.mak roms/vgabios/config.mak
265 7a734b8f Brad Hards
	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
266 7a734b8f Brad Hards
	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
267 7a734b8f Brad Hards
	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
268 7a734b8f Brad Hards
	rm -f qemu-doc.vr
269 793553ac Alexandre Raymond
	rm -f config.log
270 67ed96f9 Peter Maydell
	rm -f linux-headers/asm
271 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
272 8e98e2e8 Paolo Bonzini
	for d in $(TARGET_DIRS); do \
273 bc1b050d bellard
	rm -rf $$d || exit 1 ; \
274 76bc6838 bellard
        done
275 a85903ff Wenchao Xia
	if test -f pixman/config.log; then make -C pixman distclean; fi
276 a540f158 Peter Crosthwaite
	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
277 7d13299d bellard
278 fed4a9ad bellard
KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
279 fed4a9ad bellard
ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
280 471fbf4a Frédéric Boiteux
common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
281 471fbf4a Frédéric Boiteux
bepo
282 fed4a9ad bellard
283 77755340 ths
ifdef INSTALL_BLOBS
284 6329866f Paolo Bonzini
BLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
285 7943a2fa Gerd Hoffmann
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
286 7e973bb2 Laszlo Ersek
acpi-dsdt.aml q35-acpi-dsdt.aml \
287 3b3d448e Gerd Hoffmann
ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
288 5ee8ad71 Alex Williamson
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
289 5ee8ad71 Alex Williamson
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
290 9fd02979 Sander Eikelenboom
efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
291 9fd02979 Sander Eikelenboom
efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
292 94b26294 Stefan Weil
qemu-icon.bmp \
293 00914b7d Michal Simek
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
294 2a2af967 Jan Kiszka
multiboot.bin linuxboot.bin kvmvapic.bin \
295 39ac8455 David Gibson
s390-zipl.rom \
296 0c1fecdd Alexander Graf
s390-ccw.img \
297 753d11f2 Richard Henderson
spapr-rtas.bin slof.bin \
298 753d11f2 Richard Henderson
palcode-clipper
299 77755340 ths
else
300 77755340 ths
BLOBS=
301 77755340 ths
endif
302 77755340 ths
303 38954dca pbrook
install-doc: $(DOCS)
304 d7dd65ba Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
305 d7dd65ba Eduardo Habkost
	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
306 0cd23fcc Bruce Rogers
	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
307 96d409eb Juan Quintela
ifdef CONFIG_POSIX
308 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
309 58f8aead aliguori
	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
310 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
311 58f8aead aliguori
	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
312 38954dca pbrook
endif
313 a2d8f1be M. Mohan Kumar
ifdef CONFIG_VIRTFS
314 a2d8f1be M. Mohan Kumar
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
315 a2d8f1be M. Mohan Kumar
	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
316 a2d8f1be M. Mohan Kumar
endif
317 e2d87bff Eduardo Habkost
318 e2d87bff Eduardo Habkost
install-datadir:
319 e2d87bff Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
320 e2d87bff Eduardo Habkost
321 e2d87bff Eduardo Habkost
install-confdir:
322 80465e80 Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
323 e2d87bff Eduardo Habkost
324 e2d87bff Eduardo Habkost
install-sysconfig: install-datadir install-confdir
325 80465e80 Eduardo Habkost
	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
326 b5ec5ce0 john cooper
327 e2d87bff Eduardo Habkost
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir
328 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
329 932a79df ths
ifneq ($(TOOLS),)
330 58f8aead aliguori
	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
331 932a79df ths
endif
332 7b93fadf Corey Bryant
ifneq ($(HELPERS-y),)
333 7b93fadf Corey Bryant
	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
334 7b93fadf Corey Bryant
	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
335 7b93fadf Corey Bryant
endif
336 77755340 ths
ifneq ($(BLOBS),)
337 77755340 ths
	set -e; for x in $(BLOBS); do \
338 6aae2a2e Eduardo Habkost
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
339 ad064840 pbrook
	done
340 77755340 ths
endif
341 834574ea Anthony Liguori
ifeq ($(CONFIG_GTK),y)
342 834574ea Anthony Liguori
	$(MAKE) -C po $@
343 834574ea Anthony Liguori
endif
344 6aae2a2e Eduardo Habkost
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
345 18be8d77 blueswir1
	set -e; for x in $(KEYMAPS); do \
346 6aae2a2e Eduardo Habkost
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
347 ad064840 pbrook
	done
348 626df76a bellard
	for d in $(TARGET_DIRS); do \
349 7d3505c5 bellard
	$(MAKE) -C $$d $@ || exit 1 ; \
350 626df76a bellard
        done
351 612384d7 bellard
352 367e86e8 bellard
# various test targets
353 9b0b8203 bellard
test speed: all
354 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg $@
355 31e31b8a bellard
356 21d4e8e3 Alexandre Bique
.PHONY: TAGS
357 5fafdf24 ths
TAGS:
358 b1999e87 David Gibson
	rm -f $@
359 b1999e87 David Gibson
	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
360 31e31b8a bellard
361 6688bc6d bellard
cscope:
362 6688bc6d bellard
	rm -f ./cscope.*
363 45b75ae4 Alexandre Raymond
	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
364 6688bc6d bellard
	cscope -b
365 6688bc6d bellard
366 3ef693a0 bellard
# documentation
367 01668d98 Stefan Weil
MAKEINFO=makeinfo
368 01668d98 Stefan Weil
MAKEINFOFLAGS=--no-headers --no-split --number-sections
369 20cc9997 Stefan Weil
TEXIFLAG=$(if $(V),,--quiet)
370 20cc9997 Stefan Weil
%.dvi: %.texi
371 20cc9997 Stefan Weil
	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
372 20cc9997 Stefan Weil
373 1f673135 bellard
%.html: %.texi
374 952ef67c Stefan Weil
	$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
375 01668d98 Stefan Weil
	"  GEN   $@")
376 3ef693a0 bellard
377 f3548328 bellard
%.info: %.texi
378 01668d98 Stefan Weil
	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
379 f3548328 bellard
380 20cc9997 Stefan Weil
%.pdf: %.texi
381 20cc9997 Stefan Weil
	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
382 5824d651 blueswir1
383 5824d651 blueswir1
qemu-options.texi: $(SRC_PATH)/qemu-options.hx
384 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
385 f3548328 bellard
386 acd0a093 Luiz Capitulino
qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
387 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
388 2313086a Blue Swirl
389 82a56f0d Luiz Capitulino
QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
390 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
391 b40292e7 Jan Kiszka
392 153859be Stuart Brady
qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
393 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
394 153859be Stuart Brady
395 2313086a Blue Swirl
qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
396 0d00e563 aliguori
	$(call quiet-command, \
397 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
398 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
399 0d00e563 aliguori
	  "  GEN   $@")
400 5a67135a bellard
401 153859be Stuart Brady
qemu-img.1: qemu-img.texi qemu-img-cmds.texi
402 0d00e563 aliguori
	$(call quiet-command, \
403 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
404 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
405 0d00e563 aliguori
	  "  GEN   $@")
406 acd935ef bellard
407 a2d8f1be M. Mohan Kumar
fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
408 a2d8f1be M. Mohan Kumar
	$(call quiet-command, \
409 a2d8f1be M. Mohan Kumar
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
410 3179d694 Michael Tokarev
	  $(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
411 a2d8f1be M. Mohan Kumar
	  "  GEN   $@")
412 a2d8f1be M. Mohan Kumar
413 7a5ca864 bellard
qemu-nbd.8: qemu-nbd.texi
414 0d00e563 aliguori
	$(call quiet-command, \
415 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
416 3179d694 Michael Tokarev
	  $(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
417 0d00e563 aliguori
	  "  GEN   $@")
418 7a5ca864 bellard
419 0cb3fb1e pbrook
dvi: qemu-doc.dvi qemu-tech.dvi
420 0cb3fb1e pbrook
html: qemu-doc.html qemu-tech.html
421 20cc9997 Stefan Weil
info: qemu-doc.info qemu-tech.info
422 20cc9997 Stefan Weil
pdf: qemu-doc.pdf qemu-tech.pdf
423 0cb3fb1e pbrook
424 20cc9997 Stefan Weil
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
425 20cc9997 Stefan Weil
	qemu-img.texi qemu-nbd.texi qemu-options.texi \
426 20cc9997 Stefan Weil
	qemu-monitor.texi qemu-img-cmds.texi
427 818220f5 aliguori
428 cb5fc67d Anthony Liguori
# Add a dependency on the generated files, so that they are always
429 cb5fc67d Anthony Liguori
# rebuilt before other object files
430 7748b8cb Mike Frysinger
ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
431 cb5fc67d Anthony Liguori
Makefile: $(GENERATED_HEADERS)
432 7748b8cb Mike Frysinger
endif
433 cb5fc67d Anthony Liguori
434 4fb240a4 bellard
# Include automatically generated dependency files
435 1435ddb8 Paolo Bonzini
# Dependencies in Makefile.objs files come from our recursive subdir rules
436 1435ddb8 Paolo Bonzini
-include $(wildcard *.d tests/*.d)