diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-02-26 09:16:48 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-02-26 09:16:48 +0000 |
commit | ae03eec5db87aa1ad93af6a85ef1f9ae366c5075 (patch) | |
tree | 8ee1eda2d972cb86e9a304d8f4407fbe31467b6e /apps | |
parent | ea9c5bb16726bdbea82c28f4e3e4d6e18d4ea789 (diff) | |
download | rockbox-ae03eec5db87aa1ad93af6a85ef1f9ae366c5075.tar.gz rockbox-ae03eec5db87aa1ad93af6a85ef1f9ae366c5075.zip |
MEM should be passed in to this make, setting the size of the DRAM in MB.
We now preprocess the .lds file to allow macros/#ifdef etc and we now set
the DRAM size using a define. In combination with the recent configure fix,
this should allow us to build 8MB versions "out of the box".
The 'dist' target was removed.
'archos' was replaced with 'rockbox' in all the temporary file names when
building/linking. Plain cosmetic change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3345 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Makefile | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/apps/Makefile b/apps/Makefile index 68ea23a21a..9c2b961a5a 100644 --- a/apps/Makefile +++ b/apps/Makefile | |||
@@ -26,6 +26,11 @@ AFLAGS += -small -relax | |||
26 | # Check if this is a kind of Recorder | 26 | # Check if this is a kind of Recorder |
27 | ANYREC = $(findstring RECORDER, $(TARGET)) | 27 | ANYREC = $(findstring RECORDER, $(TARGET)) |
28 | 28 | ||
29 | ifndef MEM | ||
30 | # if MEM is not set, assume 2MB | ||
31 | MEM=2 | ||
32 | endif | ||
33 | |||
29 | ifdef DEBUG | 34 | ifdef DEBUG |
30 | DEFINES := -DDEBUG | 35 | DEFINES := -DDEBUG |
31 | CFLAGS += -g | 36 | CFLAGS += -g |
@@ -52,6 +57,8 @@ endif | |||
52 | 57 | ||
53 | OBJS := $(OBJDIR)/lang.o $(SRC:%.c=$(OBJDIR)/%.o) | 58 | OBJS := $(OBJDIR)/lang.o $(SRC:%.c=$(OBJDIR)/%.o) |
54 | 59 | ||
60 | LINKFILE = $(OBJDIR)/linkage.lds | ||
61 | |||
55 | ifndef OBJDIR | 62 | ifndef OBJDIR |
56 | no_configure: | 63 | no_configure: |
57 | @echo "Don't run make here. Run the tools/configure script from your own build" | 64 | @echo "Don't run make here. Run the tools/configure script from your own build" |
@@ -66,17 +73,22 @@ all : $(OBJDIR)/$(OUTNAME) | |||
66 | $(OBJDIR)/librockbox.a: | 73 | $(OBJDIR)/librockbox.a: |
67 | make -C $(FIRMWARE) TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) | 74 | make -C $(FIRMWARE) TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) |
68 | 75 | ||
69 | $(OBJDIR)/archos.elf : $(OBJS) $(LDS) $(OBJDIR)/librockbox.a | 76 | # MEM should be passed on to this makefile with the chosen memory size given |
70 | $(CC) -Os -nostdlib -o $(OBJDIR)/archos.elf $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMWARE) -T$(LDS) -Wl,-Map,$(OBJDIR)/archos.map | 77 | # in number of MB |
78 | $(LINKFILE): $(LDS) | ||
79 | cat $< | $(CC) -DMEMORYSIZE=$(MEM) -E -P - >$@ | ||
71 | 80 | ||
72 | $(OBJDIR)/archos.bin : $(OBJDIR)/archos.elf | 81 | $(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/librockbox.a |
73 | $(OC) -O binary $(OBJDIR)/archos.elf $(OBJDIR)/archos.bin | 82 | $(CC) -Os -nostdlib -o $(OBJDIR)/rockbox.elf $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMWARE) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map |
74 | 83 | ||
75 | $(OBJDIR)/archos.asm: $(OBJDIR)/archos.bin | 84 | $(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf |
76 | ../tools/sh2d -sh1 $(OBJDIR)/archos.bin > $(OBJDIR)/archos.asm | 85 | $(OC) -O binary $(OBJDIR)/rockbox.elf $(OBJDIR)/rockbox.bin |
77 | 86 | ||
78 | $(OBJDIR)/$(OUTNAME) : $(OBJDIR)/archos.bin | 87 | $(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin |
79 | ../tools/scramble $(SCRAMBLE_OPT) $(OBJDIR)/archos.bin $(OBJDIR)/$(OUTNAME) | 88 | ../tools/sh2d -sh1 $(OBJDIR)/rockbox.bin > $(OBJDIR)/rockbox.asm |
89 | |||
90 | $(OBJDIR)/$(OUTNAME) : $(OBJDIR)/rockbox.bin | ||
91 | ../tools/scramble $(SCRAMBLE_OPT) $(OBJDIR)/rockbox.bin $(OBJDIR)/$(OUTNAME) | ||
80 | 92 | ||
81 | $(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS | 93 | $(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS |
82 | perl credits.pl < $< > $@ | 94 | perl credits.pl < $< > $@ |
@@ -96,14 +108,11 @@ $(OBJDIR)/lang.o: $(OBJDIR)/build.lang ../tools/genlang | |||
96 | perl -s ../tools/genlang -p=$(OBJDIR)/lang $< | 108 | perl -s ../tools/genlang -p=$(OBJDIR)/lang $< |
97 | $(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@ | 109 | $(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@ |
98 | 110 | ||
99 | dist: | ||
100 | tar czvf dist.tar.gz Makefile main.c start.s app.lds | ||
101 | |||
102 | clean: | 111 | clean: |
103 | -rm -f $(OBJS) $(OBJDIR)/$(OUTNAME) $(OBJDIR)/archos.asm \ | 112 | -rm -f $(OBJS) $(OBJDIR)/$(OUTNAME) $(OBJDIR)/rockbox.asm \ |
104 | $(OBJDIR)/archos.bin $(OBJDIR)/archos.elf $(OBJDIR)/archos.map \ | 113 | $(OBJDIR)/rockbox.bin $(OBJDIR)/rockbox.elf $(OBJDIR)/rockbox.map \ |
105 | $(OBJDIR)/lang.o $(OBJDIR)/build.lang $(OBJDIR)/lang.[ch] \ | 114 | $(OBJDIR)/lang.o $(OBJDIR)/build.lang $(OBJDIR)/lang.[ch] \ |
106 | $(OBJDIR)/credits.raw | 115 | $(OBJDIR)/credits.raw $(LINKFILE) |
107 | -$(RM) -r $(OBJDIR)/$(DEPS) | 116 | -$(RM) -r $(OBJDIR)/$(DEPS) |
108 | 117 | ||
109 | DEPS:=.deps | 118 | DEPS:=.deps |