Skip to content
Snippets Groups Projects
Commit ee60197e authored by Simon Glass's avatar Simon Glass Committed by Albert ARIBAUD
Browse files

Allow arch directory to contain .lds without requiring Makefile


The Makefile for a CPU is in arch/($ARCH)/cpu/$(CPU). We want to support
having an .lds file in arch/$(ARCH)/cpu without requiring an additional
Makefile there. This change makes it clear that we expect a Makefile in
the same directory as the link script except in this case.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 76e2c169
No related branches found
No related tags found
No related merge requests found
...@@ -174,6 +174,8 @@ include $(TOPDIR)/config.mk ...@@ -174,6 +174,8 @@ include $(TOPDIR)/config.mk
# that (or fail if absent). Otherwise, search for a linker script in a # that (or fail if absent). Otherwise, search for a linker script in a
# standard location. # standard location.
LDSCRIPT_MAKEFILE_DIR = $(dir $(LDSCRIPT))
ifndef LDSCRIPT ifndef LDSCRIPT
#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
ifdef CONFIG_SYS_LDSCRIPT ifdef CONFIG_SYS_LDSCRIPT
...@@ -182,6 +184,7 @@ ifndef LDSCRIPT ...@@ -182,6 +184,7 @@ ifndef LDSCRIPT
endif endif
endif endif
# If there is no specified link script, we look in a number of places for it
ifndef LDSCRIPT ifndef LDSCRIPT
ifeq ($(CONFIG_NAND_U_BOOT),y) ifeq ($(CONFIG_NAND_U_BOOT),y)
LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
...@@ -195,6 +198,11 @@ ifndef LDSCRIPT ...@@ -195,6 +198,11 @@ ifndef LDSCRIPT
ifeq ($(wildcard $(LDSCRIPT)),) ifeq ($(wildcard $(LDSCRIPT)),)
LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
endif endif
ifeq ($(wildcard $(LDSCRIPT)),)
LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
# We don't expect a Makefile here
LDSCRIPT_MAKEFILE_DIR =
endif
ifeq ($(wildcard $(LDSCRIPT)),) ifeq ($(wildcard $(LDSCRIPT)),)
$(error could not find linker script) $(error could not find linker script)
endif endif
...@@ -513,7 +521,7 @@ depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \ ...@@ -513,7 +521,7 @@ depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \
$(obj)include/autoconf.mk \ $(obj)include/autoconf.mk \
$(obj)include/generated/generic-asm-offsets.h \ $(obj)include/generated/generic-asm-offsets.h \
$(obj)include/generated/asm-offsets.h $(obj)include/generated/asm-offsets.h
for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \ for dir in $(SUBDIRS) $(CPUDIR) $(LDSCRIPT_MAKEFILE_DIR) ; do \
$(MAKE) -C $$dir _depend ; done $(MAKE) -C $$dir _depend ; done
TAG_SUBDIRS = $(SUBDIRS) TAG_SUBDIRS = $(SUBDIRS)
......
...@@ -80,6 +80,9 @@ endif ...@@ -80,6 +80,9 @@ endif
ifeq ($(wildcard $(LDSCRIPT)),) ifeq ($(wildcard $(LDSCRIPT)),)
LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
endif endif
ifeq ($(wildcard $(LDSCRIPT)),)
LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
endif
ifeq ($(wildcard $(LDSCRIPT)),) ifeq ($(wildcard $(LDSCRIPT)),)
$(error could not find linker script) $(error could not find linker script)
endif endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment