[Buildroot] [PATCH v3 3/3] boot/uboot: Add uboot-menuconfig and friends

Jörg Krause joerg.krause at embedded.rocks
Wed Feb 4 22:29:41 UTC 2015

Add uboot-menuconfig, uboot-spl/menuconfig, uboot-tpl/menuconfig and their
friends as make targets.

The Kconfig configuration in U-Boot is different from Linux. The biggest
difference is that U-Boot has to configure multiple boot images per board:
Normal, SPL, TPL. The Kconfig functions are expanded for U-Boot to handle
multiple images.

menuconfig and friends are used to configure Normal and create (or modify)
the .config file. For SPL configuration, the configutation targets are
prefixed with "spl/", for example "make spl/config", "make spl/menuconfig",
etc. Those targets create or modify the spl/.config file. Likewise, run
"make tpl/config", "make tpl/menuconfig", etc. for TPL.

The target "<board>_defconfig" is used to create the .config, spl/.config
(if CONFIG_SPL is defined) and tpl/.config (if CONFIG_TPL is defined) based
on the file configs/<board>_defconfig.

savedefconfig creates a minimal set of config based on the .config and saves
it into the "defconfig" file. If CONFIG_SPL (and CONFIG_TPL) is defined, the
common lines among .config, spl/.config (and tpl/.config) are coalesced
together with a special syntax where each line has a "<condition>:" prefix.

Signed-off-by: Jörg Krause <joerg.krause at embedded.rocks>
Changes v2 -> v3:
  - Add spl/menuconfig and tpl/menuconfig and their friends
  - Rewrite commit log
Changes v1 -> v2:
  - Retain backward compatibility (Thomas)
 boot/uboot/uboot.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 2ea9c86..2c39435 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -185,6 +185,26 @@ endif
 $(eval $(generic-package))
 ifeq ($(BR2_TARGET_UBOOT),y)
+uboot-menuconfig uboot-xconfig uboot-gconfig uboot-nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-spl/menuconfig uboot-spl/xconfig uboot-spl/gconfig uboot-spl/nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-tpl/menuconfig uboot-tpl/xconfig uboot-tpl/gconfig uboot-tpl/nconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+	rm -f $(UBOOT_DIR)/.stamp_{built,target_installed,images_installed}
+uboot-savedefconfig: uboot-configure
+	$(TARGET_MAKE_ENV) $(MAKE) $(UBOOT_MAKE_OPTS) -C $(UBOOT_DIR) $(subst uboot-,,$@)
+uboot-update-defconfig: uboot-savedefconfig
+uboot-update-defconfig: ;
 # we NEED a board name unless we're at make source
 ifeq ($(filter source,$(MAKECMDGOALS)),)

More information about the buildroot mailing list