diff options
Diffstat (limited to 'gdb/Makefile')
-rw-r--r-- | gdb/Makefile | 65 |
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 @@ | |||
7 | # $Id$ | 7 | # $Id$ |
8 | # | 8 | # |
9 | 9 | ||
10 | ifeq ($(ARCHOS),ifp7xx) | ||
11 | |||
12 | INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \ | ||
13 | -I$(BUILDDIR) | ||
14 | |||
15 | DEPFILE = $(OBJDIR)/dep-stub | ||
16 | LDS := linker.cfg | ||
17 | |||
18 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) | ||
19 | DIRS = . | ||
20 | |||
21 | ifdef APPEXTRA | ||
22 | DIRS += $(subst :, ,$(APPEXTRA)) | ||
23 | INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA))) | ||
24 | endif | ||
25 | |||
26 | ifndef VERSION | ||
27 | VERSION=$(shell date +%y%m%d-%H%M) | ||
28 | endif | ||
29 | |||
30 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \ | ||
31 | -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} | ||
32 | |||
33 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
34 | SOURCES = $(SRC) | ||
35 | LINKFILE = $(OBJDIR)/linkage.lds | ||
36 | |||
37 | LIBROCKBOX = $(BUILDDIR)/librockbox.a | ||
38 | |||
39 | all: $(BUILDDIR)/$(BINARY) $(FLASHFILE) | ||
40 | |||
41 | dep: $(DEPFILE) | ||
42 | |||
43 | $(LINKFILE): $(LDS) | ||
44 | @echo "Build LDS file" | ||
45 | @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ | ||
46 | |||
47 | $(OBJDIR)/stub.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX) | ||
48 | @echo "LD stub.elf" | ||
49 | @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/stub.map | ||
50 | |||
51 | $(OBJDIR)/stub.bin : $(OBJDIR)/stub.elf | ||
52 | @echo "OBJCOPY $<" | ||
53 | @$(OC) -O binary $< $@ | ||
54 | |||
55 | $(BUILDDIR)/$(BINARY) : $(OBJDIR)/stub.bin | ||
56 | @echo "Build stub file" | ||
57 | $(MKFIRMWARE) $< $@ | ||
58 | |||
59 | include $(TOOLSDIR)/make.inc | ||
60 | |||
61 | clean: | ||
62 | @echo "cleaning stub" | ||
63 | @-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) \ | ||
64 | $(OBJDIR)/stub.bin $(OBJDIR)/stub.elf $(OBJDIR)/*.map \ | ||
65 | $(LINKFILE) $(DEPFILE) | ||
66 | |||
67 | -include $(DEPFILE) | ||
68 | |||
69 | else # not ifp7xx | ||
70 | |||
10 | ifdef RECORDER | 71 | ifdef RECORDER |
11 | EXTRA = -DRECORDER | 72 | EXTRA = -DRECORDER |
12 | EXT = ajz | 73 | EXT = ajz |
@@ -38,6 +99,8 @@ $(TARGET).elf: $(OBJS) | |||
38 | clean: | 99 | clean: |
39 | rm $(OBJS) $(TARGET).map $(TARGET).elf $(TARGET).out $(TARGET).mod $(TARGET).ajz | 100 | rm $(OBJS) $(TARGET).map $(TARGET).elf $(TARGET).out $(TARGET).mod $(TARGET).ajz |
40 | 101 | ||
41 | start.o: start.S | 102 | start.o: start.s |
42 | sh-stub.o: sh-stub.c | 103 | sh-stub.o: sh-stub.c |
43 | setjmp.o: setjmp.S | 104 | setjmp.o: setjmp.S |
105 | |||
106 | endif | ||