kbuild: Move linker sciript check to prepare1
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Tue, 25 Feb 2014 10:26:48 +0000 (19:26 +0900)
committerTom Rini <trini@ti.com>
Tue, 25 Feb 2014 16:01:29 +0000 (11:01 -0500)
Same as the previous commit.
Move sanity check to prepare1 target to avoid nasty troubles.

Before this commit, LDSCRIPT existence was not checked
when it was specified by CONFIG_SYS_LDSCRIPT.
Now LDSCRIPT existence is checked for all boards.

$(wildcard $(LDSCRIPT)) must point to the linker scripts
with absolute path.
Otherwise, make will terminate with a false error
on out-of-tree build.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Makefile
include/configs/MPC8536DS.h
include/configs/MPC8569MDS.h
include/configs/MPC8572DS.h
include/configs/P1023RDS.h
include/configs/P1_P2_RDB.h

index 7b7c25a1b293186b4146136f8e33781e268ae693..0281171ae83b3466f3616b284b0ba462d2346c45 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -495,7 +495,7 @@ ifndef LDSCRIPT
        #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
        ifdef CONFIG_SYS_LDSCRIPT
                # need to strip off double quotes
-               LDSCRIPT := $(CONFIG_SYS_LDSCRIPT:"%"=%)
+               LDSCRIPT := $(srctree)/$(CONFIG_SYS_LDSCRIPT:"%"=%)
        endif
 endif
 
@@ -518,9 +518,6 @@ ifndef LDSCRIPT
                # We don't expect a Makefile here
                LDSCRIPT_MAKEFILE_DIR =
        endif
-       ifeq ($(wildcard $(LDSCRIPT)),)
-$(error could not find linker script)
-       endif
 endif
 
 else
@@ -996,6 +993,10 @@ ifeq ($(CONFIG_SYS_GENERIC_BOARD),y)
        @/bin/false
 endif
 endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+       @echo >&2 "  Could not find linker script."
+       @/bin/false
+endif
 
 archprepare: prepare1 scripts_basic
 
index 57bf04ff816250a5205596f3d91650e36ce86a16..9846118fb892d117a0b2b69e07488673b0291eba 100644 (file)
@@ -24,7 +24,7 @@
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
-#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+#define CONFIG_SYS_LDSCRIPT $(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE   0xf8f82000
 #endif /* CONFIG_NAND_SPL */
 #endif
index 33cadb93dd98e907152d921486b65423f5228a47..58b9c26e93dba0a9c0253d604f32147a62cbac73 100644 (file)
@@ -56,7 +56,7 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
-#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+#define CONFIG_SYS_LDSCRIPT $(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE   0xf8f82000
 #endif
 #endif
index f457719bf4f7999984e6257b6f3b8e0550a2979c..7b63945888b16c7774f473c2a6422a20a6880960 100644 (file)
@@ -24,7 +24,7 @@
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
-#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+#define CONFIG_SYS_LDSCRIPT $(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE   0xf8f82000
 #endif /* CONFIG_NAND_SPL */
 #endif
index ec72c78861a2eba65d9168197738a54b755813b6..2ffa3546de7d39338985f345696a1ec5cbc4a855 100644 (file)
@@ -26,7 +26,7 @@
 #ifdef CONFIG_NAND_SPL
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
-#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+#define CONFIG_SYS_LDSCRIPT $(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE    /* start of monitor */
 #endif /* CONFIG_NAND_SPL */
 #endif
index 32ed0c2714c94f9dfd0694fa01e03092969186b1..2ffaf5c0d93c74529d0295f800398a7541b8daaf 100644 (file)
@@ -38,7 +38,7 @@
 #define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
 #define CONFIG_SYS_MONITOR_BASE        CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #else
-#define CONFIG_SYS_LDSCRIPT $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+#define CONFIG_SYS_LDSCRIPT $(CPUDIR)/u-boot-nand.lds
 #define CONFIG_SYS_TEXT_BASE           0xf8f82000
 #endif /* CONFIG_NAND_SPL */
 #endif