-
Notifications
You must be signed in to change notification settings - Fork 2
/
mklfs.sh
executable file
·46 lines (37 loc) · 1001 Bytes
/
mklfs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -e -u
[ -d firm ] || {
echo "./firm should be a symbolic link to the nodemcu firmware"
exit 1
}
[ -d core ] || {
echo "./core should be a checkout of nwf's core modules"
exit 1
}
SOURCES=(
*.lua
core/_external/lcd1602.lua
firm/lua_modules/fifo/fifo.lua
firm/lua_modules/fifo/fifosock.lua
core/net/{nwfmqtt,nwfnet*}.lua
core/telnetd/telnetd{,-{diag,file}}.lua
core/util/compileall.lua
core/util/diag.lua
core/util/lfs-strings.lua
)
rm -rf _lfs_build
mkdir _lfs_build
# for i in ${SOURCES[@]}; do
# lua5.1 -e "package.path=package.path..';core/_external/luasrcdiet/?.lua'" \
# core/_external/luasrcdiet/bin/luasrcdiet $i -o _lfs_build/`basename $i` --quiet
# done
cp ${SOURCES[@]} _lfs_build/
if [ -z "${LUACROSS:-}" ]; then
LUACROSS=$(readlink -f $(dirname $0)/luac.cross)
fi
if ! [ -x "${LUACROSS}" ]; then
echo "Need cross compiler! Tried non-existant ${LUACROSS}."
exit 1
fi
(cd _lfs_build; $LUACROSS -f *.lua)
# ls -l _lfs_build/luac.out