From e0d5d9f8887e5f80f6df4ff20bb1816a7edefd39 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 4 Feb 2014 17:24:22 +0900 Subject: Makefile: move some flags to spl/Makefile Some flags are used for SPL (and TPL) build only. This commit moves them from config.mk to spl/Makefile. Signed-off-by: Masahiro Yamada --- spl/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spl') diff --git a/spl/Makefile b/spl/Makefile index f273015168..8d0e6c3b31 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -19,6 +19,15 @@ include $(srctree)/scripts/Kbuild.include CONFIG_SPL_BUILD := y export CONFIG_SPL_BUILD +KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD +ifeq ($(CONFIG_TPL_BUILD),y) +KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD +endif + +# Enable garbage collection of un-used sections for SPL +KBUILD_CFLAGS += -ffunction-sections -fdata-sections +LDFLAGS_FINAL += --gc-sections + ifeq ($(CONFIG_TPL_BUILD),y) export CONFIG_TPL_BUILD SPL_BIN := u-boot-tpl @@ -173,6 +182,11 @@ endif $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ +LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL) +ifneq ($(CONFIG_SPL_TEXT_BASE),) +LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE) +endif + GEN_UBOOT = \ cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -- cgit v1.2.1