diff options
author | haibiao.xiao <xiaohaibiao331@outlook.com> | 2021-12-10 11:07:08 +0800 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-12-14 15:01:26 +0000 |
commit | 642f35bfe8d9d3d4bb84031f72c049859dbc35a6 (patch) | |
tree | 535bfcb59a4284d55c1956d7320a23e574240f88 | |
parent | 7a60af05c183eb25deb1c5a333c232c42eea5944 (diff) | |
download | kvmtool-642f35bfe8d9d3d4bb84031f72c049859dbc35a6.tar.gz |
Makefile: Calculate the correct kvmtool version
Command 'lvm version' works incorrect.
It is expected to print:
# ./lvm version
# kvm tool [KVMTOOLS_VERSION]
but the KVMTOOLS_VERSION is missed:
# ./lvm version
# kvm tool
The KVMTOOLS_VERSION is defined in the KVMTOOLS-VERSION-FILE file which
is included at the end of Makefile. Since the CFLAGS is a 'Simply
expanded variables' which means CFLAGS is only scanned once. So the
definetion of KVMTOOLS_VERSION at the end of Makefile would not scanned
by CFLAGS. So the '-DKVMTOOLS_VERSION=' remains empty.
I fixed the bug by moving the '-include $(OUTPUT)KVMTOOLS-VERSION-FILE'
before the CFLAGS.
Signed-off-by: haibiao.xiao <xiaohaibiao331@outlook.com>
Tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20211210030708.288066-1-haibiao.xiao@zstack.io
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -17,6 +17,7 @@ export E Q include config/utilities.mak include config/feature-tests.mak +-include $(OUTPUT)KVMTOOLS-VERSION-FILE CC := $(CROSS_COMPILE)gcc CFLAGS := @@ -559,5 +560,4 @@ ifneq ($(MAKECMDGOALS),clean) KVMTOOLS-VERSION-FILE: @$(SHELL_PATH) util/KVMTOOLS-VERSION-GEN $(OUTPUT) --include $(OUTPUT)KVMTOOLS-VERSION-FILE -endif +endif
\ No newline at end of file |