2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
16 INCLUDES
=-Iinclude
-I.
-Iexport
-Icommon
-Idrivers
18 CFLAGS
= -W
-Wall
-O
-m1
-nostdlib
-ffreestanding
-Wstrict-prototypes
$(INCLUDES
) $(TARGET
) $(EXTRA_DEFINES
) -DMEM
=${MEM}
21 # if MEM is not set, assume 2MB
28 CFLAGS
+= -fomit-frame-pointer
-fschedule-insns
31 SRC
:= $(wildcard drivers
/*.c common
/*.c
*.c
)
32 SRC_S
:= $(wildcard drivers
/*.S common
/*.S
*.S
)
34 OBJS
:= $(SRC
:%.c
=$(OBJDIR
)/%.o
) $(SRC_S
:%.S
=$(OBJDIR
)/%.o
)
36 DEPDIRS
:=$(DEPS
) $(DEPS
)/drivers
$(DEPS
)/common
$(DEPS
)/malloc
38 DIRS
= $(subst $(DEPS
),".",$(DEPDIRS
))
40 OUTPUT
= $(OBJDIR
)/librockbox.a
42 ifeq (RECORDER
,$(findstring RECORDER
, $(CFLAGS
)))
43 OBJS
+= $(OBJDIR
)/sysfont.o
48 @echo
"Don't run make here. Run the tools/configure script from your own build"
49 @echo
"directory, then run make there."
51 @echo
"More help on how to build rockbox can be found here:"
52 @echo
"http://rockbox.haxx.se/docs/how_to_compile.html"
59 all: $(TOOLSDIR
)/convbdf
$(OUTPUT
) $(EXTRA_TARGETS
)
62 $(MAKE
) -C
$(TOOLSDIR
)
68 @mkdir
-p
`dirname $@`
69 $(CC
) $(CFLAGS
) -c
$< -o
$@
72 @mkdir
-p
`dirname $@`
73 $(CC
) $(CFLAGS
) -c
$< -o
$@
76 @
$(SHELL
) -c
'for d in $(DIRS); do { etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; }; done'
79 rm -f
$(OBJS
) $(OUTPUT
) $(OBJDIR
)/sysfont.c
80 rm -rf
$(OBJDIR
)/$(DEPS
)
83 $(OBJDIR
)/thread.o
: thread.c
export/thread.h
84 $(CC
) -c
-O
-fomit-frame-pointer
$(CFLAGS
) $< -o
$@
86 $(OBJDIR
)/sysfont.o
: fonts
/clR6x8.bdf
87 $(TOOLSDIR
)/convbdf
-c
-o
$(OBJDIR
)/sysfont.c
$<
88 $(CC
) $(CFLAGS
) -c
$(OBJDIR
)/sysfont.c
-o
$@
90 $(OBJDIR
)/$(DEPS
)/%.d
: %.c
91 @
$(SHELL
) -c
'for d in $(DEPDIRS); do { if [ ! -d $(OBJDIR)/$$d ]; then mkdir $(OBJDIR)/$$d; fi; }; done'
92 @echo
"Updating dependencies for $<"
93 @
$(SHELL
) -ec
'$(CC) -MM $(CFLAGS) $< \
94 |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
95 [ -s $@ ] || rm -f $@'
98 -include $(SRC
:%.c
=$(OBJDIR
)/$(DEPS
)/%.d
)