[lkml]   [2017]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] kbuild: add GNU Make version check
As Documentation/process/changes.rst says, Kbuild now depends on
GNU Make 3.81 or later.

If invoked with older versions, it fails with an unclear error

$ make defconfig
HOSTCC scripts/basic/fixdep
scripts/ *** missing separator. Stop.
make: *** [defconfig] Error 2

Stop building with a clearer message:

Makefile:16: *** GNU Make >= 3.81 is required. You are running version 3.80. Stop.

I borrowed the idea from Buildroot.

Signed-off-by: Masahiro Yamada <>

Makefile | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index d8b5c4230da0..5baaebf8f23a 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,12 @@ NAME = Fearless Coyote
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.

+# Check Make version (note: this check will break at Make 10.x)
+ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION))
+$(error GNU Make >= $(MIN_MAKE_VERSION) is required. You are running version $(MAKE_VERSION))
# o Do not use make's built-in rules and variables
# (this increases performance and avoids hard-to-debug behaviour);
# o Look for make include files relative to root of kernel src
 \ /
  Last update: 2017-05-19 09:11    [W:0.019 / U:5.100 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site