summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/chessbox.make
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-03-02 00:16:44 +0000
committerJens Arnold <amiconn@rockbox.org>2009-03-02 00:16:44 +0000
commitc21e2e686fce7a7df5a933fd3bf06aa20e66c78b (patch)
tree483500a54064c878fd12196ca7fd1fad1177c064 /apps/plugins/chessbox/chessbox.make
parentce1c189d509b1b88044f9821fa36f2461af07219 (diff)
downloadrockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.zip
rockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.tar.gz
rockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.tar.bz2
rockbox-c21e2e686fce7a7df5a933fd3bf06aa20e66c78b.tar.xz
Calculate the optimal memory location for overlay plugins, and use plugin.lds for linking them. This gets rid of hand-adjusted archos.lds, making it easy to use overlay plugins on other lowmem targets. * Fix some duplicate and incorrect dependencies. * Change the way libs are filtered, so that a lib can be specified more than once. This allows to get rid of explicitly linking gcc-support.o, fixing empty plugins on some simulator platforms.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20163 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chessbox/chessbox.make')
-rw-r--r--apps/plugins/chessbox/chessbox.make22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/plugins/chessbox/chessbox.make b/apps/plugins/chessbox/chessbox.make
index 220f083..43df3ab 100644
--- a/apps/plugins/chessbox/chessbox.make
+++ b/apps/plugins/chessbox/chessbox.make
@@ -17,20 +17,17 @@ OTHER_SRC += $(CHESSBOX_SRC)
ifndef SIMVER
ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
- ## archos recorder targets
- CHESSBOX_INLDS := $(CHESSBOX_SRCDIR)/archos.lds
+ ### 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
- CHESSBOX_INLDS := $(APPSDIR)/plugins/plugin.lds
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
endif
- CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
- CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.lds
else
### simulator
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
- CHESSBOX_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile
endif
ifeq ($(CPU),sh)
@@ -40,15 +37,18 @@ else
CHESSBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
endif
-$(CHESSBOX_OUTLDS): $(CHESSBOX_INLDS) $(CHESSBOX_OBJ)
- $(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@)
+$(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ)
+
+$(CHESSBOX_OBJDIR)/chessbox.refmap: $(CHESSBOX_OBJ)
-$(CHESSBOX_OBJDIR)/chessbox.rock: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(PLUGINBITMAPLIB)
+$(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) $(PLUGINBITMAPLIB)
+$(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS)
$(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
$(filter %.o, $^) \
- $(filter %.a, $^) \
+ $(filter %.a, $+) \
-lgcc $(CHESSBOX_OVLFLAGS)
$(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@