summaryrefslogtreecommitdiff
path: root/board/netstar/Makefile
diff options
context:
space:
mode:
authorLadislav Michl <Ladislav.Michl@seznam.cz>2010-02-08 14:15:47 -0500
committerTom Rix <Tom.Rix@windriver.com>2010-03-07 12:36:34 -0600
commit3a67566c1def7d2eb935b31b3b282ba893c3f330 (patch)
tree6db675d8304fe014984661898564c36589cfdd99 /board/netstar/Makefile
parent308d463eaf6f4ada00193306a6e643298d1990d8 (diff)
downloadu-boot-imx-3a67566c1def7d2eb935b31b3b282ba893c3f330.zip
u-boot-imx-3a67566c1def7d2eb935b31b3b282ba893c3f330.tar.gz
u-boot-imx-3a67566c1def7d2eb935b31b3b282ba893c3f330.tar.bz2
NetStar: eeprom - fix linker error
linking eeprom with libgeneric.a is not really needed and causes following error: ../../lib_generic/libgeneric.a(string.o): In function `strcmp': lib_generic/string.c:152: multiple definition of `strcmp' ../../examples/standalone/libstubs.a(stubs.o):include/_exports.h:24: first defined here Remove eeprom linker script as well and generate entry point object (to start application by jumping on its beginning) on the fly. Out-of-tree build tested as well. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Diffstat (limited to 'board/netstar/Makefile')
-rw-r--r--board/netstar/Makefile54
1 files changed, 25 insertions, 29 deletions
diff --git a/board/netstar/Makefile b/board/netstar/Makefile
index 11578b7..c435762 100644
--- a/board/netstar/Makefile
+++ b/board/netstar/Makefile
@@ -29,20 +29,15 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := netstar.o
-SOBJS := setup.o crcek.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),.)
-HOSTCFLAGS = -Wall -pedantic -I$(TOPDIR)/include
+#########################################################################
all: $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin \
$(obj)crcek.srec $(obj)crcek.bin $(obj)crcit
@@ -50,41 +45,42 @@ all: $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin \
$(LIB): $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $^
-$(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_start.o:
+ echo "b eeprom" | $(CC) $(AFLAGS) -c -x assembler -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)eeprom.bin: $(obj)eeprom
+ $(OBJCOPY) -S -O binary $< $@
$(obj)crcek.srec: $(obj)crcek.o
- $(LD) -g -Ttext 0x00000000 \
- -o $(<:.o=) -e crcek $^
- $(OBJCOPY) -O srec $(<:.o=) $@
+ $(LD) -g -Ttext 0x00000000 -e crcek -o $(<:.o=) $^
+ $(OBJCOPY) -S -O srec $(<:.o=) $@
$(obj)crcek.bin: $(obj)crcek.srec
- $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
+ $(OBJCOPY) -I srec -O binary $< $@
$(obj)crcit: $(obj)crcit.o $(obj)crc32.o
$(HOSTCC) $(HOSTCFLAGS) -o $@ $^
-$(obj)crcit.o: crcit.c
+$(obj)crcit.o: crcit.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
-$(obj)crc32.o: $(SRCTREE)/lib_generic/crc32.c
- $(HOSTCC) $(HOSTCFLAGS) -DUSE_HOSTCC -o $@ -c $<
-
-$(obj)u-boot.lds: $(LDSCRIPT)
- $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+$(obj)crc32.o: $(SRCTREE)/lib_generic/crc32.c
+ $(HOSTCC) $(HOSTCFLAGS) -DUSE_HOSTCC -I$(TOPDIR)/include \
+ -o $@ -c $<
clean:
- rm -f $(SOBJS) $(OBJS) $(obj)eeprom $(obj)eeprom.srec \
- $(obj)eeprom.bin $(obj)crcek $(obj)crcek.srec \
- $(obj)crcek.bin $(obj)u-boot.lds
+ rm -f $(SOBJS) $(OBJS) \
+ $(obj)eeprom_start.o $(obj)eeprom.o \
+ $(obj)eeprom $(obj)eeprom.srec $(obj)eeprom.bin \
+ $(obj)crcek.o $(obj)crcek $(obj)crcek.srec $(obj)crcek.bin
distclean: clean
rm -f $(LIB) core *.bak $(obj).depend