[U-Boot] [PATCH 1/6] Allow arch directory to contain .lds without requiring Makefile

Simon Glass sjg at chromium.org
Sun Nov 20 05:54:12 CET 2011


Hi Marek,

On Sat, Nov 19, 2011 at 8:07 PM, Marek Vasut <marek.vasut at gmail.com> wrote:
>> 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: Simon Glass <sjg at chromium.org>
>> ---
>>  Makefile |    9 ++++++++-
>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 294c762..e7da1c0 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -174,6 +174,8 @@ include $(TOPDIR)/config.mk
>>  # that (or fail if absent).  Otherwise, search for a linker script in a
>>  # standard location.
>>
>> +LDSCRIPT_MAKEFILE_DIR = $(dir $(LDSCRIPT))
>> +
>>  ifndef LDSCRIPT
>>       #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
>>       ifdef CONFIG_SYS_LDSCRIPT
>> @@ -196,6 +198,11 @@ ifndef LDSCRIPT
>>               LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
>>       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)),)
>
> Do I see the same ifeq... twice in here ? I understand what you do here, but
> it'd be good to add a comment please.

Actually it is in there 3 times, and I added a 4th! It is just trying
to find a link script. I will add a comment to the top.

Regards,
Simon

>
>
>>  $(error could not find linker script)
>>       endif
>>  endif
>> @@ -498,7 +505,7 @@ depend dep:       $(TIMESTAMP_FILE) $(VERSION_FILE) \
>>               $(obj)include/autoconf.mk \
>>               $(obj)include/generated/generic-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
>>
>>  TAG_SUBDIRS = $(SUBDIRS)
>


More information about the U-Boot mailing list