aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/build.sh
blob: 9e5e2b7d3fac012bc8e00e86162829959837f7ce (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#! /bin/bash


export LOCALDIR=`pwd`

cd src

if [ -d "/opt/e17" ]
then
    export E17DIR="/opt/e17"
else
    export E17DIR="/usr"
fi

# No need for a make file, or dependencies, the entire thing takes only a few seconds to build.

CFLAGS="-g -Wall -I include -I $LOCALDIR/src"
CFLAGS="$CFLAGS -I $E17DIR/include/eina-1"
CFLAGS="$CFLAGS -I $E17DIR/include/eina-1/eina"
CFLAGS="$CFLAGS -I $E17DIR/include/eet-1"
CFLAGS="$CFLAGS -I $E17DIR/include/edje-1"
CFLAGS="$CFLAGS -I $E17DIR/include/evas-1"
CFLAGS="$CFLAGS -I $E17DIR/include/ecore-1"
CFLAGS="$CFLAGS -I $E17DIR/include"
CFLAGS="$CFLAGS -DPACKAGE_DATA_DIR=\"$LOCALDIR\" $CFLAGOPTS"

LDFLAGS="-L lib -L /usr/lib -L /lib -L $E17DIR/lib"
libs="-lecore -levas -ledje -leet -leina"
# These need to be added to libs if linking staticaly, though some part of EFL don't like that.
#-lecore_evas \
#-lecore_fb \
#-lecore_file \
#-lecore \
#-ledje \
#-levas \
#-lembryo \
#-leet \
#-leina \
#-llua \
#-lm \
#-ldl \
#-lglib-2.0 \
#-lpthread \
#-lfontconfig \
#-lfreetype \
#-lexpat \
#-lrt \
#-lz

names="LuaSL_main LuaSL_compile LuaSL_utilities"

EDJE_FLAGS="-id images -fd fonts"

rm -f ../LuaSL ../LuaSL_parser ../*.o *.output ../*.edj LuaSL_lexer.h LuaSL_lexer.c LuaSL_yaccer.h LuaSL_yaccer.tab.c
command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj"
echo $command
$command

objects=""
for i in $names
do
    command="gcc $CFLAGS -c -o ../$i.o $i.c"
    echo $command
    $command
    objects="$objects ../$i.o"
done

command="gcc $CFLAGS -o ../LuaSL $objects $LDFLAGS $libs"
echo $command
$command



names="LuaSL_parser LuaSL_LSL_tree LuaSL_lexer LuaSL_yaccer.tab"

command="flex --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l"
echo $command
$command

# Should add -t as well for debugging, but it causes errors.
command="btyacc -d -v -b LuaSL_yaccer -S btyacc-c.ske LuaSL_yaccer.y"
echo $command
$command

objects=""
for i in $names
do
    command="gcc $CFLAGS -c -o ../$i.o $i.c"
    echo $command
    $command
    objects="$objects ../$i.o"
done

command="gcc $CFLAGS -o ../LuaSL_parser $objects $LDFLAGS $libs"
echo $command
$command


command="flex --outfile=LuaSL_LSL_lexer.c --header-file=LuaSL_LSL_lexer.h LuaSL_LSL_lexer.l"
echo $command
$command

command="btyacc -d -b LuaSL_LSL_yaccer -S btyacc-c.ske LuaSL_LSL_yaccer.y"
echo $command
$command