meson: sphinx-build
[qemu.git] / Makefile
1 # Makefile for QEMU.
2
3 ifneq ($(words $(subst :, ,$(CURDIR))), 1)
4 $(error main directory cannot contain spaces nor colons)
5 endif
6
7 # Always point to the root of the build tree (needs GNU make).
8 BUILD_DIR=$(CURDIR)
9
10 # Before including a proper config-host.mak, assume we are in the source tree
11 SRC_PATH=.
12
13 UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
14 html info pdf txt \
15 help check-help print-% \
16 docker docker-% vm-help vm-test vm-build-%
17
18 # All following code might depend on configuration variables
19 ifneq ($(wildcard config-host.mak),)
20 # Put the all: rule here so that config-host.mak can contain dependencies.
21 all:
22 include config-host.mak
23
24 git-submodule-update:
25
26 .PHONY: git-submodule-update
27
28 git_module_status := $(shell \
29 cd '$(SRC_PATH)' && \
30 GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
31 echo $$?; \
32 )
33
34 ifeq (1,$(git_module_status))
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
45 git-submodule-update:
46 $(call quiet-command, \
47 (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
48 "GIT","$(GIT_SUBMODULES)")
49 endif
50 endif
51
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
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
79 .git-submodule-status: git-submodule-update config-host.mak
80
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 \
87 "$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
88 endif
89 endif
90
91 CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
92 CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
93 CONFIG_XEN := $(CONFIG_XEN_BACKEND)
94 CONFIG_ALL=y
95 -include config-all-devices.mak
96 -include config-all-disas.mak
97
98 config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
99 @echo $@ is out-of-date, running configure
100 @if test -f meson-private/coredata.dat; then \
101 ./config.status --skip-meson; \
102 else \
103 ./config.status; \
104 fi
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
111 else
112 config-host.mak:
113 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
114 @echo "Please call configure before running make!"
115 @exit 1
116 endif
117 endif
118
119 include $(SRC_PATH)/rules.mak
120
121 # lor is defined in rules.mak
122 CONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS))
123
124 generated-files-y += .git-submodule-status
125
126 # Don't try to regenerate Makefile or configure
127 # We don't generate any of them
128 Makefile: ;
129 configure: ;
130
131 .PHONY: all clean cscope distclean html info install install-doc \
132 pdf txt recurse-all dist msi FORCE
133
134 $(call set-vpath, $(SRC_PATH))
135
136 LIBS+=-lz $(LIBS_TOOLS)
137
138 ifdef BUILD_DOCS
139 DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
140 DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
141 else
142 DOCS=
143 endif
144
145 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
146
147 ifneq ($(wildcard config-host.mak),)
148 include $(SRC_PATH)/Makefile.objs
149 endif
150
151 include $(SRC_PATH)/tests/Makefile.include
152
153 all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) recurse-all modules
154
155 # LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC
156 DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib=""
157 DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
158 DTC_CPPFLAGS=-I$(SRC_PATH)/dtc/libfdt
159
160 .PHONY: dtc/all
161 dtc/all: .git-submodule-status dtc/libfdt
162 $(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,)
163
164 dtc/%: .git-submodule-status
165 @mkdir -p $@
166
167 # Overriding CFLAGS causes us to lose defines added in the sub-makefile.
168 # Not overriding CFLAGS leads to mis-matches between compilation modes.
169 # Therefore we replicate some of the logic in the sub-makefile.
170 # Remove all the extra -Warning flags that QEMU uses that Capstone doesn't;
171 # no need to annoy QEMU developers with such things.
172 CAP_CFLAGS = $(patsubst -W%,,$(CFLAGS) $(QEMU_CFLAGS))
173 CAP_CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
174 CAP_CFLAGS += -DCAPSTONE_HAS_ARM
175 CAP_CFLAGS += -DCAPSTONE_HAS_ARM64
176 CAP_CFLAGS += -DCAPSTONE_HAS_POWERPC
177 CAP_CFLAGS += -DCAPSTONE_HAS_X86
178
179 .PHONY: capstone/all
180 capstone/all: .git-submodule-status
181 $(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))
182
183 .PHONY: slirp/all
184 slirp/all: .git-submodule-status
185 $(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp \
186 BUILD_DIR="$(BUILD_DIR)/slirp" \
187 PKG_CONFIG="$(PKG_CONFIG)" \
188 CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" \
189 CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
190
191 ROM_DIRS = $(addprefix pc-bios/, $(ROMS))
192 ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
193 # Only keep -O and -g cflags
194 .PHONY: $(ROM_DIRS_RULES)
195 $(ROM_DIRS_RULES):
196 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
197
198 .PHONY: recurse-all recurse-clean
199 recurse-all: $(ROM_DIRS)
200 recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
201
202 ######################################################################
203
204 clean: recurse-clean ninja-clean clean-ctlist
205 -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean
206 # avoid old build problems by removing potentially incorrect old files
207 rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
208 find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
209 ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
210 ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
211 ! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
212 -exec rm {} +
213 rm -f TAGS cscope.* *.pod *~ */*~
214 rm -f fsdev/*.pod scsi/*.pod
215 rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
216
217 VERSION ?= $(shell cat VERSION)
218
219 dist: qemu-$(VERSION).tar.bz2
220
221 qemu-%.tar.bz2:
222 $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
223
224 distclean: clean ninja-distclean
225 -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean -g
226 rm -f config-host.mak config-host.h* $(DOCS)
227 rm -f tests/tcg/config-*.mak
228 rm -f config-all-disas.mak config.status
229 rm -f po/*.mo tests/qemu-iotests/common.env
230 rm -f roms/seabios/config.mak roms/vgabios/config.mak
231 rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols
232 rm -f *-config-target.h *-config-devices.mak *-config-devices.h
233 rm -rf meson-private meson-logs meson-info compile_commands.json
234 rm -f Makefile.ninja ninjatool ninjatool.stamp Makefile.mtest
235 rm -f config.log
236 rm -f linux-headers/asm
237 rm -f docs/version.texi
238 rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi
239 rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7
240 rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
241 rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
242 rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
243 rm -Rf .sdk
244
245 KEYMAPS=da en-gb et fr fr-ch is lt no pt-br sv \
246 ar de en-us fi fr-be hr it lv nl pl ru th \
247 de-ch es fo fr-ca hu ja mk pt sl tr \
248 bepo cz
249
250 ifdef INSTALL_BLOBS
251 BLOBS=bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
252 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
253 vgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin \
254 openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
255 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
256 pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
257 efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
258 efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \
259 efi-e1000e.rom efi-vmxnet3.rom \
260 qemu-nsis.bmp \
261 bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
262 multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin \
263 s390-ccw.img s390-netboot.img \
264 slof.bin skiboot.lid \
265 palcode-clipper \
266 u-boot.e500 u-boot-sam460-20100605.bin \
267 qemu_vga.ndrv \
268 edk2-licenses.txt \
269 hppa-firmware.img \
270 opensbi-riscv32-sifive_u-fw_jump.bin opensbi-riscv32-virt-fw_jump.bin \
271 opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin
272 else
273 BLOBS=
274 endif
275
276 install-doc: $(DOCS)
277 $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
278 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
279 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
280 ifdef CONFIG_POSIX
281 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
282 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1"
283 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
284 $(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
285 ifeq ($(CONFIG_GUEST_AGENT),y)
286 $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
287 $(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
288 $(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
289 endif
290 endif
291 ifdef CONFIG_VIRTFS
292 $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
293 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
294 endif
295 ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
296 $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/virtiofsd.1 "$(DESTDIR)$(mandir)/man1"
297 endif
298
299 install-datadir:
300 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
301
302 install-localstatedir:
303 ifdef CONFIG_POSIX
304 ifeq ($(CONFIG_GUEST_AGENT),y)
305 $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run
306 endif
307 endif
308
309 ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
310
311 # Needed by "meson install"
312 export DESTDIR
313 install: all $(if $(BUILD_DOCS),install-doc) \
314 install-datadir install-localstatedir
315 ifdef CONFIG_TRACE_SYSTEMTAP
316 $(INSTALL_PROG) "scripts/qemu-trace-stap" $(DESTDIR)$(bindir)
317 endif
318 ifneq ($(BLOBS),)
319 set -e; for x in $(BLOBS); do \
320 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
321 done
322 endif
323 for s in $(ICON_SIZES); do \
324 mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
325 $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
326 "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \
327 done; \
328 mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps"; \
329 $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \
330 "$(DESTDIR)$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \
331 mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps"; \
332 $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \
333 "$(DESTDIR)$(qemu_icondir)/hicolor/scalable/apps/qemu.svg"
334 mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
335 $(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
336 "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
337 ifdef CONFIG_GTK
338 $(MAKE) -C po $@
339 endif
340 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
341 set -e; for x in $(KEYMAPS); do \
342 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
343 done
344
345 # documentation
346 MAKEINFO=makeinfo
347 MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
348 MAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES)
349 TEXI2PODFLAGS=$(MAKEINFOINCLUDES) -DVERSION="$(VERSION)" -DCONFDIR="$(qemu_confdir)"
350 TEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES)
351
352 docs/version.texi: $(SRC_PATH)/VERSION config-host.mak
353 $(call quiet-command,(\
354 echo "@set VERSION $(VERSION)" && \
355 echo "@set CONFDIR $(qemu_confdir)" \
356 )> $@,"GEN","$@")
357
358 %.html: %.texi docs/version.texi
359 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
360 --html $< -o $@,"GEN","$@")
361
362 %.info: %.texi docs/version.texi
363 $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@")
364
365 %.txt: %.texi docs/version.texi
366 $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
367 --plaintext $< -o $@,"GEN","$@")
368
369 %.pdf: %.texi docs/version.texi
370 $(call quiet-command,texi2pdf $(TEXI2PDFFLAGS) $< -o $@,"GEN","$@")
371
372 docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi
373 @cp -p $< $@
374
375 docs/interop/qemu-ga-qapi.texi: qga/qga-qapi-doc.texi
376 @cp -p $< $@
377
378 html: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs
379 info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
380 pdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
381 txt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
382
383 docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \
384 docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \
385 docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \
386 docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi
387
388 docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \
389 docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \
390 docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \
391 docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi
392
393 $(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl
394 $(call quiet-command, \
395 perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $(TEXI2PODFLAGS) $< $@.pod && \
396 $(POD2MAN) --section=$(subst .,,$(suffix $@)) --center=" " --release=" " $@.pod > $@, \
397 "GEN","$@")
398
399 man: $(filter %.1 %.7 %.8,$(DOCS))
400
401 ifdef CONFIG_WIN32
402
403 INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
404
405 nsisflags = -V2 -NOCD
406
407 ifneq ($(wildcard $(SRC_PATH)/dll),)
408 ifeq ($(ARCH),x86_64)
409 # 64 bit executables
410 DLL_PATH = $(SRC_PATH)/dll/w64
411 nsisflags += -DW64
412 else
413 # 32 bit executables
414 DLL_PATH = $(SRC_PATH)/dll/w32
415 endif
416 endif
417
418 .PHONY: installer
419 installer: $(INSTALLER)
420
421 INSTDIR=/tmp/qemu-nsis
422
423 $(INSTALLER): $(SRC_PATH)/qemu.nsi
424 $(MAKE) install DESTDIR=${INSTDIR}
425 ifdef SIGNCODE
426 (cd ${INSTDIR}/${bindir}; \
427 for i in *.exe; do \
428 $(SIGNCODE) $${i}; \
429 done \
430 )
431 endif # SIGNCODE
432 (cd ${INSTDIR}/${bindir}; \
433 for i in qemu-system-*.exe; do \
434 arch=$${i%.exe}; \
435 arch=$${arch#qemu-system-}; \
436 echo Section \"$$arch\" Section_$$arch; \
437 echo SetOutPath \"\$$INSTDIR\"; \
438 echo File \"\$${BINDIR}\\$$i\"; \
439 echo SectionEnd; \
440 done \
441 ) >${INSTDIR}/${bindir}/system-emulations.nsh
442 makensis $(nsisflags) \
443 $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
444 $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
445 -DBINDIR="${INSTDIR}/${bindir}" \
446 $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
447 -DSRCDIR="$(SRC_PATH)" \
448 -DOUTFILE="$(INSTALLER)" \
449 -DDISPLAYVERSION="$(VERSION)" \
450 $(SRC_PATH)/qemu.nsi
451 rm -r ${INSTDIR}
452 ifdef SIGNCODE
453 $(SIGNCODE) $(INSTALLER)
454 endif # SIGNCODE
455 endif # CONFIG_WIN
456
457 # Add a dependency on the generated files, so that they are always
458 # rebuilt before other object files
459 ifneq ($(wildcard config-host.mak),)
460 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
461 Makefile: $(generated-files-y)
462 endif
463 endif
464
465 # Include automatically generated dependency files
466 # Dependencies in Makefile.objs files come from our recursive subdir rules
467 -include $(wildcard *.d tests/*.d)
468
469 include $(SRC_PATH)/tests/docker/Makefile.include
470 include $(SRC_PATH)/tests/vm/Makefile.include
471
472 print-help-run = printf " %-30s - %s\\n" "$1" "$2"
473 print-help = $(quiet-@)$(call print-help-run,$1,$2)
474
475 .PHONY: help
476 help:
477 @echo 'Generic targets:'
478 $(call print-help,all,Build all)
479 ifdef CONFIG_MODULES
480 $(call print-help,modules,Build all modules)
481 endif
482 $(call print-help,dir/file.o,Build specified target only)
483 $(call print-help,install,Install QEMU, documentation and tools)
484 $(call print-help,ctags/TAGS,Generate tags file for editors)
485 $(call print-help,cscope,Generate cscope index)
486 $(call print-help,sparse,Run sparse on the QEMU source)
487 @echo ''
488 @echo 'Cleaning targets:'
489 $(call print-help,clean,Remove most generated files but keep the config)
490 $(call print-help,distclean,Remove all generated files)
491 $(call print-help,dist,Build a distributable tarball)
492 @echo ''
493 @echo 'Test targets:'
494 $(call print-help,check,Run all tests (check-help for details))
495 $(call print-help,docker,Help about targets running tests inside containers)
496 $(call print-help,vm-help,Help about targets running tests inside VM)
497 @echo ''
498 @echo 'Documentation targets:'
499 $(call print-help,html info pdf txt,Build documentation in specified format)
500 @echo ''
501 ifdef CONFIG_WIN32
502 @echo 'Windows targets:'
503 $(call print-help,installer,Build NSIS-based installer for QEMU)
504 ifdef QEMU_GA_MSI_ENABLED
505 $(call print-help,msi,Build MSI-based installer for qemu-ga)
506 endif
507 @echo ''
508 endif
509 $(call print-help,$(MAKE) [targets],(quiet build, default))
510 $(call print-help,$(MAKE) V=1 [targets],(verbose build))