[PATCH 1/3] GNUmakefile: Require the user to specify '-R' if their make(1) is too old

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <sam@xxxxxxxxxx>
Cc: Paul Smith <psmith@xxxxxxx>
Cc: Guenther Noack <gnoack@xxxxxxxxxx>
Signed-off-by: Alejandro Colomar <alx@xxxxxxxxxx>
---
 GNUmakefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index fcc96a364..2ed8bcc30 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,4 +1,4 @@
-# Copyright 2021-2024, Alejandro Colomar <alx@xxxxxxxxxx>
+# Copyright 2021-2025, Alejandro Colomar <alx@xxxxxxxxxx>
 # 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' flag)
+  endif
+endif
+
+
 MAKEFLAGS += --no-builtin-rules
 MAKEFLAGS += --no-builtin-variables
 MAKEFLAGS += --warn-undefined-variables
-- 
2.47.2





[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux