diff mbox series

[10/13] kbuild: skip parsing pre sub-make code for recursion

Message ID 20250531084449.4125187-10-ilias.apalodimas@linaro.org
State New
Headers show
Series [01/13] kbuild: add -fno-PIE flag unconditionally | expand

Commit Message

Ilias Apalodimas May 31, 2025, 8:44 a.m. UTC
Backported from kernel
commit 221cc2d27ddc ("kbuild: skip parsing pre sub-make code for recursion")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 19fa77953d2f..24d6cd8fd7aa 100644
--- a/Makefile
+++ b/Makefile
@@ -51,7 +51,7 @@  undefine MK_ARCH
 # descending is started. They are now explicitly listed as the
 # prepare rule.
 
-ifneq ($(sub-make-done),1)
+ifneq ($(sub_make_done),1)
 
 # Do not use make's built-in rules and variables
 # (this increases performance and avoids hard-to-debug behaviour)
@@ -176,17 +176,18 @@  MAKEFLAGS += --no-print-directory
 
 endif # ifneq ($(KBUILD_OUTPUT),)
 
+export sub_make_done := 1
 PHONY += $(MAKECMDGOALS) sub-make
 
 $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
 	@:
 
 sub-make: FORCE
-	$(Q)$(MAKE) sub-make-done=1 \
+	$(Q)$(MAKE) \
 	$(if $(KBUILD_OUTPUT),-C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR)) \
 	-f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
 
-else # sub-make-done
+else # sub_make_done
 # We process the rest of the Makefile if this is the final invocation of make
 
 # Do not print "Entering directory ...",
@@ -2549,7 +2550,7 @@  $(cmd_files): ;        # Do not try to update included dependency files
 
 endif    #ifeq ($(config-targets),1)
 endif    #ifeq ($(mixed-targets),1)
-endif	 # sub-make-done
+endif	 # sub_make_done
 
 PHONY += FORCE
 FORCE: