summaryrefslogtreecommitdiff
path: root/board/voiceblue/Makefile
diff options
context:
space:
mode:
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