[Concept,04/10] Kconfig: Provide an option for the standalone directory

Message ID 20250905212330.354827-5-sjg@u-boot.org
State New
Headers
Series ulib: Provide examples for building outside the tree |

Commit Message

Simon Glass Sept. 5, 2025, 9:23 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Rather than using CONFIG_EXAMPLES to control the inclusion of this
directory, create a separate option. This will allow examples to be
added which don't relate to the legacy API.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 examples/Kconfig  | 8 ++++++++
 examples/Makefile | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
  

Patch

diff --git a/examples/Kconfig b/examples/Kconfig
index 62ae2ffab2c..4d5a2a9c8dd 100644
--- a/examples/Kconfig
+++ b/examples/Kconfig
@@ -9,3 +9,11 @@  config EXAMPLES
 	help
 	  U-Boot provides an legacy API for standalone applications. Examples
 	  are provided in directory examples/.
+
+config EXAMPLES_STANDALONE
+	bool "Compile standalone examples"
+	depends on EXAMPLES
+	default y
+	help
+	  Build the various examples in the standalone/directory for use with
+	  the legacy API.
diff --git a/examples/Makefile b/examples/Makefile
index bf51f1a5018..50bef4e6157 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -6,6 +6,6 @@  ifdef FTRACE
 subdir-ccflags-y += -finstrument-functions -DFTRACE
 endif
 
-subdir-y += standalone
+subdir-$(EXAMPLES_STANDALONE) += standalone
 subdir-$(CONFIG_LEGACY_API) += api
 endif