summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/lua.make
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/lua.make')
-rw-r--r--apps/plugins/lua/lua.make46
1 files changed, 46 insertions, 0 deletions
diff --git a/apps/plugins/lua/lua.make b/apps/plugins/lua/lua.make
new file mode 100644
index 0000000000..6688f2d3d8
--- /dev/null
+++ b/apps/plugins/lua/lua.make
@@ -0,0 +1,46 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10LUA_SRCDIR := $(APPSDIR)/plugins/lua
11LUA_BUILDDIR := $(BUILDDIR)/apps/plugins/lua
12
13LUA_SRC := $(call preprocess, $(LUA_SRCDIR)/SOURCES)
14LUA_OBJ := $(call c2obj, $(LUA_SRC))
15
16OTHER_SRC += $(LUA_SRC)
17
18ifndef SIMVER
19ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
20 ### lowmem targets
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
24else
25 ### all other targets
26 ROCKS += $(LUA_BUILDDIR)/lua.rock
27endif
28else
29 ### simulator
30 ROCKS += $(LUA_BUILDDIR)/lua.rock
31endif
32
33$(LUA_BUILDDIR)/lua.rock: $(LUA_OBJ)
34
35$(LUA_BUILDDIR)/lua.refmap: $(LUA_OBJ)
36
37$(LUA_OUTLDS): $(PLUGIN_LDS) $(LUA_BUILDDIR)/lua.refmap
38 $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
39 $(TOOLSDIR)/ovl_offset.pl $(LUA_BUILDDIR)/lua.refmap))
40
41$(LUA_BUILDDIR)/lua.ovl: $(LUA_OBJ) $(LUA_OUTLDS)
42 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
43 $(filter %.o, $^) \
44 $(filter %.a, $+) \
45 -lgcc $(LUA_OVLFLAGS)
46 $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@