2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
16 INCLUDES
=-Iinclude
-I.
-Icommon
-Idrivers
18 SYSTEM_FONT
= fonts
/alt6x10.bdf
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:
28 CFLAGS
= -W
-Wall
-O
-m1
-nostdlib
-Wstrict-prototypes
$(INCLUDES
) $(TARGET
) $(EXTRA_DEFINES
)
33 CFLAGS
+= -fomit-frame-pointer
-fschedule-insns
36 SRC
:= $(wildcard drivers
/*.c common
/*.c
*.c
)
38 OBJS
:= $(SRC
:%.c
=$(OBJDIR
)/%.o
) $(OBJDIR
)/crt0.o
40 DEPDIRS
:=$(DEPS
) $(DEPS
)/drivers
$(DEPS
)/common
$(DEPS
)/malloc
42 DIRS
= $(subst $(DEPS
),".",$(DEPDIRS
))
44 OUTPUT
= $(OBJDIR
)/librockbox.a
46 ifeq (LOADABLE_FONTS
,$(findstring LOADABLE_FONTS
, $(CFLAGS
)))
47 EXTRA_TARGETS
= $(OBJDIR
)/system.ajf
50 all: $(OUTPUT
) $(EXTRA_TARGETS
)
56 @mkdir
-p
`dirname $@`
57 $(CC
) $(CFLAGS
) -c
$< -o
$@
60 @mkdir
-p
`dirname $@`
61 $(CC
) $(CFLAGS
) -c
$< -o
$@
63 $(OBJDIR
)/system.ajf
: $(SYSTEM_FONT
)
64 ..
/tools
/bdf2ajf
-f
$(SYSTEM_FONT
) -o
$(OBJDIR
)/system.ajf
67 @
$(SHELL
) -c
'for d in $(DIRS); do { etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; }; done'
70 rm -f
$(OBJS
) $(OUTPUT
)
71 rm -rf
$(OBJDIR
)/$(DEPS
)
74 $(OBJDIR
)/thread.o
: thread.c thread.h
75 $(CC
) -c
-O
-fomit-frame-pointer
$(CFLAGS
) $< -o
$@
77 $(OBJDIR
)/$(DEPS
)/%.d
: %.c
78 @
$(SHELL
) -c
'for d in $(DEPDIRS); do { if [ ! -d $(OBJDIR)/$$d ]; then mkdir $(OBJDIR)/$$d; fi; }; done'
79 @echo
"Updating dependencies for $<"
80 @
$(SHELL
) -ec
'$(CC) -MM $(CFLAGS) $< \
81 |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
82 [ -s $@ ] || rm -f $@'
84 -include $(SRC
:%.c
=$(OBJDIR
)/$(DEPS
)/%.d
)