From: Alejandro Colomar Date: Mon, 3 Feb 2025 09:12:28 +0000 (+0100) Subject: GNUmakefile: Require the user to specify '-R' if their make(1) is too old X-Git-Tag: man-pages-6.11~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50c914d25b40ac6a4d63ce10ed146653098014a2;p=thirdparty%2Fman-pages.git GNUmakefile: Require the user to specify '-R' if their make(1) is too old And everyone's make(1) is too old. :-) This will allow us to use ?= assignments. Once a new GNU make(1) release is done, we'll be able to rely on our setting of MAKEFLAGS+=-R at the top of the GNUMakefile, but currently, that's not enough, and the user must specify -R to unset implicit variables. Cc: Sam James Cc: Paul Smith Cc: Guenther Noack Signed-off-by: Alejandro Colomar --- diff --git a/GNUmakefile b/GNUmakefile index fcc96a364..63e739392 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,4 @@ -# Copyright 2021-2024, Alejandro Colomar +# Copyright 2021-2025, Alejandro Colomar # SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception @@ -6,6 +6,13 @@ SHELL := bash .SHELLFLAGS := -Eeuo pipefail -c +ifneq (4.4.999,$(firstword $(sort 4.4.999 $(MAKE_VERSION)))) + ifneq (R,$(findstring R, $(firstword -$(MAKEFLAGS)))) + $(error Please run make(1) with the '-R' option) + endif +endif + + MAKEFLAGS += --no-builtin-rules MAKEFLAGS += --no-builtin-variables MAKEFLAGS += --warn-undefined-variables @@ -38,7 +45,7 @@ nothing:; .PHONY: help help: $(info $(INFO_)To see a list of targets, run:) - $(info $(INFO_) $$ make nothing -p \) + $(info $(INFO_) $$ make -R -p nothing \) $(info $(INFO_) | grep '^\.PHONY:' \) $(info $(INFO_) | tr ' ' '\n' \) $(info $(INFO_) | grep -v '^\.PHONY:' \)