-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
65 lines (52 loc) · 1.9 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
NAME="NodeMCU-Linux"
DATE=`date +%F`
DEBIAN=$(shell grep -qi 'id\s*=\s*raspbian' /etc/os-release && echo "raspbian" || echo "pure")
LUANODE=https://github.com/ignacio/LuaNode # -- original
LUANODE=https://github.com/Spiritdude/LuaNode # -- surely works with small patch
all::
@echo "make requirements install deinstall backup"
requirements:: lua luanode lua_modules luaffi
lua::
sudo apt -y install luajit lua5.1 luarocks lua5.1-dev
libssl::
ifeq (${DEBIAN},raspbian)
sudo apt -y install libssl1.0-dev
else
sudo apt -y install libssl-dev
endif
luanode: libssl
sudo apt -y install cmake libboost-dev libboost-system-dev libboost-date-time-dev libboost-thread-dev
rm -rf LuaNode
git clone ${LUANODE}
cd LuaNode/build; cmake ..; make
sudo cp LuaNode/build/luanode /usr/bin/
rm -rf LuaNode
lua_modules::
sudo luarocks install luafilesystem
sudo luarocks install lua-periphery
sudo luarocks install luasocket
sudo luarocks install luabitop
sudo luarocks install lua-struct
sudo luarocks install lunajson
sudo luarocks install luaunit
luaffi::
sudo rm -rf luaffifb
git clone https://github.com/facebook/luaffifb
cd luaffifb; sudo luarocks make
sudo rm -rf luaffifb
install::
install nodemcu /usr/local/bin/nodemcu
mkdir -p /usr/local/lib/nodemcu
tar cf - modules misc | (cd /usr/local/lib/nodemcu/ && tar xf -)
deinstall::
sudo rm -rf /usr/local/bin/nodemcu /usr/local/lib/nodemcu/
sudo rm -f /usr/bin/luanode
# -- developer only
backup::
cd ..; tar cfz ${NAME}-${DATE}.tar.gz '--exclude=fw/*' ${NAME}; scp ${NAME}-${DATE}.tar.gz backup:Backup/; mv ${NAME}-${DATE}.tar.gz ~/Backup/;
dist::
cd ..; rsync -avP ${NAME} "--exclude=fw/*" "--exclude=LuaNode/*" opl1:Projects
cd ..; rsync -avP ${NAME} "--exclude=fw/*" "--exclude=LuaNode/*" npn1:Projects
cd ..; rsync -avP ${NAME} "--exclude=fw/*" "--exclude=LuaNode/*" opz1:Projects
edit::
dee4 nodemcu *.lua modules/*/*.lua Makefile README.md