Hi Suraj,

On 2026-09-29T11:02:52, Suraj Kakade <[email protected]> wrote:
> Makefile: drop GNU Make < 4.0 compatibility code
>
> RHEL/CentOS 7, a popular distribution that installs 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.

This text and the version check appear to come from Linux commit
5f99665ee8f4 ("kbuild: raise the minimum GNU Make requirement to
4.0"). Please can you credit it, e.g. "This follows Linux commit ...",
to help anyone syncing Kbuild with Linux later?

> diff --git a/Makefile b/Makefile
> @@ -12,6 +12,10 @@ NAME =
> +ifeq ($(filter output-sync,$(.FEATURES)),)
> +$(error GNU Make >= 4.0 is required. Your Make version is $(MAKE_VERSION))
> +endif

The check looks fine. The Linux commit also updated the documented
minimum in changes.rst. We have no equivalent table, but please
consider adding a short note to doc/build/gcc.rst, since the README
only says that GNU make is assumed.

> diff --git a/Makefile b/Makefile
> @@ -93,15 +97,9 @@ endif
> -ifneq ($(filter 4.%,$(MAKE_VERSION)),)       # make-4
> -ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
> -  quiet=silent_
> -endif
> -else                                 # make-3.8x
> -ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
> +ifneq ($(findstring s,$(firstword -$(MAKEFLAGS))),)
>    quiet=silent_
>  endif
> -endif

Please mention in the commit message that this also changes behaviour
on Make 4.x, rather than just removing dead code. The old 'filter %s'
check only matched when 's' was the last of the single-letter flags.
The new form matches Linux and handles Make 4.4, so I am happy with
the change itself. It also fixes the existing 'filter 4.%' test, which
never matched Make 4.x versions beyond 4.

>
> The new requirement, GNU Make 4.0, was released in October, 2013.
>
> Raise the enforced minimum GNU Make version to 4.0 and drop the
> now-unreachable compatibility code for older versions:
>
> - Add an explicit "GNU Make >= 4.0 is required" version-check gate.
> - Simplify the "make -s" (silent mode) detection to a single
>   unconditional check instead of branching on make-4 vs make-3.8x.
> - Drop the GNU Make 3.x sub-make workaround, which is now dead code.
>
> Signed-off-by: Suraj Kakade <[email protected]>
>
> Makefile | 20 +++++---------------
>  1 file changed, 5 insertions(+), 15 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Regards,
Simon

Reply via email to