[Concept,03/10] Kconfig: Split the EXAMPLES option into its own file

Message ID 20250905212330.354827-4-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>

We want to build examples for things other than the legacy API. As a
first step, create a Kconfig file in examples/ and move CONFIG_EXAMPLES
into it.

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

 Kconfig            |  2 ++
 examples/Kconfig   | 11 +++++++++++
 legacy_api/Kconfig |  8 --------
 3 files changed, 13 insertions(+), 8 deletions(-)
 create mode 100644 examples/Kconfig
  

Patch

diff --git a/Kconfig b/Kconfig
index bf30179db93..76cfa74dc8b 100644
--- a/Kconfig
+++ b/Kconfig
@@ -733,6 +733,8 @@  config LDR_CPU
 
 source "legacy_api/Kconfig"
 
+source "examples/Kconfig"
+
 endmenu		# General setup
 
 source "boot/Kconfig"
diff --git a/examples/Kconfig b/examples/Kconfig
new file mode 100644
index 00000000000..62ae2ffab2c
--- /dev/null
+++ b/examples/Kconfig
@@ -0,0 +1,11 @@ 
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright 2017 Emmanuel Vadot <manu@bidouilliste.com>
+
+config EXAMPLES
+	bool "Compile legacy API examples"
+	depends on !SANDBOX
+	default y if ARCH_QEMU_ARM
+	help
+	  U-Boot provides an legacy API for standalone applications. Examples
+	  are provided in directory examples/.
diff --git a/legacy_api/Kconfig b/legacy_api/Kconfig
index 6dc96455ff0..7e5725a7202 100644
--- a/legacy_api/Kconfig
+++ b/legacy_api/Kconfig
@@ -15,14 +15,6 @@  config SYS_MMC_MAX_DEVICE
 	int  "Maximum number of MMC devices exposed via the legacy API"
 	default 1
 
-config EXAMPLES
-	bool "Compile legacy API examples"
-	depends on !SANDBOX
-	default y if ARCH_QEMU_ARM
-	help
-	  U-Boot provides an legacy API for standalone applications. Examples
-	  are provided in directory examples/.
-
 config STANDALONE_LOAD_ADDR
 	depends on EXAMPLES
 	hex "Address in memory to link standalone applications to"