-
Notifications
You must be signed in to change notification settings - Fork 0
/
remake.sh
62 lines (51 loc) · 1.48 KB
/
remake.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#this script is used to create a Makefile
# configuration
DEBUG='-DDEBUG'
# Environment discovering
# Hardcode test Lua version
# Development purpose only or if pkg-config doesn't work
#
# LUA_DIR=/home/laurent/Projets/lua-5.3.4/install
# LUA="-isystem $LUA_DIR/include"
# LUALIB="-L$LUA_DIR/lib"
#
# If used, uncomment the lines above and comment out system's Lua
# detection bellow.
VERLUA=$( lua -v 2>&1 | grep -o -E '[0-9]\.[0-9]' )
echo -n "Lua's version :" $VERLUA
if pkg-config --cflags lua$VERLUA > /dev/null 2>&1; then
echo " (Packaged)"
LUA="\$(shell pkg-config --cflags lua$VERLUA )"
LUALIB="\$(shell pkg-config --libs lua$VERLUA )"
elif pkg-config --cflags lua > /dev/null 2>&1; then
echo " (unpackaged)"
LUA="\$(shell pkg-config --cflags lua )"
LUALIB="\$(shell pkg-config --libs lua )"
else
echo " - No package found"
echo "Workaround : edit this remake file to hardcode where Lua is installed."
echo
exit 1
fi
echo -n "Selene : "
if [ -f /usr/local/lib/libSelene.so.2 ]; then
echo "System installation"
SELDIR=/usr/local
SELLIB='-lSelene'
elif [ -d ~/Projets/Selene.v7 ]; then
echo "**DEV**DEV** V7"
SELDIR=~/Projets/Selene.v7
SELLIB='-l:libSelene.so.2'
else
echo "**DEV**DEV**"
SELDIR=~/Projets/Selene
SELLIB='-l:libSelene.so.2'
fi
echo
echo "----------------"
echo
cd src
LFMakeMaker -v +f=Makefile -cc="g++" --opts="-Wall -O2 ${DEBUG} -lpthread -lpaho-mqtt3c -ldl \
${LUA} ${LUALIB} \
-I$SELDIR/include -L$SELDIR/lib $SELLIB" *.cpp -t=../Majordome > Makefile