diff mbox series

[22/32] Makefile: Include the config for the phase being built

Message ID 20230131152702.249197-23-sjg@chromium.org
State RFC
Delegated to: Tom Rini
Headers show
Series RFC: Migrate to split config | expand

Commit Message

Simon Glass Jan. 31, 2023, 3:26 p.m. UTC
At present there is only a single auto.conf file used within the
makefiles. Update them to use the correct one for each phase.

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

 Makefile               | 11 ++++++++++-
 scripts/Makefile.build | 12 +++++++++++-
 scripts/Makefile.spl   | 10 +++++++++-
 3 files changed, 30 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 8150ca69e82..be5b2f4fe40 100644
--- a/Makefile
+++ b/Makefile
@@ -587,8 +587,17 @@  scripts: scripts_basic scripts_dtc include/config/auto.conf
 	$(Q)$(MAKE) $(build)=$(@)
 
 ifeq ($(dot-config),1)
-# Read in config
+
+# Read in the config for this phase
+ifdef CONFIG_TPL_BUILD
+-include include/config/auto_tpl.conf
+else ifdef CONFIG_VPL_BUILD
+-include include/config/auto_vpl.conf
+else ifdef CONFIG_SPL_BUILD
+-include include/config/auto_spl.conf
+else
 -include include/config/auto.conf
+endif
 
 # Read in dependencies to all Kconfig* files, make sure to run
 # oldconfig if changes are detected.
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 97dd4a64f6e..093392b430f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -44,9 +44,19 @@  ldflags-y  :=
 subdir-asflags-y :=
 subdir-ccflags-y :=
 
-# Read auto.conf if it exists, otherwise ignore
+# Read appropriate auto.conf if it exists, otherwise ignore
 # Modified for U-Boot
+
+ifeq ($(SPL_NAME),tpl)
+-include include/config/auto_tpl.conf
+else ifeq ($(SPL_NAME),vpl)
+-include include/config/auto_vpl.conf
+else ifeq ($(SPL_NAME),spl)
+-include include/config/auto_spl.conf
+else
 -include include/config/auto.conf
+endif
+
 -include $(prefix)/include/autoconf.mk
 
 include scripts/Kbuild.include
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 15ac87286d5..41528f32307 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -19,9 +19,17 @@  _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
 
 include $(srctree)/scripts/Kbuild.include
 
--include include/config/auto.conf
 -include $(obj)/include/autoconf.mk
 
+# Read in the config for this SPL phase
+ifdef CONFIG_TPL_BUILD
+-include include/config/auto_tpl.conf
+else ifdef CONFIG_VPL_BUILD
+-include include/config/auto_vpl.conf
+else
+-include include/config/auto_spl.conf
+endif
+
 UBOOTINCLUDE := -I$(obj)/include $(UBOOTINCLUDE)
 
 KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD