@@ -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
@@ -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)
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@chromium.org> --- scripts/Kbuild.include | 17 +++++++++++++---- scripts/Makefile.spl | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-)