Commit ced0715d4a4628c2262f0a03e8e299debc41ca16

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent fea1ca8e34

Makefile: move more stuff to top Makefile

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

Showing 2 changed files with 18 additions and 21 deletions Side-by-side Diff

... ... @@ -281,13 +281,27 @@
281 281 # load other configuration
282 282 include $(TOPDIR)/config.mk
283 283  
  284 +ifneq ($(CONFIG_SYS_TEXT_BASE),)
  285 +KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
  286 +endif
  287 +
  288 +export CONFIG_SYS_TEXT_BASE
  289 +
  290 +LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
  291 +ifneq ($(CONFIG_SYS_TEXT_BASE),)
  292 +LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
  293 +endif
  294 +
284 295 # Targets which don't build the source code
285   -NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig
  296 +NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig %_config
286 297  
287 298 # Only do the generic board check when actually building, not configuring
288 299 ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
289   -ifeq ($(findstring _config,$(MAKECMDGOALS)),)
290   -$(CHECK_GENERIC_BOARD)
  300 +ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
  301 +ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
  302 +CHECK_GENERIC_BOARD = $(error Your architecture does not support generic board. \
  303 +Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
  304 +endif
291 305 endif
292 306 endif
293 307  
... ... @@ -102,10 +102,6 @@
102 102 LDFLAGS_FINAL += --gc-sections
103 103 endif
104 104  
105   -ifneq ($(CONFIG_SYS_TEXT_BASE),)
106   -CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
107   -endif
108   -
109 105 ifeq ($(CONFIG_SPL_BUILD),y)
110 106 CPPFLAGS += -DCONFIG_SPL_BUILD
111 107 ifeq ($(CONFIG_TPL_BUILD),y)
... ... @@ -113,14 +109,6 @@
113 109 endif
114 110 endif
115 111  
116   -# Does this architecture support generic board init?
117   -ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
118   -ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
119   -CHECK_GENERIC_BOARD = $(error Your architecture does not support generic board. \
120   -Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
121   -endif
122   -endif
123   -
124 112 CPPFLAGS += $(UBOOTINCLUDE)
125 113 CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
126 114  
... ... @@ -141,11 +129,6 @@
141 129 LDFLAGS += $(PLATFORM_LDFLAGS)
142 130 LDFLAGS_FINAL += -Bstatic
143 131  
144   -LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
145   -ifneq ($(CONFIG_SYS_TEXT_BASE),)
146   -LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
147   -endif
148   -
149 132 LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
150 133 ifneq ($(CONFIG_SPL_TEXT_BASE),)
151 134 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
... ... @@ -153,5 +136,5 @@
153 136  
154 137 #########################################################################
155 138  
156   -export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
  139 +export PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS