2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 PICTUREFLOW_SRCDIR
= $(APPSDIR
)/plugins
/pictureflow
11 PICTUREFLOW_OBJDIR
= $(BUILDDIR
)/apps
/plugins
/pictureflow
13 PICTUREFLOW_SRC
:= $(call preprocess
, $(PICTUREFLOW_SRCDIR
)/SOURCES
)
14 PICTUREFLOW_OBJ
:= $(call c2obj
, $(PICTUREFLOW_SRC
))
16 OTHER_SRC
+= $(PICTUREFLOW_SRC
)
19 ifneq (,$(strip $(foreach tgt
,RECORDER ONDIO
,$(findstring $(tgt
),$(TARGET
)))))
21 ROCKS
+= $(PICTUREFLOW_OBJDIR
)/pictureflow.ovl
22 PICTUREFLOW_OUTLDS
= $(PICTUREFLOW_OBJDIR
)/picutreflow.link
23 PICTUREFLOW_OVLFLAGS
= -T
$(PICTUREFLOW_OUTLDS
) -Wl
,--gc-sections
-Wl
,-Map
,$(basename $@
).map
26 ROCKS
+= $(PICTUREFLOW_OBJDIR
)/pictureflow.rock
30 ROCKS
+= $(PICTUREFLOW_OBJDIR
)/pictureflow.rock
34 # sh need to retain its' -Os
35 PICTUREFLOWFLAGS
= $(PLUGINFLAGS
)
37 PICTUREFLOWFLAGS
= $(filter-out -O
%,$(PLUGINFLAGS
)) -O2
40 $(PICTUREFLOW_OBJDIR
)/pictureflow.rock
: $(PICTUREFLOW_OBJ
)
42 $(PICTUREFLOW_OBJDIR
)/pictureflow.refmap
: $(PICTUREFLOW_OBJ
)
44 $(PICTUREFLOW_OUTLDS
): $(PLUGIN_LDS
) $(PICTUREFLOW_OBJDIR
)/pictureflow.refmap
45 $(call PRINTS
,PP
$(@F
))$(call preprocess2file
,$<,$@
,-DOVERLAY_OFFSET
=$(shell \
46 $(TOOLSDIR
)/ovl_offset.pl
$(PICTUREFLOW_OBJDIR
)/pictureflow.refmap
))
48 $(PICTUREFLOW_OBJDIR
)/pictureflow.ovl
: $(PICTUREFLOW_OBJ
) $(PICTUREFLOW_OUTLDS
)
49 $(SILENT
)$(CC
) $(PLUGINFLAGS
) -o
$(basename $@
).elf \
52 -lgcc
$(PICTUREFLOW_OVLFLAGS
)
53 $(call PRINTS
,LD
$(@F
))$(OC
) -O binary
$(basename $@
).elf
$@
55 # special pattern rule for compiling pictureflow with extra flags
56 $(PICTUREFLOW_OBJDIR
)/%.o
: $(PICTUREFLOW_SRCDIR
)/%.c
$(PICTUREFLOW_SRCDIR
)/pictureflow.make
57 $(SILENT
)mkdir
-p
$(dir $@
)
58 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) -I
$(dir $<) $(PICTUREFLOWFLAGS
) -c
$< -o
$@