History

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/.

Masahiro Yamada committed 2 years ago

Commit 5f996651 parent 712aba53 files · +6 −22Browse files

Unified · Split

3 files
  1. Documentation/process/changes.rst +2 −2
  2. Makefile +3 −19
  3. scripts/Kbuild.include +1 −1
Documentation/process/changes.rst+2−2
@@ -33,7 +33,7 @@ GNU C 5.1 gcc --version · 32 unmodified lines
33Clang/LLVM (optional) 13.0.1 clang --version33Clang/LLVM (optional) 13.0.1 clang --version
34Rust (optional) 1.78.0 rustc --version34Rust (optional) 1.78.0 rustc --version
35bindgen (optional) 0.65.1 bindgen --version35bindgen (optional) 0.65.1 bindgen --version
36GNU make 3.82 make --version36GNU make 4.0 make --version
37bash 4.2 bash --version37bash 4.2 bash --version
38binutils 2.25 ld -v38binutils 2.25 ld -v
39flex 2.5.35 flex --version39flex 2.5.35 flex --version
@@ -111,7 +111,7 @@ It depends on ``libclang``. · 71 unmodified lines
111Make111Make
112----112----
113 113
114You will need GNU make 3.82 or later to build the kernel.114You will need GNU make 4.0 or later to build the kernel.
115 115
116Bash116Bash
117----117----
Makefile+3−19
@@ -11,8 +11,8 @@ NAME = Baby Opossum Posse · 10 unmodified lines
11# Comments in this file are targeted only to the developer, do not11# Comments in this file are targeted only to the developer, do not
12# expect to learn how to build the kernel reading this file.12# expect to learn how to build the kernel reading this file.
13 13
14ifeq ($(filter undefine,$(.FEATURES)),)14ifeq ($(filter output-sync,$(.FEATURES)),)
15$(error GNU Make >= 3.82 is required. Your Make version is $(MAKE_VERSION))15$(error GNU Make >= 4.0 is required. Your Make version is $(MAKE_VERSION))
16endif16endif
17 17
18$(if $(filter __%, $(MAKECMDGOALS)), \18$(if $(filter __%, $(MAKECMDGOALS)), \
@@ -93,15 +93,7 @@ endif · 74 unmodified lines
93 93
94# If the user is running make -s (silent mode), suppress echoing of94# If the user is running make -s (silent mode), suppress echoing of
95# commands95# commands
96# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.96ifneq ($(findstring s,$(firstword -$(MAKEFLAGS))),)
97
98ifeq ($(filter 3.%,$(MAKE_VERSION)),)
99short-opts := $(firstword -$(MAKEFLAGS))
100else
101short-opts := $(filter-out --%,$(MAKEFLAGS))
102endif
103
104ifneq ($(findstring s,$(short-opts)),)
105quiet=silent_97quiet=silent_
106override KBUILD_VERBOSE :=98override KBUILD_VERBOSE :=
107endif99endif
@@ -201,14 +193,6 @@ ifneq ($(words $(subst :, ,$(abs_srctree))), 1) · 93 unmodified lines
201$(error source directory cannot contain spaces or colons)193$(error source directory cannot contain spaces or colons)
202endif194endif
203 195
204ifneq ($(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.
207need-sub-make := 1
208# Cancel implicit rules for this Makefile.
209$(this-makefile): ;
210endif
211
212export sub_make_done := 1196export sub_make_done := 1
213 197
214endif # sub_make_done198endif # sub_make_done
scripts/Kbuild.include+1−1
@@ -68,7 +68,7 @@ kbuild-file = $(or $(wildcard $(src)/Kbuild),$(src)/Makefile) · 67 unmodified lines
68# Read a file, replacing newlines with spaces68# Read a file, replacing newlines with spaces
69#69#
70# Make 4.2 or later can read a file by using its builtin function.70# Make 4.2 or later can read a file by using its builtin function.
71ifneq ($(filter-out 3.% 4.0 4.1, $(MAKE_VERSION)),)71ifneq ($(filter-out 4.0 4.1, $(MAKE_VERSION)),)
72read-file = $(subst $(newline),$(space),$(file < $1))72read-file = $(subst $(newline),$(space),$(file < $1))
73else73else
74read-file = $(shell cat $1 2>/dev/null)74read-file = $(shell cat $1 2>/dev/null)