Skip to content

Commit 5f99665

Browse files
committed
kbuild: raise the minimum GNU Make requirement to 4.0
RHEL/CentOS 7, popular distributions that install GNU Make 3.82, reached EOM/EOL on June 30, 2024. While you may get extended support, it is a good time to raise the minimum GNU Make version. The new requirement, GNU Make 4.0, was released in October, 2013. I did not touch the Makefiles under tools/ because I do not know the requirements for building tools. I do not find any GNU Make version checks under tools/. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
1 parent 712aba5 commit 5f99665

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

Documentation/process/changes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ GNU C 5.1 gcc --version
3333
Clang/LLVM (optional) 13.0.1 clang --version
3434
Rust (optional) 1.78.0 rustc --version
3535
bindgen (optional) 0.65.1 bindgen --version
36-
GNU make 3.82 make --version
36+
GNU make 4.0 make --version
3737
bash 4.2 bash --version
3838
binutils 2.25 ld -v
3939
flex 2.5.35 flex --version
@@ -111,7 +111,7 @@ It depends on ``libclang``.
111111
Make
112112
----
113113

114-
You will need GNU make 3.82 or later to build the kernel.
114+
You will need GNU make 4.0 or later to build the kernel.
115115

116116
Bash
117117
----

Makefile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ NAME = Baby Opossum Posse
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))
14+
ifeq ($(filter output-sync,$(.FEATURES)),)
15+
$(error GNU Make >= 4.0 is required. Your Make version is $(MAKE_VERSION))
1616
endif
1717

1818
$(if $(filter __%, $(MAKECMDGOALS)), \
@@ -93,15 +93,7 @@ endif
9393

9494
# If the user is running make -s (silent mode), suppress echoing of
9595
# commands
96-
# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
97-
98-
ifeq ($(filter 3.%,$(MAKE_VERSION)),)
99-
short-opts := $(firstword -$(MAKEFLAGS))
100-
else
101-
short-opts := $(filter-out --%,$(MAKEFLAGS))
102-
endif
103-
104-
ifneq ($(findstring s,$(short-opts)),)
96+
ifneq ($(findstring s,$(firstword -$(MAKEFLAGS))),)
10597
quiet=silent_
10698
override KBUILD_VERBOSE :=
10799
endif
@@ -201,14 +193,6 @@ ifneq ($(words $(subst :, ,$(abs_srctree))), 1)
201193
$(error source directory cannot contain spaces or colons)
202194
endif
203195

204-
ifneq ($(filter 3.%,$(MAKE_VERSION)),)
205-
# 'MAKEFLAGS += -rR' does not immediately become effective for GNU Make 3.x
206-
# We need to invoke sub-make to avoid implicit rules in the top Makefile.
207-
need-sub-make := 1
208-
# Cancel implicit rules for this Makefile.
209-
$(this-makefile): ;
210-
endif
211-
212196
export sub_make_done := 1
213197

214198
endif # sub_make_done

scripts/Kbuild.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ kbuild-file = $(or $(wildcard $(src)/Kbuild),$(src)/Makefile)
6868
# Read a file, replacing newlines with spaces
6969
#
7070
# Make 4.2 or later can read a file by using its builtin function.
71-
ifneq ($(filter-out 3.% 4.0 4.1, $(MAKE_VERSION)),)
71+
ifneq ($(filter-out 4.0 4.1, $(MAKE_VERSION)),)
7272
read-file = $(subst $(newline),$(space),$(file < $1))
7373
else
7474
read-file = $(shell cat $1 2>/dev/null)

0 commit comments

Comments
 (0)