Blackfin: fix out-of-tree building with ldscripts
authorMike Frysinger <vapier@gentoo.org>
Fri, 24 Oct 2008 21:51:57 +0000 (17:51 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 7 Jan 2009 07:59:50 +0000 (02:59 -0500)
Many of the Blackfin board linker scripts are preprocessed, so make sure we
output the linker script into the build tree rather than the source tree.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
board/bf533-ezkit/Makefile
board/bf533-ezkit/config.mk
board/bf533-stamp/Makefile
board/bf533-stamp/config.mk
board/bf537-stamp/Makefile
board/bf537-stamp/config.mk
board/bf561-ezkit/Makefile
board/bf561-ezkit/config.mk

index b2d7acf..6a45b7c 100644 (file)
@@ -35,12 +35,11 @@ SRCS        := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS) $(obj)u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
-u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
-       mv -f $@.tmp $@
+$(obj)u-boot.lds: u-boot.lds.S
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P $^ > $@
 
 clean:
        rm -f $(SOBJS) $(OBJS)
index 9847924..c8b9fb8 100644 (file)
@@ -26,6 +26,8 @@
 # This is not actually used for Blackfin boards so do not change it
 #TEXT_BASE = do-not-use-me
 
+LDSCRIPT = $(obj)board/$(BOARDDIR)/u-boot.lds
+
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
 LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index 21f6ad1..5ae0228 100644 (file)
@@ -35,12 +35,11 @@ SRCS        := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS) $(obj)u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
-u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
-       mv -f $@.tmp $@
+$(obj)u-boot.lds: u-boot.lds.S
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P $^ > $@
 
 clean:
        rm -f $(SOBJS) $(OBJS)
index 9847924..c8b9fb8 100644 (file)
@@ -26,6 +26,8 @@
 # This is not actually used for Blackfin boards so do not change it
 #TEXT_BASE = do-not-use-me
 
+LDSCRIPT = $(obj)board/$(BOARDDIR)/u-boot.lds
+
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
 LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))
index e5481bf..e5ef9af 100644 (file)
@@ -35,12 +35,11 @@ SRCS        := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS) $(obj)u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
-u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
-       mv -f $@.tmp $@
+$(obj)u-boot.lds: u-boot.lds.S
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P $^ > $@
 
 clean:
        rm -f $(SOBJS) $(OBJS)
index d9e884e..719b97e 100644 (file)
@@ -26,6 +26,8 @@
 # This is not actually used for Blackfin boards so do not change it
 #TEXT_BASE = do-not-use-me
 
+LDSCRIPT = $(obj)board/$(BOARDDIR)/u-boot.lds
+
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
 LDR_FLAGS-BFIN_BOOT_UART := --port g --gpio 6
index a1a4433..e7ee243 100644 (file)
@@ -35,12 +35,11 @@ SRCS        := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS) $(obj)u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
-u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
-       mv -f $@.tmp $@
+$(obj)u-boot.lds: u-boot.lds.S
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P $^ > $@
 
 clean:
        rm -f $(SOBJS) $(OBJS)
index 77c888b..710809a 100644 (file)
@@ -26,6 +26,8 @@
 # This is not actually used for Blackfin boards so do not change it
 #TEXT_BASE = do-not-use-me
 
+LDSCRIPT = $(obj)board/$(BOARDDIR)/u-boot.lds
+
 # Set some default LDR flags based on boot mode.
 LDR_FLAGS-BFIN_BOOT_PARA := --bits 16
 LDR_FLAGS += $(LDR_FLAGS-$(CONFIG_BFIN_BOOT_MODE))