summaryrefslogtreecommitdiff
path: root/spl/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'spl/Makefile')
-rw-r--r--spl/Makefile19
1 files changed, 9 insertions, 10 deletions
diff --git a/spl/Makefile b/spl/Makefile
index 346d0aa..bb3d349 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -29,10 +29,6 @@ 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
@@ -50,8 +46,14 @@ endif
include $(TOPDIR)/config.mk
+# Enable garbage collection of un-used sections for SPL
+KBUILD_CFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS_FINAL += --gc-sections
+
# FIX ME
-c_flags := $(KBUILD_CFLAGS) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
+cpp_flags := $(KBUILD_CPPFLAGS) $(PLATFORM_CPPFLAGS) $(UBOOTINCLUDE) \
+ $(NOSTDINC_FLAGS)
+c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
# Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL)
quiet_cmd_autoconf = GEN $@
@@ -132,8 +134,8 @@ u-boot-spl-dirs := $(patsubst %/,%,$(filter %/, $(libs-y)))
libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
# Add GCC lib
-ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
-PLATFORM_LIBGCC = $(SPLTREE)/arch/$(ARCH)/lib/lib.a
+ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
+PLATFORM_LIBGCC = arch/$(ARCH)/lib/lib.a
PLATFORM_LIBS := $(filter-out %/lib.a, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC)
endif
@@ -228,9 +230,6 @@ PHONY += $(u-boot-spl-dirs)
$(u-boot-spl-dirs):
$(Q)$(MAKE) $(build)=$@
-# FIX ME
-cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
-
quiet_cmd_cpp_lds = LDS $@
cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
-x assembler-with-cpp -P -o $@ $<