summaryrefslogtreecommitdiffstats
path: root/apps/plugins/imageviewer/imageviewer.make
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-11-21 13:47:56 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-11-21 13:47:56 +0000
commite5b1a7d4237a9006b6c49c9c1c13b292ca4ecf7c (patch)
treef0b9dd1cba0a4ee70afd8b6da64a05286f76c380 /apps/plugins/imageviewer/imageviewer.make
parenteef21cb18ae4bc7cdf83830554a848e0c733a73d (diff)
downloadrockbox-e5b1a7d4237a9006b6c49c9c1c13b292ca4ecf7c.tar.gz
rockbox-e5b1a7d4237a9006b6c49c9c1c13b292ca4ecf7c.tar.bz2
rockbox-e5b1a7d4237a9006b6c49c9c1c13b292ca4ecf7c.zip
FS#6321: Universal Image Viewer
This unifies jpeg viewer, png viewer, and bmp viewer to one plugin, image viewer, so that you can navigate through different image formats. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28626 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/imageviewer/imageviewer.make')
-rw-r--r--apps/plugins/imageviewer/imageviewer.make45
1 files changed, 44 insertions, 1 deletions
diff --git a/apps/plugins/imageviewer/imageviewer.make b/apps/plugins/imageviewer/imageviewer.make
index 76af8d24e5..d06bbfd571 100644
--- a/apps/plugins/imageviewer/imageviewer.make
+++ b/apps/plugins/imageviewer/imageviewer.make
@@ -10,7 +10,50 @@
IMGVSRCDIR := $(APPSDIR)/plugins/imageviewer
IMGVBUILDDIR := $(BUILDDIR)/apps/plugins/imageviewer
-# include actual viewer's make file
+ROCKS += $(IMGVBUILDDIR)/imageviewer.rock
+
+IMGV_SRC := $(call preprocess, $(IMGVSRCDIR)/SOURCES)
+IMGV_OBJ := $(call c2obj, $(IMGV_SRC))
+
+# add source files to OTHER_SRC to get automatic dependencies
+OTHER_SRC += $(IMGV_SRC)
+
+$(IMGVBUILDDIR)/imageviewer.rock: $(IMGV_OBJ)
+
+IMGDECFLAGS = $(PLUGINFLAGS) -DIMGDEC
+
+# include decoder's make from each subdir
IMGVSUBDIRS := $(call preprocess, $(IMGVSRCDIR)/SUBDIRS)
$(foreach dir,$(IMGVSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make))
+IMGDECLDFLAGS = -T$(PLUGINLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(IMGVBUILDDIR)/$*.refmap
+
+ifndef APP_TYPE
+ IMGDEC_OUTLDS = $(IMGVBUILDDIR)/%.link
+ IMGDEC_OVLFLAGS = -T$(IMGVBUILDDIR)/$*.link -Wl,--gc-sections -Wl,-Map,$(IMGVBUILDDIR)/$*.map
+else
+ IMGDEC_OVLFLAGS = $(PLUGINLDFLAGS)
+endif
+
+$(IMGVBUILDDIR)/%.ovl: $(IMGDEC_OUTLDS)
+ $(call PRINTS,LD $(@F))$(CC) $(IMGDECFLAGS) -o $(IMGVBUILDDIR)/$*.elf \
+ $(filter-out $(PLUGIN_CRT0),$(filter %.o, $^)) \
+ $(filter %.a, $+) \
+ -lgcc $(IMGDEC_OVLFLAGS)
+ifdef APP_TYPE
+ $(SILENT)cp $(IMGVBUILDDIR)/$*.elf $@
+else
+ $(SILENT)$(OC) -O binary $(IMGVBUILDDIR)/$*.elf $@
+endif
+
+# rule to create reference map for image decoder
+$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGINLIB) $(PLUGINBITMAPLIB)
+ $(call PRINTS,LD $(@F))$(CC) $(IMGDECFLAGS) -o /dev/null \
+ $(filter %.o, $^) \
+ $(filter %.a, $+) \
+ -lgcc $(IMGDECLDFLAGS)
+
+$(IMGVBUILDDIR)/%.link: $(PLUGIN_LDS) $(IMGVBUILDDIR)/%.refmap
+ $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DIMGVDECODER_OFFSET=$(shell \
+ $(TOOLSDIR)/ovl_offset.pl $(IMGVBUILDDIR)/$*.refmap))
+