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
|
2006-10-27 21:48:06 +00:00
|
|
|
PRINTS=$(info $(1))$(SILENT)
|
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
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
|
2005-11-27 23:55:13 +00:00
|
|
|
|
2006-03-07 23:52:33 +00:00
|
|
|
$(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map
|
2005-11-27 23:55:13 +00:00
|
|
|
|
2006-02-13 13:45:10 +00:00
|
|
|
$(LDS): $(OBJS)
|
|
|
|
|
|
|
|
|
2005-11-27 23:55:13 +00:00
|
|
|
$(LINKFILE): $(LDS)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,Build LDS file)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
|
2006-10-22 00:21:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,CC $<)$(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
|
2006-10-22 00:21:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,AS $<)$(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
|
2006-10-22 00:21:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,CC $(<F))$(CC) $(CFLAGS) -c $< -o $@
|
2005-12-05 21:56:56 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/uclimage.c : $(FLASHFILE) $(TOOLSDIR)/ucl2src.pl
|
2006-10-22 00:21:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2006-10-27 21:48:06 +00:00
|
|
|
$(call PRINTS,UCL2SRC)perl -s $(TOOLSDIR)/ucl2src.pl -p=$(OBJDIR)/uclimage $<
|
2005-12-05 21:56:56 +00:00
|
|
|
|