[U-Boot-Users] [PATCH] add target for $(LDSCRIPT)

Mike Frysinger vapier at gentoo.org
Sat Feb 16 08:12:37 CET 2008


If the $(LDSCRIPT) does not exist (normally it's board/$(BOARD)/u-boot.lds),
then change into the board directory and try and create it.  This allows you
to generate the linker script on the fly based upon board defines (like the
Blackfin boards do).

There should be no regressions due to this change as the normal case is to
already have a u-boot.lds file.  If that's the case, then there's nothing to
generate, and so make will always exit.  The fix here is that if the linker
script does not exist, the implicit rules take over and attempt to guess how
to generate the file.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index a731ee8..7446bc7 100644
--- a/Makefile
+++ b/Makefile
@@ -326,6 +326,9 @@ $(LIBS):	depend $(obj)include/autoconf.mk
 $(SUBDIRS):	depend $(obj)include/autoconf.mk
 		$(MAKE) -C $@ all
 
+$(LDSCRIPT):	depend $(obj)include/autoconf.mk
+		$(MAKE) -C $(dir $@) $(notdir $@)
+
 $(NAND_SPL):	$(VERSION_FILE)	$(obj)include/autoconf.mk
 		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
 
-- 
1.5.4





More information about the U-Boot mailing list