Skip to content

Commit e69547b

Browse files
avarprati0100
authored andcommitted
Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4
Since GNU make 4.4 the semantics of the $(MAKEFLAGS) variable has changed in a backward-incompatible way, as its "NEWS" file notes: Previously only simple (one-letter) options were added to the MAKEFLAGS variable that was visible while parsing makefiles. Now, all options are available in MAKEFLAGS. If you want to check MAKEFLAGS for a one-letter option, expanding "$(firstword -$(MAKEFLAGS))" is a reliable way to return the set of one-letter options which can be examined via findstring, etc. This means that $(MAKEFLAGS) now contains long options like "--jobserver-auth=fifo:<path>" and we have to adapt to that. Note that the "-" in "-$(MAKEFLAGS)" is critical here, as the variable will always contain leading whitespace if there are no short options, but long options are present. This is a partial backport of 67b3687 (Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4, 2022-11-30), which had been applied directly to git/git. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
1 parent 1e5a89c commit e69547b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ ifeq ($(uname_S),Darwin)
116116
TKEXECUTABLE = $(shell basename "$(TKFRAMEWORK)" .app)
117117
endif
118118

119-
ifeq ($(findstring $(MAKEFLAGS),s),s)
119+
ifeq ($(findstring $(firstword -$(MAKEFLAGS)),s),s)
120120
QUIET_GEN =
121121
endif
122122

0 commit comments

Comments
 (0)