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/.
Unified · Split
| @@ -33,7 +33,7 @@ GNU C 5.1 gcc --version · 32 unmodified lines | |||
| 33 | Clang/LLVM (optional) 13.0.1 clang --version | 33 | Clang/LLVM (optional) 13.0.1 clang --version |
| 34 | Rust (optional) 1.78.0 rustc --version | 34 | Rust (optional) 1.78.0 rustc --version |
| 35 | bindgen (optional) 0.65.1 bindgen --version | 35 | bindgen (optional) 0.65.1 bindgen --version |
| 36 | GNU make 3.82 make --version | 36 | GNU make 4.0 make --version |
| 37 | bash 4.2 bash --version | 37 | bash 4.2 bash --version |
| 38 | binutils 2.25 ld -v | 38 | binutils 2.25 ld -v |
| 39 | flex 2.5.35 flex --version | 39 | flex 2.5.35 flex --version |
| @@ -111,7 +111,7 @@ It depends on ``libclang``. · 71 unmodified lines | |||
| 111 | Make | 111 | Make |
| 112 | ---- | 112 | ---- |
| 113 | 113 | ||
| 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. |
| 115 | 115 | ||
| 116 | Bash | 116 | Bash |
| 117 | ---- | 117 | ---- |
| @@ -11,8 +11,8 @@ NAME = Baby Opossum Posse · 10 unmodified lines | |||
| 11 | # Comments in this file are targeted only to the developer, do not | 11 | # 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 | ||
| 14 | ifeq ($(filter undefine,$(.FEATURES)),) | 14 | ifeq ($(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)) |
| 16 | endif | 16 | endif |
| 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 of | 94 | # If the user is running make -s (silent mode), suppress echoing of |
| 95 | # commands | 95 | # commands |
| 96 | # make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. | 96 | ifneq ($(findstring s,$(firstword -$(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)),) | ||
| 105 | quiet=silent_ | 97 | quiet=silent_ |
| 106 | override KBUILD_VERBOSE := | 98 | override KBUILD_VERBOSE := |
| 107 | endif | 99 | endif |
| @@ -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) |
| 202 | endif | 194 | endif |
| 203 | 195 | ||
| 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 | |||
| 212 | export sub_make_done := 1 | 196 | export sub_make_done := 1 |
| 213 | 197 | ||
| 214 | endif # sub_make_done | 198 | endif # sub_make_done |
| @@ -68,7 +68,7 @@ kbuild-file = $(or $(wildcard $(src)/Kbuild),$(src)/Makefile) · 67 unmodified lines | |||
| 68 | # Read a file, replacing newlines with spaces | 68 | # 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. |
| 71 | ifneq ($(filter-out 3.% 4.0 4.1, $(MAKE_VERSION)),) | 71 | ifneq ($(filter-out 4.0 4.1, $(MAKE_VERSION)),) |
| 72 | read-file = $(subst $(newline),$(space),$(file < $1)) | 72 | read-file = $(subst $(newline),$(space),$(file < $1)) |
| 73 | else | 73 | else |
| 74 | read-file = $(shell cat $1 2>/dev/null) | 74 | read-file = $(shell cat $1 2>/dev/null) |