summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
18INCLUDES= -I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers 18INCLUDES= -I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers
19 19
20# Pick a target to build for 20# Pick a target to build for
21TARGET = -DARCHOS_PLAYER=1 21#TARGET = -DARCHOS_PLAYER=1
22#TARGET = -DARCHOS_PLAYER_OLD=1 22TARGET = -DARCHOS_PLAYER_OLD=1
23#TARGET = -DARCHOS_RECORDER=1 23#TARGET = -DARCHOS_RECORDER=1
24 24
25CFLAGS = -Os -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) -DDEBUG 25ifdef DEBUG
26 DEFINES := -DDEBUG
27 LDS := $(FIRMWARE)/gdb.lds
28else
29 LDS := $(FIRMWARE)/app.lds
30endif
31
32CFLAGS = -O -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) $(DEFINES)
26AFLAGS += -small -relax 33AFLAGS += -small -relax
27 34
28SRC := $(wildcard drivers/*.c common/*.c *.c) 35SRC := $(wildcard drivers/*.c common/*.c *.c)
29OBJS := $(SRC:%.c=%.o) $(FIRMWARE)/crt0.o 36OBJS := $(SRC:%.c=%.o)
30 37
31all : archos.mod # archos.asm 38all : archos.mod # archos.asm
32 39
33archos.elf : $(OBJS) $(FIRMWARE)/app.lds 40archos.elf : $(OBJS) $(LDS) $(FIRMWARE)/librockbox.a
34 $(CC) -nostdlib -o archos.elf $(OBJS) -lrockbox -lgcc -lc -L$(FIRMWARE) -T$(FIRMWARE)/app.lds -Wl,-Map,archos.map 41 $(CC) -Os -nostdlib -o archos.elf $(OBJS) -lrockbox -lgcc -lc -L$(FIRMWARE) -T$(LDS) -Wl,-Map,archos.map
35 42
36archos.bin : archos.elf 43archos.bin : archos.elf
37 $(OC) -O binary archos.elf archos.bin 44 $(OC) -O binary archos.elf archos.bin
@@ -49,8 +56,6 @@ clean:
49 -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ 56 -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
50 -$(RM) -r $(DEPS) 57 -$(RM) -r $(DEPS)
51 58
52crt0.o: $(FIRMWARE)/crt0.S
53
54DEPS:=.deps 59DEPS:=.deps
55DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common 60DEPDIRS:=$(DEPS) $(DEPS)/drivers $(DEPS)/common
56 61