summaryrefslogtreecommitdiff
path: root/board/voiceblue/Makefile
diff options
context:
space:
mode:
authorLadislav Michl <Ladislav.Michl@seznam.cz>2010-02-17 21:29:45 -0500
committerTom Rix <Tom.Rix@windriver.com>2010-03-07 12:36:35 -0600
commit5c97a1de196fdcbe9d098948ecf4fccfbea23b78 (patch)
treeb86c39bee4ab477134ef07d9ab58f3d2017b9c71 /board/voiceblue/Makefile
parenta32c1e0ecd563c65c617b0eb9080a10d286bb0b4 (diff)
downloadu-boot-imx-5c97a1de196fdcbe9d098948ecf4fccfbea23b78.zip
u-boot-imx-5c97a1de196fdcbe9d098948ecf4fccfbea23b78.tar.gz
u-boot-imx-5c97a1de196fdcbe9d098948ecf4fccfbea23b78.tar.bz2
VoiceBlue: fix linker errors
linking eeprom with libgeneric.a is not really needed and causes following error: ../../lib_generic/libgeneric.a(string.o): In function `strcmp': /home/ladis/src/u-boot-ti/lib_generic/string.c:152: multiple definition of `strcmp' ../../examples/standalone/libstubs.a(stubs.o):include/_exports.h:24: first defined here make[1]: *** [eeprom.srec] Error 1 Fix undefined reference to memset generated by some versions of gcc to zero out initialized structure on the stack: eeprom.o: In function `eeprom': board/voiceblue/eeprom.c:152: undefined reference to `memset' make[1]: *** [eeprom] Error 1 Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Diffstat (limited to 'board/voiceblue/Makefile')
-rw-r--r--board/voiceblue/Makefile33
1 files changed, 15 insertions, 18 deletions
diff --git a/board/voiceblue/Makefile b/board/voiceblue/Makefile
index 121c717..0067f05 100644
--- a/board/voiceblue/Makefile
+++ b/board/voiceblue/Makefile
@@ -29,40 +29,37 @@ LIB = $(obj)lib$(BOARD).a
COBJS := voiceblue.o
SOBJS := setup.o
-SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c eeprom_start.S
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
LOAD_ADDR = 0x10400000
-LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
-lnk = $(if $(obj),$(obj),.)
+
+#########################################################################
all: $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin
$(LIB): $(OBJS) $(SOBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+ $(AR) $(ARFLAGS) $@ $^
+
+$(obj)eeprom_start.o:
+ echo "b eeprom" | $(CC) $(AFLAGS) -c -x assembler -o $@ -
-$(obj)eeprom.srec: $(obj)eeprom.o $(obj)eeprom_start.o $(obj)u-boot.lds
- cd $(lnk) && $(LD) -T $(obj)u-boot.lds -g -Ttext $(LOAD_ADDR) \
- -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
+$(obj)eeprom: $(obj)eeprom_start.o $(obj)eeprom.o
+ $(LD) -Ttext $(LOAD_ADDR) -e eeprom -o $@ $^ \
-L$(obj)../../examples/standalone -lstubs \
- -L$(obj)../../lib_generic -lgeneric \
- -L$(gcclibdir) -lgcc
- $(OBJCOPY) -O srec $(<:.o=) $@
+ $(PLATFORM_LIBS)
-$(obj)eeprom.bin: $(obj)eeprom.srec
- $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
+$(obj)eeprom.srec: $(obj)eeprom
+ $(OBJCOPY) -S -O srec $(<:.o=) $@
-$(obj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+$(obj)eeprom.bin: $(obj)eeprom
+ $(OBJCOPY) -S -O binary $< $@
clean:
rm -f $(SOBJS) $(OBJS) $(obj)eeprom \
$(obj)eeprom.srec $(obj)eeprom.bin \
- $(obj)eeprom.o $(obj)eeprom_start.o \
- $(obj)u-boot.lds
+ $(obj)eeprom.o $(obj)eeprom_start.o
distclean: clean
rm -f $(LIB) core *.bak $(obj).depend