summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-05-17 19:52:56 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-05-17 19:52:56 +0000
commit7f64303420e4883819d6b41129e6cdb1baf843c4 (patch)
treec96d7029fbfb87d74cbabd4c1b3c6e81c27a4105 /apps
parente324db6e1e650c5ae4c7a3cf17861ccc644e3723 (diff)
downloadrockbox-7f64303420e4883819d6b41129e6cdb1baf843c4.tar.gz
rockbox-7f64303420e4883819d6b41129e6cdb1baf843c4.zip
Added DEBUG option, enabling support for gdb stub
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@627 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/Makefile21
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/Makefile b/apps/Makefile
index df7005ea40..de97bead7b 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -18,20 +18,27 @@ FIRMWARE := ../firmware
INCLUDES= -I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers
# Pick a target to build for
-TARGET = -DARCHOS_PLAYER=1
-#TARGET = -DARCHOS_PLAYER_OLD=1
+#TARGET = -DARCHOS_PLAYER=1
+TARGET = -DARCHOS_PLAYER_OLD=1
#TARGET = -DARCHOS_RECORDER=1
-CFLAGS = -Os -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) -DDEBUG
+ifdef DEBUG
+ DEFINES := -DDEBUG
+ LDS := $(FIRMWARE)/gdb.lds
+else
+ LDS := $(FIRMWARE)/app.lds
+endif
+
+CFLAGS = -O -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) $(DEFINES)
AFLAGS += -small -relax
SRC := $(wildcard drivers/*.c common/*.c *.c)
-OBJS := $(SRC:%.c=%.o) $(FIRMWARE)/crt0.o
+OBJS := $(SRC:%.c=%.o)
all : archos.mod # archos.asm
-archos.elf : $(OBJS) $(FIRMWARE)/app.lds
- $(CC) -nostdlib -o archos.elf $(OBJS) -lrockbox -lgcc -lc -L$(FIRMWARE) -T$(FIRMWARE)/app.lds -Wl,-Map,archos.map
+archos.elf : $(OBJS) $(LDS) $(FIRMWARE)/librockbox.a
+ $(CC) -Os -nostdlib -o archos.elf $(OBJS) -lrockbox -lgcc -lc -L$(FIRMWARE) -T$(LDS) -Wl,-Map,archos.map
archos.bin : archos.elf
$(OC) -O binary archos.elf archos.bin
@@ -49,8 +56,6 @@ clean:
-rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
-$(RM) -r $(DEPS)
-crt0.o: $(FIRMWARE)/crt0.S
-
DEPS:=.deps
DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common