summaryrefslogtreecommitdiff
path: root/gdb/Makefile
diff options
context:
space:
mode:
authorTomasz Malesinski <tomal@rockbox.org>2006-01-25 01:43:07 +0000
committerTomasz Malesinski <tomal@rockbox.org>2006-01-25 01:43:07 +0000
commit2aabc875bfb68142622e699fbb208bd808e2088f (patch)
tree96c9a17ce88e19e21037d6ce56815bc983a53345 /gdb/Makefile
parentd9c0ad1db69dd3a32939725006fbe4ee27dedcff (diff)
GDB stub for ARM
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8447 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'gdb/Makefile')
-rw-r--r--gdb/Makefile65
1 files changed, 64 insertions, 1 deletions
diff --git a/gdb/Makefile b/gdb/Makefile
index 61f4cb838d..fa94eac9b1 100644
--- a/gdb/Makefile
+++ b/gdb/Makefile
@@ -7,6 +7,67 @@
# $Id$
#
+ifeq ($(ARCHOS),ifp7xx)
+
+INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \
+ -I$(BUILDDIR)
+
+DEPFILE = $(OBJDIR)/dep-stub
+LDS := linker.cfg
+
+SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
+DIRS = .
+
+ifdef APPEXTRA
+ DIRS += $(subst :, ,$(APPEXTRA))
+ INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA)))
+endif
+
+ifndef VERSION
+VERSION=$(shell date +%y%m%d-%H%M)
+endif
+
+CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \
+ -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
+
+OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
+SOURCES = $(SRC)
+LINKFILE = $(OBJDIR)/linkage.lds
+
+LIBROCKBOX = $(BUILDDIR)/librockbox.a
+
+all: $(BUILDDIR)/$(BINARY) $(FLASHFILE)
+
+dep: $(DEPFILE)
+
+$(LINKFILE): $(LDS)
+ @echo "Build LDS file"
+ @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
+
+$(OBJDIR)/stub.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX)
+ @echo "LD stub.elf"
+ @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/stub.map
+
+$(OBJDIR)/stub.bin : $(OBJDIR)/stub.elf
+ @echo "OBJCOPY $<"
+ @$(OC) -O binary $< $@
+
+$(BUILDDIR)/$(BINARY) : $(OBJDIR)/stub.bin
+ @echo "Build stub file"
+ $(MKFIRMWARE) $< $@
+
+include $(TOOLSDIR)/make.inc
+
+clean:
+ @echo "cleaning stub"
+ @-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) \
+ $(OBJDIR)/stub.bin $(OBJDIR)/stub.elf $(OBJDIR)/*.map \
+ $(LINKFILE) $(DEPFILE)
+
+-include $(DEPFILE)
+
+else # not ifp7xx
+
ifdef RECORDER
EXTRA = -DRECORDER
EXT = ajz
@@ -38,6 +99,8 @@ $(TARGET).elf: $(OBJS)
clean:
rm $(OBJS) $(TARGET).map $(TARGET).elf $(TARGET).out $(TARGET).mod $(TARGET).ajz
-start.o: start.S
+start.o: start.s
sh-stub.o: sh-stub.c
setjmp.o: setjmp.S
+
+endif