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
|
|
|
#
|
|
|
|
|
2010-01-18 12:46:19 +00:00
|
|
|
IMGVSRCDIR := $(APPSDIR)/plugins/imageviewer
|
|
|
|
IMGVBUILDDIR := $(BUILDDIR)/apps/plugins/imageviewer
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2010-11-21 13:47:56 +00:00
|
|
|
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
|
2010-01-18 12:46:19 +00:00
|
|
|
IMGVSUBDIRS := $(call preprocess, $(IMGVSRCDIR)/SUBDIRS)
|
|
|
|
$(foreach dir,$(IMGVSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make))
|
2008-11-20 11:27:31 +00:00
|
|
|
|
2010-11-21 13:47:56 +00:00
|
|
|
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
|
2012-01-17 14:08:08 +00:00
|
|
|
IMGDEC_OVLFLAGS = $(PLUGINLDFLAGS) -Wl,-Map,$(IMGVBUILDDIR)/$*.map
|
2010-11-21 13:47:56 +00:00
|
|
|
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)
|
2012-04-04 19:43:22 +00:00
|
|
|
$(SILENT)$(call objcopy,$(IMGVBUILDDIR)/$*.elf,$@)
|
2010-11-21 13:47:56 +00:00
|
|
|
|
|
|
|
# rule to create reference map for image decoder
|
2012-03-26 20:24:57 +00:00
|
|
|
$(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGIN_LIBS)
|
2010-11-21 13:47:56 +00:00
|
|
|
$(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))
|
|
|
|
|