[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2] Makefile: Check for more dangling scratch files
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v2] Makefile: Check for more dangling scratch files in out-of-tree builds |
Date: |
Sat, 9 Jun 2018 12:10:48 -0300 |
It is easy to catch the generated 'config-host.mak' in the source
tree, however qemu-version.h and qemu-options.def are also generated
files and are hidden by .gitignore rules.
Improve the out-of-tree safety net rule added in d1bd2423a90,
by also checking for these two files.
This solves building issues with out-of-tree builds from a
source tree that has been built in:
- /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
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
Since v1 http://lists.nongnu.org/archive/html/qemu-devel/2018-06/msg02254.html:
Peter noticed [1] those files already are in GENERATED_FILES
[1] http://lists.nongnu.org/archive/html/qemu-devel/2018-06/msg02338.html
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 023b3437ec..521009964c 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,8 @@ endif
# Check that we're not trying to do an out-of-tree build from
# a tree that's been used for an in-tree build.
ifneq ($(realpath $(SRC_PATH)),$(realpath .))
-ifneq ($(wildcard $(SRC_PATH)/config-host.mak),)
+scratch_files = config-host.mak qemu-version.h qemu-options.def
+ifneq ($(wildcard $(addprefix $(SRC_PATH)/,$(scratch_files))),)
$(error This is an out of tree build but your source tree ($(SRC_PATH)) \
seems to have been used for an in-tree build. You can fix this by running \
"$(MAKE) distclean && rm -rf *-linux-user *-softmmu" in your source tree)
--
2.17.1
- [Qemu-devel] [PATCH v2] Makefile: Check for more dangling scratch files in out-of-tree builds,
Philippe Mathieu-Daudé <=