From 7f64303420e4883819d6b41129e6cdb1baf843c4 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Fri, 17 May 2002 19:52:56 +0000 Subject: Added DEBUG option, enabling support for gdb stub git-svn-id: svn://svn.rockbox.org/rockbox/trunk@627 a1c6a512-1295-4272-9138-f99709370657 --- apps/Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'apps/Makefile') 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 -- cgit v1.2.3