[U-Boot] [PATCH] common: Delete unnecessary rules.

Masahiro Yamada yamada.m at jp.panasonic.com
Mon Nov 18 08:24:58 CET 2013


The directory tools/ is always built before common/.
So when envcrc tool is necessary in common/Makefile,
it already exists.

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
---

Here is the more detailed explanation.

(1) tools/ is always built before common/

See around line 540 of $(TOPDIR)/Makefile.

    $(LIBS):        depend $(SUBDIR_TOOLS)
                $(MAKE) $(build) $(dir $(subst $(obj),,$@))

(2) common/env_embedded.o is compiled only when
CONFIG_ENV_IS_EMBEDDED=y or CONFIG_ENV_IS_IN_EEPROM=y
CONFIG_ENV_IS_IN_FLASH=y or CONFIG_ENV_IS_NVRAM=y.

See around line 35 of common/Makeile

     extra-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
     obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
     extra-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
     obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o

(3) For all of the cases, tools/envcrc is generated.

See around line 35 of tools/Makefile

     ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
     ENVCRC-$(CONFIG_ENV_IS_IN_DATAFLASH) = y
     ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y
     ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
     ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y
     ENVCRC-$(CONFIG_ENV_IS_IN_NAND) = y
     ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y
     ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y
     CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y)


 common/Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 32acbf9..74404be 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -232,14 +232,11 @@ obj-y += stdio.o
 
 CPPFLAGS += -I..
 
-$(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc
+$(obj)env_embedded.o: $(src)env_embedded.c
 	$(CC) $(AFLAGS) -Wa,--no-warn \
 		-DENV_CRC=$(shell $(obj)../tools/envcrc) \
 		-c -o $@ $(src)env_embedded.c
 
-$(obj)../tools/envcrc:
-	$(MAKE) -C ../tools
-
 # SEE README.arm-unaligned-accesses
 $(obj)hush.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
 $(obj)fdt_support.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
-- 
1.8.3.2



More information about the U-Boot mailing list