Makefile: move more stuff to top Makefile
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit is contained in:
parent
fea1ca8e34
commit
ced0715d4a
20
Makefile
20
Makefile
|
@ -281,13 +281,27 @@ endif
|
||||||
# load other configuration
|
# load other configuration
|
||||||
include $(TOPDIR)/config.mk
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_SYS_TEXT_BASE),)
|
||||||
|
KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
|
||||||
|
endif
|
||||||
|
|
||||||
|
export CONFIG_SYS_TEXT_BASE
|
||||||
|
|
||||||
|
LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
|
||||||
|
ifneq ($(CONFIG_SYS_TEXT_BASE),)
|
||||||
|
LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
|
||||||
|
endif
|
||||||
|
|
||||||
# Targets which don't build the source code
|
# Targets which don't build the source code
|
||||||
NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig
|
NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig %_config
|
||||||
|
|
||||||
# Only do the generic board check when actually building, not configuring
|
# Only do the generic board check when actually building, not configuring
|
||||||
ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
|
ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
|
||||||
ifeq ($(findstring _config,$(MAKECMDGOALS)),)
|
ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
|
||||||
$(CHECK_GENERIC_BOARD)
|
ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
|
||||||
|
CHECK_GENERIC_BOARD = $(error Your architecture does not support generic board. \
|
||||||
|
Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
19
config.mk
19
config.mk
|
@ -102,10 +102,6 @@ CPPFLAGS += -ffunction-sections -fdata-sections
|
||||||
LDFLAGS_FINAL += --gc-sections
|
LDFLAGS_FINAL += --gc-sections
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_SYS_TEXT_BASE),)
|
|
||||||
CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_SPL_BUILD),y)
|
ifeq ($(CONFIG_SPL_BUILD),y)
|
||||||
CPPFLAGS += -DCONFIG_SPL_BUILD
|
CPPFLAGS += -DCONFIG_SPL_BUILD
|
||||||
ifeq ($(CONFIG_TPL_BUILD),y)
|
ifeq ($(CONFIG_TPL_BUILD),y)
|
||||||
|
@ -113,14 +109,6 @@ CPPFLAGS += -DCONFIG_TPL_BUILD
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Does this architecture support generic board init?
|
|
||||||
ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
|
|
||||||
ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
|
|
||||||
CHECK_GENERIC_BOARD = $(error Your architecture does not support generic board. \
|
|
||||||
Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPPFLAGS += $(UBOOTINCLUDE)
|
CPPFLAGS += $(UBOOTINCLUDE)
|
||||||
CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
|
CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
|
||||||
|
|
||||||
|
@ -141,11 +129,6 @@ AFLAGS := $(KBUILD_AFLAGS) $(CPPFLAGS)
|
||||||
LDFLAGS += $(PLATFORM_LDFLAGS)
|
LDFLAGS += $(PLATFORM_LDFLAGS)
|
||||||
LDFLAGS_FINAL += -Bstatic
|
LDFLAGS_FINAL += -Bstatic
|
||||||
|
|
||||||
LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
|
|
||||||
ifneq ($(CONFIG_SYS_TEXT_BASE),)
|
|
||||||
LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
|
LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
|
||||||
ifneq ($(CONFIG_SPL_TEXT_BASE),)
|
ifneq ($(CONFIG_SPL_TEXT_BASE),)
|
||||||
LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
|
LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
|
||||||
|
@ -153,4 +136,4 @@ endif
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
|
export PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
|
||||||
|
|
Loading…
Reference in New Issue