[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20221213112420.3320301-1-masahiroy@kernel.org>
Date: Tue, 13 Dec 2022 20:24:20 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nicolas Schier <nicolas@...sle.eu>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: [PATCH v4] kbuild: ensure Make >= 3.82 is used
Documentation/process/changes.rst notes the minimal GNU Make version,
but it is not checked anywhere.
We could check $(MAKE_VERSION), but another simple way is to check
$(.FEATURES) since the feature list always grows.
GNU Make 3.81 expands $(.FEATURES) to:
target-specific order-only second-expansion else-if archives jobserver check-symlink
GNU Make 3.82 expands $(.FEATURES) to:
target-specific order-only second-expansion else-if shortest-stem undefine archives jobserver check-symlink
To ensure Make >= 3.82, you can check either 'shortest-stem' or
'undefine'.
This way is not always possible. For example, Make 4.0 through 4.2 have
the same set of $(.FEATURES). At that point, we will need to come up
with a different approach.
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
Reviewed-by: Nicolas Schier <nicolas@...sle.eu>
---
Changes in v4:
- Show the minumal required version in the error message
- More commit description
Changes in v3:
- Check the version in a different way
Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index 591485152a95..7f831e63b39b 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,10 @@ NAME = Hurr durr I'ma ninja sloth
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.
+ifeq ($(filter undefine,$(.FEATURES)),)
+$(error GNU Make >= 3.82 is required. Your Make version is $(MAKE_VERSION))
+endif
+
$(if $(filter __%, $(MAKECMDGOALS)), \
$(error targets prefixed with '__' are only for internal use))
--
2.34.1
Powered by blists - more mailing lists