2005-11-27 23:55:13 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2005-12-05 21:56:56 +00:00
|
|
|
ifndef V
|
|
|
|
SILENT=@
|
|
|
|
endif
|
2005-11-27 23:55:13 +00:00
|
|
|
|
|
|
|
LDS := link.lds
|
|
|
|
LINKFILE = $(OBJDIR)/linkage.lds
|
2005-11-30 00:05:40 +00:00
|
|
|
OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o
|
2005-12-05 21:56:56 +00:00
|
|
|
CFLAGS = $(GCCOPTS)
|
2005-11-27 23:55:13 +00:00
|
|
|
|
2005-11-30 00:05:40 +00:00
|
|
|
all: $(OBJDIR)/compressed.bin
|
|
|
|
|
2005-11-27 23:55:13 +00:00
|
|
|
$(OBJDIR)/compressed.bin : $(OBJDIR)/compressed.elf
|
|
|
|
@echo "OBJCOPY "`basename $@`
|
2005-12-05 21:56:56 +00:00
|
|
|
$(SILENT)$(OC) -O binary $< $@
|
2005-11-27 23:55:13 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE)
|
2005-12-05 21:56:56 +00:00
|
|
|
@echo "LD `basename $@`"
|
|
|
|
$(SILENT)$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map
|
2005-11-27 23:55:13 +00:00
|
|
|
|
|
|
|
$(LINKFILE): $(LDS)
|
|
|
|
@echo "Build LDS file"
|
2005-12-05 21:56:56 +00:00
|
|
|
$(SILENT)cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
|
2005-11-27 23:55:13 +00:00
|
|
|
|
2005-12-05 21:56:56 +00:00
|
|
|
$(OBJDIR)/decompressor.o : decompressor.c $(OBJDIR)/uclimage.c
|
|
|
|
$(SILENT)mkdir -p `dirname $@`
|
|
|
|
@echo "CC $<"
|
|
|
|
$(SILENT)$(CC) $(CFLAGS) -I$(OBJDIR) -c $< -o $@
|
2005-11-30 00:05:40 +00:00
|
|
|
|
2005-12-05 21:56:56 +00:00
|
|
|
$(OBJDIR)/startup.o : startup.S
|
|
|
|
$(SILENT)mkdir -p `dirname $@`
|
|
|
|
@echo "AS $<"
|
|
|
|
$(SILENT)$(CC) $(CFLAGS) -c $< -o $@
|
2005-11-30 00:05:40 +00:00
|
|
|
|
2005-12-05 21:56:56 +00:00
|
|
|
$(OBJDIR)/uclimage.o : $(OBJDIR)/uclimage.c
|
|
|
|
$(SILENT)mkdir -p `dirname $@`
|
|
|
|
@echo "CC `basename $<`"
|
|
|
|
$(SILENT)$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/uclimage.c : $(FLASHFILE) $(TOOLSDIR)/ucl2src.pl
|
|
|
|
$(SILENT)mkdir -p `dirname $@`
|
2005-11-30 00:05:40 +00:00
|
|
|
@echo "UCL2SRC"
|
2005-12-05 21:56:56 +00:00
|
|
|
$(SILENT)perl -s $(TOOLSDIR)/ucl2src.pl -p=$(OBJDIR)/uclimage $<
|
|
|
|
|