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
|
|
|
#
|
|
|
|
|
|
|
|
ZXBOX_SRCDIR = $(APPSDIR)/plugins/zxbox
|
|
|
|
ZXBOX_OBJDIR = $(BUILDDIR)/apps/plugins/zxbox
|
|
|
|
|
|
|
|
ZXBOX_SRC := $(call preprocess, $(ZXBOX_SRCDIR)/SOURCES)
|
|
|
|
ZXBOX_OBJ := $(call c2obj, $(ZXBOX_SRC))
|
|
|
|
|
|
|
|
OTHER_SRC += $(ZXBOX_SRC)
|
|
|
|
|
2010-07-10 13:49:49 +00:00
|
|
|
ifndef APP_TYPE
|
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 += $(ZXBOX_OBJDIR)/zxbox.ovl
|
2009-03-02 00:16:44 +00:00
|
|
|
ZXBOX_OUTLDS = $(ZXBOX_OBJDIR)/zxbox.link
|
|
|
|
ZXBOX_LDFLAGS = -T$(ZXBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
|
2008-11-20 11:27:31 +00:00
|
|
|
else
|
|
|
|
### all other targets
|
|
|
|
ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
### simulator
|
|
|
|
ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock
|
|
|
|
endif
|
|
|
|
|
2010-05-07 20:11:14 +00:00
|
|
|
ZXBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O3 -funroll-loops -fno-strict-aliasing
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 00:16:44 +00:00
|
|
|
$(ZXBOX_OBJDIR)/zxbox.rock: $(ZXBOX_OBJ)
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 00:16:44 +00:00
|
|
|
$(ZXBOX_OBJDIR)/zxbox.refmap: $(ZXBOX_OBJ)
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 00:16:44 +00:00
|
|
|
$(ZXBOX_OUTLDS): $(PLUGIN_LDS) $(ZXBOX_OBJDIR)/zxbox.refmap
|
|
|
|
$(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
|
|
|
|
$(TOOLSDIR)/ovl_offset.pl $(ZXBOX_OBJDIR)/zxbox.refmap))
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2009-03-02 00:16:44 +00:00
|
|
|
$(ZXBOX_OBJDIR)/zxbox.ovl: $(ZXBOX_OBJ) $(ZXBOX_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 $(ZXBOX_LDFLAGS)
|
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 zxbox with extra flags
|
2010-01-17 13:03:10 +00:00
|
|
|
$(ZXBOX_OBJDIR)/%.o: $(ZXBOX_SRCDIR)/%.c $(ZXBOX_SRCDIR)/zxbox.make
|
2008-11-20 11:27:31 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
|
|
|
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(ZXBOXFLAGS) -c $< -o $@
|