aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Yanok2011-06-20 07:45:37 -0500
committerWolfgang Denk2011-06-22 13:03:01 -0500
commitd51dfff7af2ad30c54a4fb99539f3fa4275a1573 (patch)
treefe151669ced31df69496497685b7faf3061ae40d /Makefile
parent566e5cf451ae7e33e31bb62ae5b9b258e33f8609 (diff)
downloadu-boot-d51dfff7af2ad30c54a4fb99539f3fa4275a1573.tar.gz
u-boot-d51dfff7af2ad30c54a4fb99539f3fa4275a1573.tar.xz
u-boot-d51dfff7af2ad30c54a4fb99539f3fa4275a1573.zip
config.mk: move LDSCRIPT processing to the top-level Makefile
LDSCRIPT is used only from the top-level Makefile and only when the system is configured so we can move LDSCRIPT and CONFIG_SYS_LDSCRIPT related logic into the top level Makefile and under configured condition to avoid errors when building tools from unconfigured tree. Signed-off-by: Ilya Yanok <yanok@emcraft.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 41437da2a6..ab3740e54a 100644
--- a/Makefile
+++ b/Makefile
@@ -163,6 +163,36 @@ endif
163# load other configuration 163# load other configuration
164include $(TOPDIR)/config.mk 164include $(TOPDIR)/config.mk
165 165
166# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
167# that (or fail if absent). Otherwise, search for a linker script in a
168# standard location.
169
170ifndef LDSCRIPT
171 #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
172 ifdef CONFIG_SYS_LDSCRIPT
173 # need to strip off double quotes
174 LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
175 endif
176endif
177
178ifndef LDSCRIPT
179 ifeq ($(CONFIG_NAND_U_BOOT),y)
180 LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
181 ifeq ($(wildcard $(LDSCRIPT)),)
182 LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
183 endif
184 endif
185 ifeq ($(wildcard $(LDSCRIPT)),)
186 LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
187 endif
188 ifeq ($(wildcard $(LDSCRIPT)),)
189 LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
190 endif
191 ifeq ($(wildcard $(LDSCRIPT)),)
192$(error could not find linker script)
193 endif
194endif
195
166######################################################################### 196#########################################################################
167# U-Boot objects....order is important (i.e. start must be first) 197# U-Boot objects....order is important (i.e. start must be first)
168 198