e3fc65cfff
* apps.make: depends on ctype.o instead of errno.o to depend on config-*.h so that it works for simulator. * lang.make: add dependency of lang.h to make it sure that the file is updated properly when needed. * plugins.make: object files don't depend on libpluginbitmaps.a. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24256 a1c6a512-1295-4272-9138-f99709370657
58 lines
2 KiB
Makefile
58 lines
2 KiB
Makefile
# __________ __ ___.
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
# \/ \/ \/ \/ \/
|
|
# $Id$
|
|
#
|
|
|
|
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)
|
|
|
|
ifndef SIMVER
|
|
ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
|
|
### lowmem targets
|
|
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl
|
|
CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.link
|
|
CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
|
|
else
|
|
### all other targets
|
|
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
|
|
endif
|
|
else
|
|
### simulator
|
|
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
|
|
endif
|
|
|
|
ifeq ($(CPU),sh)
|
|
# sh need to retain its' -Os
|
|
CHESSBOXFLAGS = $(PLUGINFLAGS)
|
|
else
|
|
CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
|
|
endif
|
|
|
|
$(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ)
|
|
|
|
$(CHESSBOX_OBJDIR)/chessbox.refmap: $(CHESSBOX_OBJ)
|
|
|
|
$(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))
|
|
|
|
$(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS)
|
|
$(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
|
|
$(filter %.o, $^) \
|
|
$(filter %.a, $+) \
|
|
-lgcc $(CHESSBOX_OVLFLAGS)
|
|
$(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@
|
|
|
|
# special pattern rule for compiling chessbox with extra flags
|
|
$(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(CHESSBOX_SRCDIR)/chessbox.make
|
|
$(SILENT)mkdir -p $(dir $@)
|
|
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(CHESSBOXFLAGS) -c $< -o $@
|