aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-20 15:24:46 +1000
committerDavid Walter Seikel2014-04-20 15:24:46 +1000
commitc501a8c75e6fce2e91d52f60a5454de5aa3ef8f1 (patch)
tree0c6d24aef960df463c2ed6c399aa4eb535f2e66f /LuaSL
parentelm_naviframe_item_title_visible_set() was deprecated, replace it. (diff)
downloadSledjHamr-c501a8c75e6fce2e91d52f60a5454de5aa3ef8f1.zip
SledjHamr-c501a8c75e6fce2e91d52f60a5454de5aa3ef8f1.tar.gz
SledjHamr-c501a8c75e6fce2e91d52f60a5454de5aa3ef8f1.tar.bz2
SledjHamr-c501a8c75e6fce2e91d52f60a5454de5aa3ef8f1.tar.xz
Convert build shell scripts to Lua, with common infrastructure.
Diffstat (limited to 'LuaSL')
-rwxr-xr-xLuaSL/build.lua25
-rwxr-xr-xLuaSL/build.sh69
2 files changed, 25 insertions, 69 deletions
diff --git a/LuaSL/build.lua b/LuaSL/build.lua
new file mode 100755
index 0000000..ea2151d
--- /dev/null
+++ b/LuaSL/build.lua
@@ -0,0 +1,25 @@
1#!/usr/bin/env lua
2
3local dir = ...
4
5if 'nil' == type(dir) then
6 local build, err = loadfile('../build.lua')
7 if build then
8 setfenv(build, getfenv(2))
9 build('')
10 else
11 print("ERROR - " .. err)
12 end
13 dir = readCommand('pwd')
14end
15
16dir = dir .. '/src'
17
18removeFiles(dir, {'../LuaSL', '*.o', '*.output', '*.backup', '../*.edj', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'})
19
20-- Run lemon first, flex depends on it to define the symbol values.
21runCommand('lemon', dir, '../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y')
22runCommand('flex', dir, 'flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l')
23runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' LuaSL.edc ../LuaSL.edj')
24compileFiles('../LuaSL', dir, {'LuaSL_main', 'LuaSL_compile', 'LuaSL_threads', 'LuaSL_utilities', 'LuaSL_lexer', 'LuaSL_lemon_yaccer'})
25compileFiles('../LuaSL_test', dir, {'LuaSL_test', 'LuaSL_utilities'})
diff --git a/LuaSL/build.sh b/LuaSL/build.sh
deleted file mode 100755
index 8d776d6..0000000
--- a/LuaSL/build.sh
+++ /dev/null
@@ -1,69 +0,0 @@
1#! /bin/bash
2
3export LOCALDIR=`pwd`
4
5# No need for a make file, or dependencies, the entire thing takes only a few seconds to build.
6
7CFLAGS="-g -Wall -Wunreachable-code -I include -I $LOCALDIR"
8CFLAGS="$CFLAGS -I ../../libraries"
9CFLAGS="$CFLAGS $(pkg-config --cflags luajit)"
10CFLAGS="$CFLAGS $(pkg-config --cflags eo)"
11CFLAGS="$CFLAGS $(pkg-config --cflags eet)"
12CFLAGS="$CFLAGS $(pkg-config --cflags ecore-con)"
13CFLAGS="$CFLAGS $(pkg-config --cflags ecore-evas)"
14CFLAGS="$CFLAGS $(pkg-config --cflags ecore-file)"
15CFLAGS="$CFLAGS $(pkg-config --cflags edje)"
16CFLAGS="$CFLAGS -DPACKAGE_BIN_DIR=\"$LOCALDIR\""
17CFLAGS="$CFLAGS -DPACKAGE_LIB_DIR=\"$LOCALDIR\""
18CFLAGS="$CFLAGS -DPACKAGE_DATA_DIR=\"$LOCALDIR\" $CFLAGOPTS"
19
20LDFLAGS="$(pkg-config --libs-only-L luajit) -L lib -L /usr/lib -L /lib"
21libs="$(pkg-config --libs edje) $libs $(pkg-config --libs luajit)"
22
23LFLAGS="-d"
24EDJE_FLAGS="-id images -fd fonts"
25# Dunno why I needed this, not gonna work with a packaged LuaJIT anyway.
26#LD_RUN_PATH="../../libraries/LuaJIT-2.0.2/src:"
27
28cd src
29echo "clean"
30rm -f ../LuaSL *.o *.output *.backup ../luac.out ../*.edj LuaSL_lexer.h LuaSL_lexer.c LuaSL_lemon_yaccer.h LuaSL_lemon_yaccer.c LuaSL_lemon_yaccer.out
31
32# Run lemon first, flex depends on it to define the symbol values.
33command="../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y"
34echo "lemon"
35$command
36
37command="flex -C --outfile=LuaSL_lexer.c --header-file=LuaSL_lexer.h LuaSL_lexer.l"
38echo "flex"
39$command
40
41command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj"
42echo "edje_cc"
43$command
44
45names="LuaSL_main LuaSL_compile LuaSL_threads LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer"
46objects=""
47for i in $names
48do
49 command="gcc $CFLAGS -c -o $i.o $i.c"
50 echo $i
51 $command
52 objects="$objects $i.o"
53done
54command="gcc $CFLAGS -o ../LuaSL $objects $LDFLAGS $libs"
55echo "LuaSL"
56$command
57
58names="LuaSL_test LuaSL_utilities"
59objects=""
60for i in $names
61do
62 command="gcc $CFLAGS -c -o $i.o $i.c"
63 echo $i
64 $command
65 objects="$objects $i.o"
66done
67command="gcc $CFLAGS -o ../LuaSL_test $objects $LDFLAGS $libs"
68echo "LuaSL_test"
69$command