tools: pass TOPDIR in SDIR_template and MAKE_template

SDIR_template and MAKE_template did not pass TOPDIR to recursive makes.
When a sub-make needed to include $(TOPDIR)/Make.defs (e.g. to define
SDIR_template for further recursion), TOPDIR was missing and the include
silently failed via '-include'.

Pass TOPDIR in both templates so recursive makes have full access to the
build system configuration.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
This commit is contained in:
hanzhijian 2026-07-05 09:33:30 +08:00 • committed by GUIDINGLI
parent 59fa595672
commit f8ff088b98

View file

@ -768,13 +768,13 @@ endif
# Invoke make
define MAKE_template
+$(Q) $(MAKE) -C $(1) $(2) APPDIR="$(APPDIR)"
+$(Q) $(MAKE) -C $(1) $(2) APPDIR="$(APPDIR)" TOPDIR="$(TOPDIR)"
endef
define SDIR_template
$(1)_$(2):
+$(Q) $(MAKE) -C $(1) $(2) APPDIR="$(APPDIR)"
+$(Q) $(MAKE) -C $(1) $(2) APPDIR="$(APPDIR)" TOPDIR="$(TOPDIR)"
endef