Skip to content

Commit 87d599f

Browse files
committed
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 <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
1 parent 3d57e1b commit 87d599f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ NAME = Hurr durr I'ma ninja sloth
1111
# Comments in this file are targeted only to the developer, do not
1212
# expect to learn how to build the kernel reading this file.
1313

14+
ifeq ($(filter undefine,$(.FEATURES)),)
15+
$(error GNU Make >= 3.82 is required. Your Make version is $(MAKE_VERSION))
16+
endif
17+
1418
$(if $(filter __%, $(MAKECMDGOALS)), \
1519
$(error targets prefixed with '__' are only for internal use))
1620

0 commit comments

Comments
 (0)