[PATCH 14/17] Makefile: Use empty SPL_ and SPL_TPL_ vars
Simon Glass
sjg at chromium.org
Fri Sep 17 18:17:37 CEST 2021
Now that we include an auto.conf file specific to the phase being built
we can make these variables empty.
With this done, we can also remove them from U-Boot entirely, dropping
them from all Makefiles. That is left for a future clean-up since we
cannot apply this series until CONFIG migration is complete.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
scripts/Kbuild.include | 17 +++++++++++++----
scripts/Makefile.spl | 17 +++++++++++++----
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index a745cc4fccd..90444d38f89 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -319,14 +319,23 @@ endif
# do not delete intermediate files automatically
.SECONDARY:
+# The SPL_ and SPL_TPL_ vars resolve to nothing so they can be used in
+# Makefiles
+
+# For compatibility with ad-hoc CONFIG options, provide xSPL_ and xSPL_TPL_
+# which maintain the old behaviour. The is just for illustration purposes,
+# since it is better to wait until all CONFIGs are migrated.
ifdef CONFIG_SPL_BUILD
-SPL_ := SPL_
+xSPL_ := SPL_
ifeq ($(CONFIG_TPL_BUILD),y)
-SPL_TPL_ := TPL_
+xSPL_TPL_ := TPL_
else
-SPL_TPL_ := SPL_
+xSPL_TPL_ := SPL_
endif
else
+xSPL_ :=
+xSPL_TPL_ :=
+endif
+
SPL_ :=
SPL_TPL_ :=
-endif
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 02dd85b8e1c..a6705efcf07 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -45,17 +45,26 @@ endif
export SPL_NAME
+# The SPL_ and SPL_TPL_ vars resolve to nothing so they can be used in
+# Makefiles
+
+# For compatibility with ad-hoc CONFIG options, provide xSPL_ and xSPL_TPL_
+# which maintain the old behaviour. The is just for illustration purposes,
+# since it is better to wait until all CONFIGs are migrated.
ifdef CONFIG_SPL_BUILD
-SPL_ := SPL_
+xSPL_ := SPL_
ifeq ($(CONFIG_TPL_BUILD),y)
-SPL_TPL_ := TPL_
+xSPL_TPL_ := TPL_
else
-SPL_TPL_ := SPL_
+xSPL_TPL_ := SPL_
endif
else
+xSPL_ :=
+xSPL_TPL_ :=
+endif
+
SPL_ :=
SPL_TPL_ :=
-endif
ifeq ($(obj)$(CONFIG_SUPPORT_SPL),spl)
$(error You cannot build SPL without enabling CONFIG_SUPPORT_SPL)
--
2.33.0.309.g3052b89438-goog
More information about the U-Boot
mailing list