2008-11-20 11:27:31 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2008-11-25 19:54:23 +00:00
|
|
|
# $Id$
|
2008-11-20 11:27:31 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
CHESSBOX_SRCDIR = $(APPSDIR)/plugins/chessbox
|
|
|
|
CHESSBOX_OBJDIR = $(BUILDDIR)/apps/plugins/chessbox
|
|
|
|
|
|
|
|
CHESSBOX_SRC := $(call preprocess, $(CHESSBOX_SRCDIR)/SOURCES)
|
|
|
|
CHESSBOX_OBJ := $(call c2obj, $(CHESSBOX_SRC))
|
|
|
|
|
|
|
|
OTHER_SRC += $(CHESSBOX_SRC)
|
|
|
|
|
2010-05-18 14:14:53 +00:00
|
|
|
ifeq ($(findstring YES, $(call preprocess, $(APPSDIR)/plugins/BUILD_OVERLAY)), YES)
|
2009-03-02 00:16:44 +00:00
|
|
|
### lowmem targets
|
2008-11-20 11:27:31 +00:00
|
|
|
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl
|
2009-03-02 00:16:44 +00:00
|
|
|
CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.link
|
|
|
|
CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
|
2008-11-20 11:27:31 +00:00
|
|
|
else
|
|
|
|
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
|
|
|
|
endif
|
|
|
|
|
|
|
|
CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
|
|
|
|
|
2009-03-02 00:16:44 +00:00
|
|
|
$(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ)
|
|
|
|
|
|
|
|
$(CHESSBOX_OBJDIR)/chessbox.refmap: $(CHESSBOX_OBJ)
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 00:16:44 +00:00
|
|
|
$(CHESSBOX_OUTLDS): $(PLUGIN_LDS) $(CHESSBOX_OBJDIR)/chessbox.refmap
|
|
|
|
$(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
|
|
|
|
$(TOOLSDIR)/ovl_offset.pl $(CHESSBOX_OBJDIR)/chessbox.refmap))
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 00:16:44 +00:00
|
|
|
$(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS)
|
2008-11-21 22:00:35 +00:00
|
|
|
$(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
|
2008-11-20 11:27:31 +00:00
|
|
|
$(filter %.o, $^) \
|
2009-03-02 00:16:44 +00:00
|
|
|
$(filter %.a, $+) \
|
2008-11-20 11:27:31 +00:00
|
|
|
-lgcc $(CHESSBOX_OVLFLAGS)
|
2012-04-04 19:43:22 +00:00
|
|
|
$(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
# special pattern rule for compiling chessbox with extra flags
|
2010-01-17 13:03:10 +00:00
|
|
|
$(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(CHESSBOX_SRCDIR)/chessbox.make
|
2008-11-20 11:27:31 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
|
|
|
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(CHESSBOXFLAGS) -c $< -o $@
|