2002-03-28 15:09:10 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2004-10-04 13:03:33 +00:00
|
|
|
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
|
|
|
|
2005-02-18 13:47:17 +00:00
|
|
|
SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
2004-10-04 13:03:33 +00:00
|
|
|
SOURCES = $(SRC)
|
|
|
|
OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o
|
|
|
|
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
|
2004-09-22 08:58:50 +00:00
|
|
|
DIRS:=. drivers common
|
2002-05-23 11:46:15 +00:00
|
|
|
OUTPUT = $(OBJDIR)/librockbox.a
|
2004-09-22 08:58:50 +00:00
|
|
|
DEPFILE = $(OBJDIR)/dep-firmware
|
2002-10-02 16:47:38 +00:00
|
|
|
|
2003-07-10 11:52:42 +00:00
|
|
|
all: $(TOOLSDIR)/convbdf $(OUTPUT) $(EXTRA_TARGETS)
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
dep: $(DEPFILE)
|
|
|
|
|
2003-07-10 11:52:42 +00:00
|
|
|
$(TOOLSDIR)/convbdf:
|
2004-11-15 06:51:21 +00:00
|
|
|
$(MAKE) CC=gcc LD=ld -C $(TOOLSDIR)
|
2002-08-15 11:35:14 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OUTPUT): $(OBJS) $(DEPFILE)
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "AR $@"
|
2004-09-22 21:40:45 +00:00
|
|
|
@$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
|
2005-02-18 13:47:17 +00:00
|
|
|
@$(RANLIB) $@
|
2002-05-23 12:00:50 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
include $(TOOLSDIR)/make.inc
|
2002-08-15 09:30:41 +00:00
|
|
|
|
2002-03-28 15:09:10 +00:00
|
|
|
clean:
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "cleaning firmware"
|
2004-09-22 08:58:50 +00:00
|
|
|
@rm -f $(OBJS) $(OUTPUT) $(OBJDIR)/sysfont.c $(DEPFILE)
|
|
|
|
@rm -rf $(OBJDIR)/drivers $(OBJDIR)/common
|
2002-04-28 09:53:39 +00:00
|
|
|
|
2002-05-17 09:28:07 +00:00
|
|
|
# Special targets
|
2003-02-07 09:41:57 +00:00
|
|
|
$(OBJDIR)/thread.o: thread.c export/thread.h
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "CC thread.c"
|
|
|
|
@$(CC) -c -O -fomit-frame-pointer $(CFLAGS) $< -o $@
|
2002-05-17 09:28:07 +00:00
|
|
|
|
2002-09-20 08:07:51 +00:00
|
|
|
$(OBJDIR)/sysfont.o: fonts/clR6x8.bdf
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "CONVBDF"
|
|
|
|
@$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $<
|
|
|
|
@echo "CC sysfont.c"
|
|
|
|
@$(CC) $(CFLAGS) -c $(OBJDIR)/sysfont.c -o $@
|
2002-09-20 08:07:51 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
-include $(DEPFILE)
|