removed entry for status bar
[kugel-rb.git] / apps / Makefile
blobbd76209fadaeb0c6dbb7122da7e4890ba3d4b7e3
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 CC = sh-elf-gcc
11 LD = sh-elf-ld
12 AR = sh-elf-ar
13 AS = sh-elf-as
14 OC = sh-elf-objcopy
16 FIRMWARE := ../firmware
18 INCLUDES= -I$(FIRMWARE)/include -I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I$(FIRMWARE)/malloc
20 # Pick a target to build for
21 #TARGET = -DARCHOS_PLAYER=1
22 TARGET = -DARCHOS_PLAYER_OLD=1
23 #TARGET = -DARCHOS_RECORDER=1
25 # store output files in this directory:
26 OBJDIR = .
28 CFLAGS = -O -W -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(TARGET) $(DEFINES) -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES)
29 AFLAGS += -small -relax
31 ifdef DEBUG
32 DEFINES := -DDEBUG
33 CFLAGS += -g
34 LDS := $(FIRMWARE)/gdb.lds
35 else
36 ifeq ($(TARGET),-DARCHOS_RECORDER)
37 LDS := $(FIRMWARE)/app.lds
38 else
39 LDS := $(FIRMWARE)/player.lds
40 endif
41 endif
43 SRC := $(wildcard *.c)
45 ifeq ($(TARGET),-DARCHOS_RECORDER)
46 SRC += $(wildcard recorder/*.c)
47 CFLAGS += -Irecorder
48 OUTNAME = ajbrec.ajz
49 else
50 OUTNAME = archos.mod
51 endif
53 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
55 all : $(OBJDIR)/$(OUTNAME)
57 $(OBJDIR)/librockbox.a:
58 make -C $(FIRMWARE) TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR)
60 $(OBJDIR)/archos.elf : $(OBJS) $(LDS) $(OBJDIR)/librockbox.a
61 $(CC) -Os -nostdlib -o $(OBJDIR)/archos.elf $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMWARE) -T$(LDS) -Wl,-Map,$(OBJDIR)/archos.map
63 $(OBJDIR)/archos.bin : $(OBJDIR)/archos.elf
64 $(OC) -O binary $(OBJDIR)/archos.elf $(OBJDIR)/archos.bin
66 $(OBJDIR)/archos.asm: $(OBJDIR)/archos.bin
67 ../tools/sh2d -sh1 $(OBJDIR)/archos.bin > $(OBJDIR)/archos.asm
69 $(OBJDIR)/$(OUTNAME) : $(OBJDIR)/archos.bin
70 ../tools/scramble $(OBJDIR)/archos.bin $(OBJDIR)/$(OUTNAME)
72 $(OBJDIR)/%.o: %.c
73 @mkdir -p `dirname $@`
74 $(CC) $(CFLAGS) -c $< -o $@
76 dist:
77 tar czvf dist.tar.gz Makefile main.c start.s app.lds
79 clean:
80 -rm -f $(OBJS) $(OBJDIR)/$(OUTNAME) $(OBJDIR)/archos.asm \
81 $(OBJDIR)/archos.bin $(OBJDIR)/archos.elf $(OBJDIR)/archos.map
82 -$(RM) -r $(OBJDIR)/$(DEPS)
84 DEPS:=.deps
85 DEPDIRS:=$(DEPS) $(DEPS)/recorder
87 DIRS = $(subst $(DEPS),".",$(DEPDIRS))
89 tags:
90 @$(SHELL) -c 'for d in $(DIRS); do { etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; }; done'
92 $(OBJDIR)/$(DEPS)/%.d: %.c
93 @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $(OBJDIR)/$$d ]; then mkdir $(OBJDIR)/$$d; fi; }; done'
94 @echo "Updating dependencies for $(OBJDIR)/$<"
95 @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
96 |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
97 [ -s $@ ] || rm -f $@'
99 -include $(SRC:%.c=$(OBJDIR)/$(DEPS)/%.d)