]>
Commit | Line | Data |
---|---|---|
0cb3fb1e PB |
1 | # Makefile for QEMU. |
2 | ||
4ace32e2 AO |
3 | ifneq ($(words $(subst :, ,$(CURDIR))), 1) |
4 | $(error main directory cannot contain spaces nor colons) | |
5 | endif | |
6 | ||
519e1693 SW |
7 | # Always point to the root of the build tree (needs GNU make). |
8 | BUILD_DIR=$(CURDIR) | |
388d4758 | 9 | |
eaa2ddbb FZ |
10 | # Before including a proper config-host.mak, assume we are in the source tree |
11 | SRC_PATH=. | |
12 | ||
28fa2927 PMD |
13 | UNCHECKED_GOALS := %clean TAGS cscope ctags dist \ |
14 | html info pdf txt \ | |
de1da442 | 15 | help check-help print-% \ |
4f2f6276 | 16 | docker docker-% vm-help vm-test vm-build-% |
eaa2ddbb | 17 | |
250b086e | 18 | # All following code might depend on configuration variables |
55d7e8f6 | 19 | ifneq ($(wildcard config-host.mak),) |
1ad2134f | 20 | # Put the all: rule here so that config-host.mak can contain dependencies. |
8f67aa82 | 21 | all: |
ad064840 | 22 | include config-host.mak |
d1bd2423 | 23 | |
aef45d51 DB |
24 | git-submodule-update: |
25 | ||
26 | .PHONY: git-submodule-update | |
27 | ||
c4b01c7c DB |
28 | git_module_status := $(shell \ |
29 | cd '$(SRC_PATH)' && \ | |
30 | GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \ | |
31 | echo $$?; \ | |
32 | ) | |
aef45d51 DB |
33 | |
34 | ifeq (1,$(git_module_status)) | |
f62bbee5 DB |
35 | ifeq (no,$(GIT_UPDATE)) |
36 | git-submodule-update: | |
37 | $(call quiet-command, \ | |
38 | echo && \ | |
39 | echo "GIT submodule checkout is out of date. Please run" && \ | |
40 | echo " scripts/git-submodule.sh update $(GIT_SUBMODULES)" && \ | |
41 | echo "from the source directory checkout $(SRC_PATH)" && \ | |
42 | echo && \ | |
43 | exit 1) | |
44 | else | |
aef45d51 DB |
45 | git-submodule-update: |
46 | $(call quiet-command, \ | |
cc84d63a | 47 | (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \ |
aef45d51 DB |
48 | "GIT","$(GIT_SUBMODULES)") |
49 | endif | |
50 | endif | |
51 | ||
a5665051 PB |
52 | export NINJA=./ninjatool |
53 | ||
54 | # Running meson regenerates both build.ninja and ninjatool, and that is | |
55 | # enough to prime the rest of the build. | |
56 | ninjatool: build.ninja | |
57 | ||
58 | # Only needed in case Makefile.ninja does not exist. | |
59 | .PHONY: ninja-clean ninja-distclean clean-ctlist | |
60 | clean-ctlist: | |
61 | ninja-clean:: | |
62 | ninja-distclean:: | |
63 | build.ninja: config-host.mak | |
64 | ||
65 | Makefile.ninja: build.ninja ninjatool | |
66 | ./ninjatool -t ninja2make --omit clean dist uninstall < $< > $@ | |
67 | -include Makefile.ninja | |
68 | ||
69 | ${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}: .var.command += -MP | |
70 | ||
245dac4a PB |
71 | # If MESON is empty, the rule will be re-evaluated after Makefiles are |
72 | # reread (and MESON won't be empty anymore). | |
73 | ifneq ($(MESON),) | |
74 | Makefile.mtest: build.ninja scripts/mtest2make.py | |
75 | $(MESON) introspect --tests | $(PYTHON) scripts/mtest2make.py > $@ | |
76 | -include Makefile.mtest | |
77 | endif | |
78 | ||
92712822 | 79 | .git-submodule-status: git-submodule-update config-host.mak |
aef45d51 | 80 | |
d1bd2423 PM |
81 | # Check that we're not trying to do an out-of-tree build from |
82 | # a tree that's been used for an in-tree build. | |
83 | ifneq ($(realpath $(SRC_PATH)),$(realpath .)) | |
84 | ifneq ($(wildcard $(SRC_PATH)/config-host.mak),) | |
85 | $(error This is an out of tree build but your source tree ($(SRC_PATH)) \ | |
86 | seems to have been used for an in-tree build. You can fix this by running \ | |
b98a3bae | 87 | "$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree) |
d1bd2423 PM |
88 | endif |
89 | endif | |
90 | ||
2b1f35b9 AB |
91 | CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y) |
92 | CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y) | |
6b827cca | 93 | CONFIG_XEN := $(CONFIG_XEN_BACKEND) |
f3aa844b PB |
94 | CONFIG_ALL=y |
95 | -include config-all-devices.mak | |
96 | -include config-all-disas.mak | |
97 | ||
3a6b016d | 98 | config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION |
e5efe7f5 | 99 | @echo $@ is out-of-date, running configure |
a5665051 PB |
100 | @if test -f meson-private/coredata.dat; then \ |
101 | ./config.status --skip-meson; \ | |
102 | else \ | |
103 | ./config.status; \ | |
104 | fi | |
26fffe29 EC |
105 | |
106 | # Force configure to re-run if the API symbols are updated | |
107 | ifeq ($(CONFIG_PLUGIN),y) | |
108 | config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols | |
109 | endif | |
110 | ||
55d7e8f6 AJ |
111 | else |
112 | config-host.mak: | |
eaa2ddbb | 113 | ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) |
55d7e8f6 AJ |
114 | @echo "Please call configure before running make!" |
115 | @exit 1 | |
116 | endif | |
7748b8cb | 117 | endif |
766a487a | 118 | |
fb57c881 FZ |
119 | include $(SRC_PATH)/rules.mak |
120 | ||
c932ce31 | 121 | # lor is defined in rules.mak |
29de2804 LV |
122 | CONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)) |
123 | ||
d3b18480 MAL |
124 | generated-files-y += target/s390x/gen-features.h |
125 | target/s390x/gen-features.h: Makefile.ninja | |
0c0c1fd9 | 126 | |
3dff199c | 127 | generated-files-y += .git-submodule-status |
0ab8ed18 | 128 | |
d9ace8b3 JQ |
129 | # Don't try to regenerate Makefile or configure |
130 | # We don't generate any of them | |
131 | Makefile: ; | |
132 | configure: ; | |
133 | ||
bd3f5706 | 134 | .PHONY: all clean cscope distclean html info install install-doc \ |
7c3d1917 | 135 | pdf txt recurse-all dist msi FORCE |
0cb3fb1e | 136 | |
fec90ff0 | 137 | $(call set-vpath, $(SRC_PATH)) |
8c462f8f | 138 | |
3e2e0e6b | 139 | LIBS+=-lz $(LIBS_TOOLS) |
67c0f08d | 140 | |
fdbff6bd | 141 | HELPERS-y = $(HELPERS) |
d52c454a | 142 | |
b53c54c6 PM |
143 | # Sphinx does not allow building manuals into the same directory as |
144 | # the source files, so if we're doing an in-tree QEMU build we must | |
145 | # build the manuals into a subdirectory (and then install them from | |
146 | # there for 'make install'). For an out-of-tree build we can just | |
147 | # use the docs/ subdirectory in the build tree as normal. | |
148 | ifeq ($(realpath $(SRC_PATH)),$(realpath .)) | |
149 | MANUAL_BUILDDIR := docs/built | |
150 | else | |
151 | MANUAL_BUILDDIR := docs | |
152 | endif | |
153 | ||
cc8ae6de | 154 | ifdef BUILD_DOCS |
d06118bf | 155 | DOCS+=$(MANUAL_BUILDDIR)/system/qemu.1 |
a08b4a9f PM |
156 | DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-img.1 |
157 | DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-nbd.8 | |
87c0868f | 158 | DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8 |
6a7e2bbe | 159 | ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) |
a08b4a9f | 160 | DOCS+=$(MANUAL_BUILDDIR)/tools/virtiofsd.1 |
6a7e2bbe | 161 | endif |
acab923d | 162 | DOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 |
d59157ea PB |
163 | DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7 |
164 | DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7 | |
1bf84a1e | 165 | DOCS+=$(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 |
22108f33 | 166 | DOCS+=$(MANUAL_BUILDDIR)/index.html |
983eef5a | 167 | ifdef CONFIG_VIRTFS |
a08b4a9f | 168 | DOCS+=$(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 |
983eef5a | 169 | endif |
62dd1048 | 170 | ifdef CONFIG_TRACE_SYSTEMTAP |
a08b4a9f | 171 | DOCS+=$(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 |
62dd1048 | 172 | endif |
cc8ae6de PB |
173 | else |
174 | DOCS= | |
175 | endif | |
aa05ae6f | 176 | |
8cc357b5 | 177 | SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR) |
a992fe3d | 178 | |
992aeb8e PB |
179 | ifneq ($(wildcard config-host.mak),) |
180 | include $(SRC_PATH)/Makefile.objs | |
ba1183da FZ |
181 | endif |
182 | ||
183 | dummy := $(call unnest-vars,, \ | |
14837c64 KW |
184 | storage-daemon-obj-y \ |
185 | storage-daemon-obj-m \ | |
cc475698 | 186 | common-obj-y \ |
a81df1b6 | 187 | common-obj-m) |
243af022 | 188 | |
46e7b706 | 189 | include $(SRC_PATH)/tests/Makefile.include |
992aeb8e | 190 | |
ea458960 | 191 | all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS) $(HELPERS-y) recurse-all modules |
b9dea4fb | 192 | |
1215c6e7 JQ |
193 | config-host.h: config-host.h-timestamp |
194 | config-host.h-timestamp: config-host.mak | |
195 | ||
c621dc3e | 196 | TARGET_DIRS_RULES := $(foreach t, all fuzz clean install, $(addsuffix /$(t), $(TARGET_DIRS))) |
916359f6 | 197 | |
1338a4b7 MA |
198 | SOFTMMU_ALL_RULES=$(filter %-softmmu/all, $(TARGET_DIRS_RULES)) |
199 | $(SOFTMMU_ALL_RULES): $(authz-obj-y) | |
200 | $(SOFTMMU_ALL_RULES): $(block-obj-y) | |
14837c64 | 201 | $(SOFTMMU_ALL_RULES): $(storage-daemon-obj-y) |
1338a4b7 MA |
202 | $(SOFTMMU_ALL_RULES): $(chardev-obj-y) |
203 | $(SOFTMMU_ALL_RULES): $(crypto-obj-y) | |
204 | $(SOFTMMU_ALL_RULES): $(io-obj-y) | |
de59dda3 | 205 | $(SOFTMMU_ALL_RULES): $(qom-obj-y) |
1338a4b7 | 206 | $(SOFTMMU_ALL_RULES): config-all-devices.mak |
cec7d0b6 | 207 | |
c621dc3e AB |
208 | SOFTMMU_FUZZ_RULES=$(filter %-softmmu/fuzz, $(TARGET_DIRS_RULES)) |
209 | $(SOFTMMU_FUZZ_RULES): $(authz-obj-y) | |
210 | $(SOFTMMU_FUZZ_RULES): $(block-obj-y) | |
211 | $(SOFTMMU_FUZZ_RULES): $(chardev-obj-y) | |
212 | $(SOFTMMU_FUZZ_RULES): $(crypto-obj-y) | |
213 | $(SOFTMMU_FUZZ_RULES): $(io-obj-y) | |
214 | $(SOFTMMU_FUZZ_RULES): config-all-devices.mak | |
215 | $(SOFTMMU_FUZZ_RULES): $(edk2-decompressed) | |
216 | ||
2becc36a PB |
217 | # meson: this is sub-optimal but going away after conversion |
218 | TARGET_DEPS = $(patsubst %,%-config-target.h, $(TARGET_DIRS)) | |
219 | TARGET_DEPS += $(patsubst %,%-config-devices.h, $(filter %-softmmu,$(TARGET_DIRS))) | |
220 | TARGET_DEPS += $(patsubst %,libqemu-%.fa, $(TARGET_DIRS)) | |
221 | ||
1338a4b7 MA |
222 | .PHONY: $(TARGET_DIRS_RULES) |
223 | # The $(TARGET_DIRS_RULES) are of the form SUBDIR/GOAL, so that | |
224 | # $(dir $@) yields the sub-directory, and $(notdir $@) yields the sub-goal | |
2becc36a | 225 | $(TARGET_DIRS_RULES): $(TARGET_DEPS) |
1338a4b7 | 226 | $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),) |
4aa42531 | 227 | |
67953a37 CF |
228 | # LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC |
229 | DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib="" | |
965f486c | 230 | DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS) |
67953a37 | 231 | DTC_CPPFLAGS=-I$(SRC_PATH)/dtc/libfdt |
a540f158 | 232 | |
3b8593ee | 233 | .PHONY: dtc/all |
67953a37 CF |
234 | dtc/all: .git-submodule-status dtc/libfdt |
235 | $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,) | |
a540f158 | 236 | |
00525864 | 237 | dtc/%: .git-submodule-status |
814e1110 | 238 | @mkdir -p $@ |
a540f158 | 239 | |
e219c499 RH |
240 | # Overriding CFLAGS causes us to lose defines added in the sub-makefile. |
241 | # Not overriding CFLAGS leads to mis-matches between compilation modes. | |
242 | # Therefore we replicate some of the logic in the sub-makefile. | |
243 | # Remove all the extra -Warning flags that QEMU uses that Capstone doesn't; | |
244 | # no need to annoy QEMU developers with such things. | |
245 | CAP_CFLAGS = $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS)) | |
246 | CAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM | |
247 | CAP_CFLAGS += -DCAPSTONE_HAS_ARM | |
248 | CAP_CFLAGS += -DCAPSTONE_HAS_ARM64 | |
249 | CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC | |
250 | CAP_CFLAGS += -DCAPSTONE_HAS_X86 | |
251 | ||
3b8593ee MA |
252 | .PHONY: capstone/all |
253 | capstone/all: .git-submodule-status | |
9f81aeb5 | 254 | $(call quiet-command,$(MAKE) -C $(SRC_PATH)/capstone CAPSTONE_SHARED=no BUILDDIR="$(BUILD_DIR)/capstone" CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" CFLAGS="$(CAP_CFLAGS)" $(SUBDIR_MAKEFLAGS) $(BUILD_DIR)/capstone/$(LIBCAPSTONE)) |
e219c499 | 255 | |
3b8593ee MA |
256 | .PHONY: slirp/all |
257 | slirp/all: .git-submodule-status | |
daa79d9a AB |
258 | $(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp \ |
259 | BUILD_DIR="$(BUILD_DIR)/slirp" \ | |
260 | PKG_CONFIG="$(PKG_CONFIG)" \ | |
261 | CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" \ | |
db5adeaa | 262 | CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)") |
675b9b53 | 263 | |
1338a4b7 | 264 | $(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \ |
3154fee4 | 265 | $(qom-obj-y) block.syms qemu.syms |
add16157 | 266 | |
c621dc3e AB |
267 | $(filter %/fuzz, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \ |
268 | $(qom-obj-y) $(crypto-user-obj-$(CONFIG_USER_ONLY)) | |
269 | ||
3b8593ee | 270 | ROM_DIRS = $(addprefix pc-bios/, $(ROMS)) |
1338a4b7 | 271 | ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS))) |
a9c87304 | 272 | # Only keep -O and -g cflags |
1338a4b7 MA |
273 | .PHONY: $(ROM_DIRS_RULES) |
274 | $(ROM_DIRS_RULES): | |
275 | $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),) | |
c05ac895 | 276 | |
8d358a5e | 277 | .PHONY: recurse-all recurse-clean recurse-install |
1338a4b7 MA |
278 | recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS)) |
279 | recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS)) | |
280 | recurse-install: $(addsuffix /install, $(TARGET_DIRS)) | |
47ae060e | 281 | $(addsuffix /install, $(TARGET_DIRS)): all |
83f64091 | 282 | |
c17a18ef | 283 | $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h |
0bdb12c7 | 284 | $(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"RC","version.o") |
5354e4d2 | 285 | |
c17a18ef | 286 | Makefile: $(version-obj-y) |
3bc2f570 | 287 | |
44dc0ca3 | 288 | ###################################################################### |
4fb240a4 | 289 | |
ebedb37c | 290 | COMMON_LDADDS = libqemuutil.a |
0ab8ed18 | 291 | |
5e6911cf | 292 | qemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS) |
0a8e1acd | 293 | |
5b76dd13 | 294 | scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS) |
fe8fc5ae PB |
295 | ifdef CONFIG_MPATH |
296 | scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist | |
297 | endif | |
b855f8d1 | 298 | |
a5665051 PB |
299 | clean: recurse-clean ninja-clean clean-ctlist |
300 | -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean | |
2d80ae89 | 301 | # avoid old build problems by removing potentially incorrect old files |
25be210f | 302 | rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h |
23858f40 LE |
303 | find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \ |
304 | ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \ | |
305 | ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \ | |
306 | ! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \ | |
307 | -exec rm {} + | |
0814465a | 308 | rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~ */*~ |
b855f8d1 | 309 | rm -f fsdev/*.pod scsi/*.pod |
3dff199c | 310 | rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp) |
31e31b8a | 311 | |
34bb443e AL |
312 | VERSION ?= $(shell cat VERSION) |
313 | ||
314 | dist: qemu-$(VERSION).tar.bz2 | |
315 | ||
34bb443e AL |
316 | qemu-%.tar.bz2: |
317 | $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)" | |
318 | ||
5f71eac0 | 319 | define clean-manual = |
1290e671 PM |
320 | rm -rf $(MANUAL_BUILDDIR)/$1/_static |
321 | rm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html | |
5f71eac0 PM |
322 | endef |
323 | ||
a5665051 PB |
324 | distclean: clean ninja-distclean |
325 | -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean -g | |
ee5195ee | 326 | rm -f config-host.mak config-host.h* $(DOCS) |
2038f8c8 | 327 | rm -f tests/tcg/config-*.mak |
2becc36a | 328 | rm -f config-all-disas.mak config.status |
ae219359 | 329 | rm -f po/*.mo tests/qemu-iotests/common.env |
fc8e320e | 330 | rm -f roms/seabios/config.mak roms/vgabios/config.mak |
26fffe29 | 331 | rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols |
a5665051 | 332 | rm -rf meson-private meson-logs meson-info compile_commands.json |
245dac4a | 333 | rm -f Makefile.ninja ninjatool ninjatool.stamp Makefile.mtest |
793553ac | 334 | rm -f config.log |
67ed96f9 | 335 | rm -f linux-headers/asm |
d59157ea PB |
336 | rm -f docs/version.texi |
337 | rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi | |
338 | rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7 | |
339 | rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt | |
340 | rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf | |
341 | rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html | |
81f33401 | 342 | rm -rf .doctrees |
5f71eac0 PM |
343 | $(call clean-manual,devel) |
344 | $(call clean-manual,interop) | |
0783a732 | 345 | $(call clean-manual,specs) |
0928523a | 346 | $(call clean-manual,system) |
65c3542b | 347 | $(call clean-manual,tools) |
09147930 | 348 | $(call clean-manual,user) |
2b1f35b9 | 349 | for d in $(TARGET_DIRS); do \ |
bc1b050d | 350 | rm -rf $$d || exit 1 ; \ |
76bc6838 | 351 | done |
d9840e25 | 352 | rm -Rf .sdk |
7d13299d | 353 | |
06e7772f | 354 | KEYMAPS=da en-gb et fr fr-ch is lt no pt-br sv \ |
fed4a9ad | 355 | ar de en-us fi fr-be hr it lv nl pl ru th \ |
26b1cbf8 | 356 | de-ch es fo fr-ca hu ja mk pt sl tr \ |
3751e722 | 357 | bepo cz |
fed4a9ad | 358 | |
77755340 | 359 | ifdef INSTALL_BLOBS |
32eb2da3 | 360 | BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \ |
7a4dfd1e | 361 | vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \ |
0a87fd69 | 362 | vgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \ |
b2ce76a0 | 363 | openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \ |
5ee8ad71 AW |
364 | pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \ |
365 | pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \ | |
9fd02979 SE |
366 | efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \ |
367 | efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \ | |
45027808 | 368 | efi-e1000e.rom efi-vmxnet3.rom \ |
b3ce38dc | 369 | qemu-nsis.bmp \ |
4b387f9e | 370 | bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ |
2785dc7b | 371 | multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \ |
6c5359e1 | 372 | s390-ccw.img s390-netboot.img \ |
744a928c | 373 | slof.bin skiboot.lid \ |
0c6ab8c9 | 374 | palcode-clipper \ |
82e65fe0 | 375 | u-boot.e500 u-boot-sam460-20100605.bin \ |
43ad2564 | 376 | qemu_vga.ndrv \ |
26ce90fd | 377 | edk2-licenses.txt \ |
91f3a2f0 | 378 | hppa-firmware.img \ |
a6fcc80b | 379 | opensbi-riscv32-sifive_u-fw_jump.bin opensbi-riscv32-virt-fw_jump.bin \ |
91f3a2f0 | 380 | opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin |
77755340 TS |
381 | else |
382 | BLOBS= | |
383 | endif | |
384 | ||
336cfef4 | 385 | # Note that we manually filter-out the non-Sphinx documentation which |
27a296fc PM |
386 | # is currently built into the docs/interop directory in the build tree, |
387 | # and also any sphinx-built manpages. | |
5f71eac0 | 388 | define install-manual = |
1290e671 | 389 | for d in $$(cd $(MANUAL_BUILDDIR) && find $1 -type d); do $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/$$d"; done |
27a296fc | 390 | for f in $$(cd $(MANUAL_BUILDDIR) && find $1 -type f -a '!' '(' -name '*.[0-9]' -o -name 'qemu-*-qapi.*' -o -name 'qemu-*-ref.*' ')' ); do $(INSTALL_DATA) "$(MANUAL_BUILDDIR)/$$f" "$(DESTDIR)$(qemu_docdir)/$$f"; done |
5f71eac0 PM |
391 | endef |
392 | ||
393 | # Note that we deliberately do not install the "devel" manual: it is | |
394 | # for QEMU developers, and not interesting to our users. | |
395 | .PHONY: install-sphinxdocs | |
396 | install-sphinxdocs: sphinxdocs | |
397 | $(call install-manual,interop) | |
0783a732 | 398 | $(call install-manual,specs) |
0928523a | 399 | $(call install-manual,system) |
65c3542b | 400 | $(call install-manual,tools) |
09147930 | 401 | $(call install-manual,user) |
5f71eac0 PM |
402 | |
403 | install-doc: $(DOCS) install-sphinxdocs | |
d7dd65ba | 404 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" |
22108f33 | 405 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)" |
c13dba2c LP |
406 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop" |
407 | $(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)/interop" | |
408 | $(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop" | |
96d409eb | 409 | ifdef CONFIG_POSIX |
58f8aead | 410 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" |
d06118bf | 411 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1" |
56e8bdd4 | 412 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7" |
d59157ea | 413 | $(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" |
acab923d | 414 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7" |
1bf84a1e | 415 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7" |
c932ce31 | 416 | ifeq ($(CONFIG_TOOLS),y) |
a08b4a9f | 417 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-img.1 "$(DESTDIR)$(mandir)/man1" |
58f8aead | 418 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" |
a08b4a9f | 419 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" |
38954dca | 420 | endif |
62dd1048 | 421 | ifdef CONFIG_TRACE_SYSTEMTAP |
a08b4a9f | 422 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1" |
62dd1048 | 423 | endif |
f15bff25 | 424 | ifeq ($(CONFIG_GUEST_AGENT),y) |
b53c54c6 | 425 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8" |
c13dba2c LP |
426 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop" |
427 | $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/interop" | |
428 | $(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)/interop" | |
d59157ea | 429 | $(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7" |
665b5d0d | 430 | endif |
8a3e8f7f | 431 | endif |
a2d8f1be MK |
432 | ifdef CONFIG_VIRTFS |
433 | $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" | |
a08b4a9f | 434 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" |
a2d8f1be | 435 | endif |
6a7e2bbe | 436 | ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy) |
a08b4a9f | 437 | $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtiofsd.1 "$(DESTDIR)$(mandir)/man1" |
6a7e2bbe | 438 | endif |
e2d87bff EH |
439 | |
440 | install-datadir: | |
441 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)" | |
442 | ||
f2e3978b LE |
443 | install-localstatedir: |
444 | ifdef CONFIG_POSIX | |
f15bff25 | 445 | ifeq ($(CONFIG_GUEST_AGENT),y) |
f2e3978b LE |
446 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run |
447 | endif | |
448 | endif | |
449 | ||
a8260d38 | 450 | ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 |
e2d87bff | 451 | |
54cb65d8 EC |
452 | install-includedir: |
453 | $(INSTALL_DIR) "$(DESTDIR)$(includedir)" | |
454 | ||
a5665051 PB |
455 | # Needed by "meson install" |
456 | export DESTDIR | |
54cb65d8 EC |
457 | install: all $(if $(BUILD_DOCS),install-doc) \ |
458 | install-datadir install-localstatedir install-includedir \ | |
1338a4b7 | 459 | recurse-install |
932a79df | 460 | ifneq ($(TOOLS),) |
0814465a | 461 | $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir)) |
932a79df | 462 | endif |
7b93fadf | 463 | ifneq ($(HELPERS-y),) |
0d659426 | 464 | $(call install-prog,$(HELPERS-y),$(DESTDIR)$(libexecdir)) |
7b93fadf | 465 | endif |
62dd1048 DB |
466 | ifdef CONFIG_TRACE_SYSTEMTAP |
467 | $(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir) | |
468 | endif | |
77755340 | 469 | ifneq ($(BLOBS),) |
77755340 | 470 | set -e; for x in $(BLOBS); do \ |
6aae2a2e | 471 | $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ |
ad064840 | 472 | done |
834574ea | 473 | endif |
a8260d38 | 474 | for s in $(ICON_SIZES); do \ |
6c11dda9 | 475 | mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \ |
a8260d38 | 476 | $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \ |
6c11dda9 | 477 | "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \ |
a8260d38 | 478 | done; \ |
6c11dda9 | 479 | mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \ |
a8260d38 | 480 | $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \ |
6c11dda9 SH |
481 | "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \ |
482 | mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \ | |
a8260d38 | 483 | $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \ |
6c11dda9 SH |
484 | "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg" |
485 | mkdir -p "$(DESTDIR)$(qemu_desktopdir)" | |
67ea9546 | 486 | $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \ |
6c11dda9 | 487 | "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop" |
2a6b5372 | 488 | ifdef CONFIG_GTK |
834574ea | 489 | $(MAKE) -C po $@ |
54cb65d8 EC |
490 | endif |
491 | ifeq ($(CONFIG_PLUGIN),y) | |
492 | $(INSTALL_DATA) $(SRC_PATH)/include/qemu/qemu-plugin.h "$(DESTDIR)$(includedir)/qemu-plugin.h" | |
77755340 | 493 | endif |
6aae2a2e | 494 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" |
18be8d77 | 495 | set -e; for x in $(KEYMAPS); do \ |
6aae2a2e | 496 | $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ |
ad064840 | 497 | done |
a81df1b6 PB |
498 | for d in $(TARGET_DIRS); do \ |
499 | $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \ | |
500 | done | |
612384d7 | 501 | |
3ef693a0 | 502 | # documentation |
e8518c92 | 503 | MAKEINFO=makeinfo |
d59157ea PB |
504 | MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D) |
505 | MAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES) | |
e8338fdb | 506 | TEXI2PODFLAGS=$(MAKEINFOINCLUDES) -DVERSION="$(VERSION)" -DCONFDIR="$(qemu_confdir)" |
d59157ea | 507 | TEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES) |
56e8bdd4 | 508 | |
e8338fdb MAL |
509 | docs/version.texi: $(SRC_PATH)/VERSION config-host.mak |
510 | $(call quiet-command,(\ | |
511 | echo "@set VERSION $(VERSION)" && \ | |
512 | echo "@set CONFDIR $(qemu_confdir)" \ | |
513 | )> $@,"GEN","$@") | |
fea346f5 | 514 | |
44cb280d | 515 | %.html: %.texi docs/version.texi |
e9ee06bd MAL |
516 | $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \ |
517 | --html $< -o $@,"GEN","$@") | |
3ef693a0 | 518 | |
44cb280d | 519 | %.info: %.texi docs/version.texi |
e9ee06bd | 520 | $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@") |
f3548328 | 521 | |
44cb280d | 522 | %.txt: %.texi docs/version.texi |
f8bab10b MAL |
523 | $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \ |
524 | --plaintext $< -o $@,"GEN","$@") | |
525 | ||
44cb280d | 526 | %.pdf: %.texi docs/version.texi |
d59157ea | 527 | $(call quiet-command,texi2pdf $(TEXI2PDFFLAGS) $< -o $@,"GEN","$@") |
bd7f9747 | 528 | |
5f71eac0 PM |
529 | # Sphinx builds all its documentation at once in one invocation |
530 | # and handles "don't rebuild things unless necessary" itself. | |
531 | # The '.doctrees' files are cached information to speed this up. | |
532 | .PHONY: sphinxdocs | |
0928523a PM |
533 | sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \ |
534 | $(MANUAL_BUILDDIR)/interop/index.html \ | |
535 | $(MANUAL_BUILDDIR)/specs/index.html \ | |
65c3542b | 536 | $(MANUAL_BUILDDIR)/system/index.html \ |
09147930 PB |
537 | $(MANUAL_BUILDDIR)/tools/index.html \ |
538 | $(MANUAL_BUILDDIR)/user/index.html | |
5f71eac0 PM |
539 | |
540 | # Canned command to build a single manual | |
27a296fc | 541 | # Arguments: $1 = manual name, $2 = Sphinx builder ('html' or 'man') |
6bda415c EH |
542 | # Note the use of different doctree for each (manual, builder) tuple; |
543 | # this works around Sphinx not handling parallel invocation on | |
544 | # a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946 | |
516e8b7d | 545 | build-manual = $(call quiet-command,CONFDIR="$(qemu_confdir)" $(SPHINX_BUILD) $(if $(V),,-q) $(SPHINX_WERROR) -b $2 -D version=$(VERSION) -D release="$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1") |
5f71eac0 | 546 | # We assume all RST files in the manual's directory are used in it |
814e068f | 547 | manual-deps = $(wildcard $(SRC_PATH)/docs/$1/*.rst $(SRC_PATH)/docs/$1/*/*.rst) \ |
de1572ca | 548 | $(SRC_PATH)/docs/defs.rst.inc \ |
9165d323 PM |
549 | $(SRC_PATH)/docs/$1/conf.py $(SRC_PATH)/docs/conf.py \ |
550 | $(SRC_PATH)/docs/sphinx/*.py | |
e0f3728d PM |
551 | # Macro to write out the rule and dependencies for building manpages |
552 | # Usage: $(call define-manpage-rule,manualname,manpage1 manpage2...[,extradeps]) | |
553 | # 'extradeps' is optional, and specifies extra files (eg .hx files) that | |
554 | # the manual page depends on. | |
555 | define define-manpage-rule | |
556 | $(call atomic,$(foreach manpage,$2,$(MANUAL_BUILDDIR)/$1/$(manpage)),$(call manual-deps,$1) $3) | |
557 | $(call build-manual,$1,man) | |
558 | endef | |
5f71eac0 | 559 | |
1290e671 | 560 | $(MANUAL_BUILDDIR)/devel/index.html: $(call manual-deps,devel) |
27a296fc | 561 | $(call build-manual,devel,html) |
5f71eac0 | 562 | |
a08b4a9f | 563 | $(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop) |
27a296fc | 564 | $(call build-manual,interop,html) |
5f71eac0 | 565 | |
0783a732 | 566 | $(MANUAL_BUILDDIR)/specs/index.html: $(call manual-deps,specs) |
27a296fc PM |
567 | $(call build-manual,specs,html) |
568 | ||
09ce5f2d | 569 | $(MANUAL_BUILDDIR)/system/index.html: $(call manual-deps,system) $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/qemu-options.hx |
0928523a PM |
570 | $(call build-manual,system,html) |
571 | ||
a08b4a9f | 572 | $(MANUAL_BUILDDIR)/tools/index.html: $(call manual-deps,tools) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc |
65c3542b PM |
573 | $(call build-manual,tools,html) |
574 | ||
09147930 PB |
575 | $(MANUAL_BUILDDIR)/user/index.html: $(call manual-deps,user) |
576 | $(call build-manual,user,html) | |
577 | ||
a08b4a9f | 578 | $(call define-manpage-rule,interop,qemu-ga.8) |
87c0868f | 579 | |
d06118bf | 580 | $(call define-manpage-rule,system,qemu.1 qemu-block-drivers.7 qemu-cpu-models.7) |
acab923d | 581 | |
a08b4a9f PM |
582 | $(call define-manpage-rule,tools,\ |
583 | qemu-img.1 qemu-nbd.8 qemu-trace-stap.1\ | |
584 | virtiofsd.1 virtfs-proxy-helper.1,\ | |
585 | $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/docs/qemu-option-trace.rst.inc) | |
586 | ||
22108f33 | 587 | $(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h |
d83bbeda | 588 | @mkdir -p "$(MANUAL_BUILDDIR)" |
22108f33 SH |
589 | $(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \ |
590 | "GEN","$@") | |
591 | ||
eb815e24 | 592 | docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi |
fb0bc835 | 593 | @cp -p $< $@ |
4afeeb57 | 594 | |
f15bff25 | 595 | docs/interop/qemu-ga-qapi.texi: qga/qga-qapi-doc.texi |
fb0bc835 | 596 | @cp -p $< $@ |
56e8bdd4 | 597 | |
5b1d0e92 PM |
598 | html: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs |
599 | info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info | |
600 | pdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf | |
601 | txt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt | |
818220f5 | 602 | |
d59157ea PB |
603 | docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \ |
604 | docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \ | |
605 | docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \ | |
606 | docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi | |
56e8bdd4 | 607 | |
d59157ea PB |
608 | docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \ |
609 | docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \ | |
610 | docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \ | |
611 | docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi | |
56e8bdd4 | 612 | |
ae560cc3 EB |
613 | $(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl |
614 | ||
fe8bf5f6 AB |
615 | # Reports/Analysis |
616 | ||
617 | %/coverage-report.html: | |
618 | @mkdir -p $* | |
619 | $(call quiet-command,\ | |
5eda6e42 AB |
620 | gcovr -r $(SRC_PATH) \ |
621 | $(foreach t, $(TARGET_DIRS), --object-directory $(BUILD_DIR)/$(t)) \ | |
622 | --object-directory $(BUILD_DIR) \ | |
337f2311 | 623 | -p --html --html-details -o $@, \ |
fe8bf5f6 AB |
624 | "GEN", "coverage-report.html") |
625 | ||
626 | .PHONY: coverage-report | |
627 | coverage-report: $(CURDIR)/reports/coverage/coverage-report.html | |
56e8bdd4 | 628 | |
f53ec699 SW |
629 | ifdef CONFIG_WIN32 |
630 | ||
631 | INSTALLER = qemu-setup-$(VERSION)$(EXESUF) | |
632 | ||
633 | nsisflags = -V2 -NOCD | |
634 | ||
635 | ifneq ($(wildcard $(SRC_PATH)/dll),) | |
636 | ifeq ($(ARCH),x86_64) | |
637 | # 64 bit executables | |
638 | DLL_PATH = $(SRC_PATH)/dll/w64 | |
639 | nsisflags += -DW64 | |
640 | else | |
641 | # 32 bit executables | |
642 | DLL_PATH = $(SRC_PATH)/dll/w32 | |
643 | endif | |
644 | endif | |
645 | ||
646 | .PHONY: installer | |
647 | installer: $(INSTALLER) | |
648 | ||
649 | INSTDIR=/tmp/qemu-nsis | |
650 | ||
1b00a4c4 PB |
651 | $(INSTALLER): $(SRC_PATH)/qemu.nsi |
652 | $(MAKE) install DESTDIR=${INSTDIR} | |
f53ec699 | 653 | ifdef SIGNCODE |
1b00a4c4 | 654 | (cd ${INSTDIR}/${bindir}; \ |
f53ec699 SW |
655 | for i in *.exe; do \ |
656 | $(SIGNCODE) $${i}; \ | |
657 | done \ | |
658 | ) | |
659 | endif # SIGNCODE | |
1b00a4c4 | 660 | (cd ${INSTDIR}/${bindir}; \ |
f53ec699 SW |
661 | for i in qemu-system-*.exe; do \ |
662 | arch=$${i%.exe}; \ | |
663 | arch=$${arch#qemu-system-}; \ | |
664 | echo Section \"$$arch\" Section_$$arch; \ | |
665 | echo SetOutPath \"\$$INSTDIR\"; \ | |
666 | echo File \"\$${BINDIR}\\$$i\"; \ | |
667 | echo SectionEnd; \ | |
668 | done \ | |
1b00a4c4 | 669 | ) >${INSTDIR}/${bindir}/system-emulations.nsh |
f53ec699 SW |
670 | makensis $(nsisflags) \ |
671 | $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \ | |
672 | $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \ | |
1b00a4c4 | 673 | -DBINDIR="${INSTDIR}/${bindir}" \ |
f53ec699 SW |
674 | $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \ |
675 | -DSRCDIR="$(SRC_PATH)" \ | |
676 | -DOUTFILE="$(INSTALLER)" \ | |
805d8a67 | 677 | -DDISPLAYVERSION="$(VERSION)" \ |
f53ec699 SW |
678 | $(SRC_PATH)/qemu.nsi |
679 | rm -r ${INSTDIR} | |
680 | ifdef SIGNCODE | |
681 | $(SIGNCODE) $(INSTALLER) | |
682 | endif # SIGNCODE | |
683 | endif # CONFIG_WIN | |
684 | ||
cb5fc67d AL |
685 | # Add a dependency on the generated files, so that they are always |
686 | # rebuilt before other object files | |
428952cf | 687 | ifneq ($(wildcard config-host.mak),) |
eaa2ddbb | 688 | ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) |
3dff199c | 689 | Makefile: $(generated-files-y) |
7748b8cb | 690 | endif |
428952cf | 691 | endif |
cb5fc67d | 692 | |
4fb240a4 | 693 | # Include automatically generated dependency files |
1435ddb8 PB |
694 | # Dependencies in Makefile.objs files come from our recursive subdir rules |
695 | -include $(wildcard *.d tests/*.d) | |
324027c2 FZ |
696 | |
697 | include $(SRC_PATH)/tests/docker/Makefile.include | |
b1fb9a63 | 698 | include $(SRC_PATH)/tests/vm/Makefile.include |
0d8e065f | 699 | |
c355de59 PMD |
700 | print-help-run = printf " %-30s - %s\\n" "$1" "$2" |
701 | print-help = $(quiet-@)$(call print-help-run,$1,$2) | |
702 | ||
0d8e065f MAL |
703 | .PHONY: help |
704 | help: | |
705 | @echo 'Generic targets:' | |
c355de59 | 706 | $(call print-help,all,Build all) |
0decdfe2 | 707 | ifdef CONFIG_MODULES |
c355de59 | 708 | $(call print-help,modules,Build all modules) |
0decdfe2 | 709 | endif |
c355de59 PMD |
710 | $(call print-help,dir/file.o,Build specified target only) |
711 | $(call print-help,install,Install QEMU, documentation and tools) | |
712 | $(call print-help,ctags/TAGS,Generate tags file for editors) | |
713 | $(call print-help,cscope,Generate cscope index) | |
968b4db3 | 714 | $(call print-help,sparse,Run sparse on the QEMU source) |
0d8e065f | 715 | @echo '' |
2b1f35b9 | 716 | @$(if $(TARGET_DIRS), \ |
0d8e065f | 717 | echo 'Architecture specific targets:'; \ |
2b1f35b9 | 718 | $(foreach t, $(TARGET_DIRS), \ |
763815a8 PMD |
719 | $(call print-help-run,$(t)/all,Build for $(t)); \ |
720 | $(if $(CONFIG_FUZZ), \ | |
721 | $(if $(findstring softmmu,$(t)), \ | |
722 | $(call print-help-run,$(t)/fuzz,Build fuzzer for $(t)); \ | |
723 | ))) \ | |
0d8e065f | 724 | echo '') |
fdbff6bd PMD |
725 | @$(if $(HELPERS-y), \ |
726 | echo 'Helper targets:'; \ | |
727 | $(foreach t, $(HELPERS-y), \ | |
728 | $(call print-help-run,$(t),Build $(shell basename $(t)));) \ | |
729 | echo '') | |
81ed0a57 PMD |
730 | @$(if $(TOOLS), \ |
731 | echo 'Tools targets:'; \ | |
732 | $(foreach t, $(TOOLS), \ | |
733 | $(call print-help-run,$(t),Build $(shell basename $(t)) tool);) \ | |
0d8e065f MAL |
734 | echo '') |
735 | @echo 'Cleaning targets:' | |
c355de59 | 736 | $(call print-help,clean,Remove most generated files but keep the config) |
c355de59 PMD |
737 | $(call print-help,distclean,Remove all generated files) |
738 | $(call print-help,dist,Build a distributable tarball) | |
0d8e065f MAL |
739 | @echo '' |
740 | @echo 'Test targets:' | |
c355de59 PMD |
741 | $(call print-help,check,Run all tests (check-help for details)) |
742 | $(call print-help,docker,Help about targets running tests inside containers) | |
743 | $(call print-help,vm-help,Help about targets running tests inside VM) | |
0d8e065f MAL |
744 | @echo '' |
745 | @echo 'Documentation targets:' | |
c355de59 | 746 | $(call print-help,html info pdf txt,Build documentation in specified format) |
0d8e065f MAL |
747 | @echo '' |
748 | ifdef CONFIG_WIN32 | |
749 | @echo 'Windows targets:' | |
c355de59 | 750 | $(call print-help,installer,Build NSIS-based installer for QEMU) |
0d8e065f | 751 | ifdef QEMU_GA_MSI_ENABLED |
c355de59 | 752 | $(call print-help,msi,Build MSI-based installer for qemu-ga) |
0d8e065f MAL |
753 | endif |
754 | @echo '' | |
755 | endif | |
c355de59 PMD |
756 | $(call print-help,$(MAKE) [targets],(quiet build, default)) |
757 | $(call print-help,$(MAKE) V=1 [targets],(verbose build)) |