]> git.pld-linux.org Git - packages/kernel.git/blame - make-4.4.patch
- 6.1.14
[packages/kernel.git] / make-4.4.patch
CommitLineData
3d666e82
JP
1From 22c65447a7a4667b91ce82a027c91005df136768 Mon Sep 17 00:00:00 2001
2From: Dmitry Goncharov <dgoncharov@users.sf.net>
3Date: Mon, 5 Dec 2022 16:48:19 -0500
4Subject: kbuild: Port silent mode detection to future gnu make.
5
6Port silent mode detection to the future (post make-4.4) versions of gnu make.
7
8Makefile contains the following piece of make code to detect if option -s is
9specified on the command line.
10
11ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
12
13This code is executed by make at parse time and assumes that MAKEFLAGS
14does not contain command line variable definitions.
15Currently if the user defines a=s on the command line, then at build only
16time MAKEFLAGS contains " -- a=s".
17However, starting with commit dc2d963989b96161472b2cd38cef5d1f4851ea34
18MAKEFLAGS contains command line definitions at both parse time and
19build time.
20
21This '-s' detection code then confuses a command line variable
22definition which contains letter 's' with option -s.
23
24$ # old make
25$ make net/wireless/ocb.o a=s
26 CALL scripts/checksyscalls.sh
27 DESCEND objtool
28$ # this a new make which defines makeflags at parse time
29$ ~/src/gmake/make/l64/make net/wireless/ocb.o a=s
30$
31
32We can see here that the letter 's' from 'a=s' was confused with -s.
33
34This patch checks for presence of -s using a method recommended by the
35make manual here
36https://www.gnu.org/software/make/manual/make.html#Testing-Flags.
37
38Link: https://lists.gnu.org/archive/html/bug-make/2022-11/msg00190.html
39Reported-by: Jan Palus <jpalus+gnu@fastmail.com>
40Signed-off-by: Dmitry Goncharov <dgoncharov@users.sf.net>
41Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
42---
43 Makefile | 13 ++++++++++---
44 1 file changed, 10 insertions(+), 3 deletions(-)
45
46diff --git a/Makefile b/Makefile
47index 797fafbc1b45c..53fa1a9fba8aa 100644
48--- a/Makefile
49+++ b/Makefile
50@@ -93,10 +93,17 @@ endif
51
52 # If the user is running make -s (silent mode), suppress echoing of
53 # commands
54+# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS.
55
56-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
57- quiet=silent_
58- KBUILD_VERBOSE = 0
59+ifeq ($(filter 3.%,$(MAKE_VERSION)),)
60+silence:=$(findstring s,$(firstword -$(MAKEFLAGS)))
61+else
62+silence:=$(findstring s,$(filter-out --%,$(MAKEFLAGS)))
63+endif
64+
65+ifeq ($(silence),s)
66+quiet=silent_
67+KBUILD_VERBOSE = 0
68 endif
69
70 export quiet Q KBUILD_VERBOSE
71--
72cgit
73
This page took 0.05083 seconds and 4 git commands to generate.