aboutsummaryrefslogtreecommitdiff
path: root/env/Makefile
diff options
context:
space:
mode:
authorYork Sun2018-06-26 10:03:22 -0700
committerTom Rini2018-07-21 12:24:31 -0400
commit474ecd2c84d97314b8145fbe3a57887f41b2edb3 (patch)
treeaf23d2f9097bfaef92c69a4ed3177f85454c2907 /env/Makefile
parent646f1ab4bcfedf2db7df47a46ac2353366b7b2b7 (diff)
env: Simplify Makefile using $(SPL_TPL_)
Add Kconfig options SPL_ENV_* and TPL_ENV_* and simplify Makefile. This allows SPL/TPL image has different environment setting from full feature U-Boot. Signed-off-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'env/Makefile')
-rw-r--r--env/Makefile40
1 files changed, 11 insertions, 29 deletions
diff --git a/env/Makefile b/env/Makefile
index fa635c80828..90144d6caf3 100644
--- a/env/Makefile
+++ b/env/Makefile
@@ -14,41 +14,23 @@ extra-$(CONFIG_ENV_IS_EMBEDDED) += embedded.o
obj-$(CONFIG_ENV_IS_IN_EEPROM) += embedded.o
extra-$(CONFIG_ENV_IS_IN_FLASH) += embedded.o
obj-$(CONFIG_ENV_IS_IN_NVRAM) += embedded.o
-obj-$(CONFIG_ENV_IS_IN_FLASH) += flash.o
-obj-$(CONFIG_ENV_IS_IN_MMC) += mmc.o
-obj-$(CONFIG_ENV_IS_IN_FAT) += fat.o
-obj-$(CONFIG_ENV_IS_IN_EXT4) += ext4.o
-obj-$(CONFIG_ENV_IS_IN_NAND) += nand.o
obj-$(CONFIG_ENV_IS_IN_NVRAM) += nvram.o
obj-$(CONFIG_ENV_IS_IN_ONENAND) += onenand.o
obj-$(CONFIG_ENV_IS_IN_SATA) += sata.o
-obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += sf.o
obj-$(CONFIG_ENV_IS_IN_REMOTE) += remote.o
obj-$(CONFIG_ENV_IS_IN_UBI) += ubi.o
-obj-$(CONFIG_ENV_IS_NOWHERE) += nowhere.o
-endif
-
-ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_ENV_IS_IN_FLASH) += flash.o
-# environment
-ifdef CONFIG_TPL_BUILD
-obj-$(CONFIG_TPL_ENV_SUPPORT) += attr.o
-obj-$(CONFIG_TPL_ENV_SUPPORT) += flags.o
-obj-$(CONFIG_TPL_ENV_SUPPORT) += callback.o
else
-obj-$(CONFIG_SPL_ENV_SUPPORT) += attr.o
-obj-$(CONFIG_SPL_ENV_SUPPORT) += flags.o
-obj-$(CONFIG_SPL_ENV_SUPPORT) += callback.o
-endif
-ifneq ($(CONFIG_TPL_ENV_SUPPORT)$(CONFIG_SPL_ENV_SUPPORT),)
-obj-$(CONFIG_ENV_IS_NOWHERE) += nowhere.o
-obj-$(CONFIG_ENV_IS_IN_MMC) += mmc.o
-obj-$(CONFIG_ENV_IS_IN_FAT) += fat.o
-obj-$(CONFIG_ENV_IS_IN_EXT4) += ext4.o
-obj-$(CONFIG_ENV_IS_IN_NAND) += nand.o
-obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += sf.o
-obj-$(CONFIG_ENV_IS_IN_FLASH) += flash.o
-endif
+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += attr.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += flags.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += callback.o
endif
+obj-$(CONFIG_$(SPL_TPL_)ENV_IS_NOWHERE) += nowhere.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_MMC) += mmc.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FAT) += fat.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_EXT4) += ext4.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_NAND) += nand.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_SPI_FLASH) += sf.o
+obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FLASH) += flash.o
+
CFLAGS_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null)