2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 LUA_SRCDIR
:= $(APPSDIR
)/plugins
/lua
11 LUA_BUILDDIR
:= $(BUILDDIR
)/apps
/plugins
/lua
13 LUA_SRC
:= $(call preprocess
, $(LUA_SRCDIR
)/SOURCES
)
14 LUA_OBJ
:= $(call c2obj
, $(LUA_SRC
))
16 OTHER_SRC
+= $(LUA_SRC
)
19 ifneq (,$(strip $(foreach tgt
,RECORDER ONDIO
,$(findstring $(tgt
),$(TARGET
)))))
21 ROCKS
+= $(LUA_BUILDDIR
)/lua.ovl
22 LUA_OUTLDS
= $(LUA_BUILDDIR
)/lua.link
23 LUA_OVLFLAGS
= -T
$(LUA_OUTLDS
) -Wl
,--gc-sections
-Wl
,-Map
,$(basename $@
).map
26 ROCKS
+= $(LUA_BUILDDIR
)/lua.rock
30 ROCKS
+= $(LUA_BUILDDIR
)/lua.rock
33 $(LUA_BUILDDIR
)/lua.rock
: $(LUA_OBJ
) $(LUA_BUILDDIR
)/actions.lua
$(LUA_BUILDDIR
)/buttons.lua
$(LUA_BUILDDIR
)/rocklib_aux.o
35 $(LUA_BUILDDIR
)/actions.lua
: $(LUA_OBJ
)
36 $(call PRINTS
,GEN
$(@F
))$(CC
) $(INCLUDES
) -E
$(APPSDIR
)/action.h |
$(LUA_SRCDIR
)/action_helper.pl
> $(LUA_BUILDDIR
)/actions.lua
38 $(LUA_BUILDDIR
)/buttons.lua
: $(LUA_OBJ
)
39 $(SILENT
)$(CC
) $(INCLUDES
) -dM
-E
-include button-target.h
- < /dev
/null |
$(LUA_SRCDIR
)/button_helper.pl |
$(HOSTCC
) -fno-builtin
$(INCLUDES
) -x c
-o
$(LUA_BUILDDIR
)/button_helper
-
40 $(call PRINTS
,GEN
$(@F
))$(LUA_BUILDDIR
)/button_helper
> $(LUA_BUILDDIR
)/buttons.lua
42 $(LUA_BUILDDIR
)/rocklib_aux.c
: $(APPSDIR
)/plugin.h
$(LUA_OBJ
)
43 $(call PRINTS
,GEN
$(@F
))$(CC
) $(CFLAGS
) $(INCLUDES
) -E
-include plugin.h
- < /dev
/null |
$(LUA_SRCDIR
)/rocklib_aux.pl
$(LUA_SRCDIR
) > $(LUA_BUILDDIR
)/rocklib_aux.c
45 $(LUA_BUILDDIR
)/rocklib_aux.o
: $(LUA_BUILDDIR
)/rocklib_aux.c
46 $(call PRINTS
,CC
$(<F
))$(CC
) $(INCLUDES
) -DPLUGIN
-I
$(LUA_SRCDIR
) $(CFLAGS
) -c
$< -o
$@
48 $(LUA_BUILDDIR
)/lua.refmap
: $(LUA_OBJ
)
50 $(LUA_OUTLDS
): $(PLUGIN_LDS
) $(LUA_BUILDDIR
)/lua.refmap
51 $(call PRINTS
,PP
$(@F
))$(call preprocess2file
,$<,$@
,-DOVERLAY_OFFSET
=$(shell \
52 $(TOOLSDIR
)/ovl_offset.pl
$(LUA_BUILDDIR
)/lua.refmap
))
54 $(LUA_BUILDDIR
)/lua.ovl
: $(LUA_OBJ
) $(LUA_OUTLDS
)
55 $(SILENT
)$(CC
) $(PLUGINFLAGS
) -o
$(basename $@
).elf \
59 $(call PRINTS
,LD
$(@F
))$(OC
) -O binary
$(basename $@
).elf
$@