2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 INCLUDES
=-Iinclude
-I
$(FIRMDIR
) -Iexport
-Icommon
-Idrivers
12 CFLAGS
= -W
-Wall
-O
-m1
-nostdlib
-ffreestanding
-Wstrict-prototypes \
13 $(INCLUDES
) $(TARGET
) $(EXTRA_DEFINES
) -DMEM
=${MEMORYSIZE}
18 CFLAGS
+= -fomit-frame-pointer
-fschedule-insns
21 SRC
:= $(wildcard drivers
/*.c common
/*.c
*.c
)
22 SRC_S
:= $(wildcard drivers
/*.S common
/*.S
*.S
)
23 SOURCES
= $(SRC
) $(SRC_S
)
24 OBJS
:= $(SRC
:%.c
=$(OBJDIR
)/%.o
) $(SRC_S
:%.S
=$(OBJDIR
)/%.o
) $(OBJDIR
)/sysfont.o
25 DIRS
:=. drivers common
26 OUTPUT
= $(OBJDIR
)/librockbox.a
27 DEPFILE
= $(OBJDIR
)/dep-firmware
29 all: $(TOOLSDIR
)/convbdf
$(OUTPUT
) $(EXTRA_TARGETS
)
34 $(MAKE
) -C
$(TOOLSDIR
)
36 $(OUTPUT
): $(OBJS
) $(DEPFILE
)
38 @
$(AR
) ruv
$@
$(OBJS
) >/dev
/null
2>&1
40 include $(TOOLSDIR
)/make.inc
43 @echo
"cleaning firmware"
44 @
rm -f
$(OBJS
) $(OUTPUT
) $(OBJDIR
)/sysfont.c
$(DEPFILE
)
45 @
rm -rf
$(OBJDIR
)/drivers
$(OBJDIR
)/common
48 $(OBJDIR
)/thread.o
: thread.c
export/thread.h
50 @
$(CC
) -c
-O
-fomit-frame-pointer
$(CFLAGS
) $< -o
$@
52 $(OBJDIR
)/sysfont.o
: fonts
/clR6x8.bdf
54 @
$(TOOLSDIR
)/convbdf
-c
-o
$(OBJDIR
)/sysfont.c
$<
56 @
$(CC
) $(CFLAGS
) -c
$(OBJDIR
)/sysfont.c
-o
$@