From: Tom Rini <trini@konsulko.com>
Date: Thu, 21 Sep 2023 23:32:46 +0000 (-0400)
Subject: Makefile: Allow for board directories to not have a Makefile
X-Git-Tag: v2025.01-rc5-pxa1908~838^2~14
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/%7B%7B?a=commitdiff_plain;h=521ca0fa7832ee67ad2a1de37bf05fe8acd00b06;p=u-boot.git

Makefile: Allow for board directories to not have a Makefile

It is entirely possible at this point to have platforms in U-Boot that
do not have board-specific C code (just Kconfig or environment) and so
make it optional to have to descend in to and then build in the board
directory.

Signed-off-by: Tom Rini <trini@konsulko.com>
---

diff --git a/Makefile b/Makefile
index 4a2d99e102..9d2e31e494 100644
--- a/Makefile
+++ b/Makefile
@@ -886,7 +886,7 @@ libs-$(CONFIG_UT_ENV) += test/env/
 libs-$(CONFIG_UT_OPTEE) += test/optee/
 libs-$(CONFIG_UT_OVERLAY) += test/overlay/
 
-libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
+libs-y += $(if $(wildcard $(srctree)/board/$(BOARDDIR)/Makefile),board/$(BOARDDIR)/)
 
 libs-y := $(sort $(libs-y))
 
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 15ac87286d..32f4384657 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -96,7 +96,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
 
-libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
+libs-y += $(if $(wildcard $(srctree)/board/$(BOARDDIR)/Makefile),board/$(BOARDDIR)/)
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
 
 ifeq ($(CONFIG_TPL_BUILD),y)