Skip to contentSkip to conversation

Makefile: Remove qemu-version.h and qemu-options.def during 'make distclean'

PATCH Superseded Philippe Mathieu-Daudé 2 participants 2 messages Jun 8, 2018 – Jun 9, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Remove qemu-version.h and qemu-options.def during 'make distclean'

qemu-version.h and qemu-options.def are generated files that should be deleted during 'make distclean'.

This solves building issues with out-of-tree builds from a source tree that has been built in (see d1bd2423a90).

This solves:

- /qemu-version.h existing in source tree:

/source/qemu/qemu-nbd.c: In function ‘version’:
/source/qemu/qemu-nbd.c:133:6: error: expected ‘)’ before ‘QEMU_FULL_VERSION’
"%s " QEMU_FULL_VERSION "\n"
^~~~~~~~~~~~~~~~~~
)
/source/qemu/qemu-nbd.c:133:3: error: format ‘%s’ expects a matching ‘char *’ argument [-Werror=format=]
"%s " QEMU_FULL_VERSION "\n"
~^
cc1: all warnings being treated as errors

- /qemu-options.def existing in source tree:

/source/qemu/vl.c: In function ‘main’:
/source/qemu/vl.c:3052:18: error: ‘QEMU_OPTION_blockdev’ undeclared (first use in this function); did you mean ‘QEMU_OPTION_clock’?
case QEMU_OPTION_blockdev:
^~~~~~~~~~~~~~~~~~~~
QEMU_OPTION_clock
/source/qemu/vl.c:3052:18: note: each undeclared identifier is reported only once for each function it appears in

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 023b3437ec..7ae453ffa2 100644
@@ -757,6 +757,7 @@ qemu-%.tar.bz2:
 distclean: clean
 	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi qemu-monitor-info.texi
 	rm -f config-all-devices.mak config-all-disas.mak config.status
+	rm -f qemu-version.h qemu-options.def
 	rm -f po/*.mo tests/qemu-iotests/common.env
 	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Philippe Mathieu-Daudé

qemu-version.h and qemu-options.def are generated files that should be deleted during 'make distclean'.

These are both in GENERATED_FILES, and 'make distclean' invokes 'make clean' which does an rm of all GENERATED_FILES. Why isn't that sufficient here?

thanks
-- PMM