diff options
author | David Walter Seikel | 2014-04-20 15:24:46 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-20 15:24:46 +1000 |
commit | c501a8c75e6fce2e91d52f60a5454de5aa3ef8f1 (patch) | |
tree | 0c6d24aef960df463c2ed6c399aa4eb535f2e66f /ClientHamr | |
parent | elm_naviframe_item_title_visible_set() was deprecated, replace it. (diff) | |
download | SledjHamr-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 'ClientHamr')
-rwxr-xr-x | ClientHamr/GuiLua/build.lua | 23 | ||||
-rwxr-xr-x | ClientHamr/GuiLua/build.sh | 26 | ||||
-rwxr-xr-x | ClientHamr/extantz/build.lua | 26 | ||||
-rwxr-xr-x | ClientHamr/extantz/build.sh | 29 |
4 files changed, 49 insertions, 55 deletions
diff --git a/ClientHamr/GuiLua/build.lua b/ClientHamr/GuiLua/build.lua new file mode 100755 index 0000000..3fcfffb --- /dev/null +++ b/ClientHamr/GuiLua/build.lua | |||
@@ -0,0 +1,23 @@ | |||
1 | #!/usr/bin/env lua | ||
2 | |||
3 | local dir = ... | ||
4 | |||
5 | if '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') | ||
14 | end | ||
15 | |||
16 | LDFLAGS = '-L ' .. dir .. ' ' .. LDFLAGS | ||
17 | |||
18 | removeFiles(dir, {'test_c.so', 'GuiLua.o', 'libGuiLua.so', 'skang'}) | ||
19 | |||
20 | runCommand('C modules', dir, 'gcc ' .. CFLAGS .. ' -fPIC -shared -o test_c.so test_c.c') | ||
21 | runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -fPIC -c GuiLua.c') | ||
22 | runCommand('C libraries', dir, 'gcc ' .. CFLAGS .. ' -shared -Wl,-soname,libGuiLua.so -o libGuiLua.so GuiLua.o') | ||
23 | runCommand('C apps', dir, 'gcc ' .. CFLAGS .. ' -Wl,-export-dynamic -o skang skang.c ' .. LDFLAGS .. ' -lGuiLua ' .. libs) | ||
diff --git a/ClientHamr/GuiLua/build.sh b/ClientHamr/GuiLua/build.sh deleted file mode 100755 index c405bb2..0000000 --- a/ClientHamr/GuiLua/build.sh +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | #! /bin/bash | ||
2 | |||
3 | export LOCALDIR=`pwd` | ||
4 | |||
5 | # No need for a make file, or dependencies, the entire thing takes only a few seconds to build. | ||
6 | |||
7 | CFLAGS="-g -Wall -I include -I $LOCALDIR" | ||
8 | CFLAGS="$CFLAGS -I ../../libraries" | ||
9 | CFLAGS="$CFLAGS $(pkg-config --cflags luajit)" | ||
10 | CFLAGS="$CFLAGS $(pkg-config --cflags elementary)" | ||
11 | CFLAGS="$CFLAGS -DPACKAGE_BIN_DIR=\"$LOCALDIR\"" | ||
12 | CFLAGS="$CFLAGS -DPACKAGE_LIB_DIR=\"$LOCALDIR\"" | ||
13 | CFLAGS="$CFLAGS -DPACKAGE_DATA_DIR=\"$LOCALDIR\" $CFLAGOPTS" | ||
14 | |||
15 | LDFLAGS="-L $LOCALDIR $(pkg-config --libs-only-L luajit) -L lib -L /usr/lib -L /lib" | ||
16 | libs="$(pkg-config --cflags --libs elementary) $(pkg-config --libs luajit) -lpthread -lm -ldl" | ||
17 | |||
18 | echo "clean" | ||
19 | rm -f test_c.so GuiLua.o libGuiLua.so skang | ||
20 | echo "C modules" | ||
21 | gcc $CFLAGS -fPIC -shared -o test_c.so test_c.c | ||
22 | gcc $CFLAGS -fPIC -c GuiLua.c | ||
23 | echo "C libraries" | ||
24 | gcc $CFLAGS -shared -Wl,-soname,libGuiLua.so -o libGuiLua.so GuiLua.o | ||
25 | echo "C apps" | ||
26 | gcc $CFLAGS -Wl,-export-dynamic -o skang skang.c $LDFLAGS -lGuiLua $libs | ||
diff --git a/ClientHamr/extantz/build.lua b/ClientHamr/extantz/build.lua new file mode 100755 index 0000000..d53449e --- /dev/null +++ b/ClientHamr/extantz/build.lua | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/usr/bin/env lua | ||
2 | |||
3 | local dir = ... | ||
4 | |||
5 | if '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') | ||
14 | end | ||
15 | |||
16 | CFLAGS = CFLAGS .. ' -I../../libraries/irrlicht-1.8.1/include -I/usr/X11R6/include' | ||
17 | LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux' | ||
18 | libs = libs .. ' -lIrrlicht -lGL -lbz2' | ||
19 | |||
20 | removeFiles(dir, {'extantz', 'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', 'extantz.edj'}) | ||
21 | |||
22 | runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' extantz.edc extantz.edj') | ||
23 | runCommand('Irrlicht files', dir, 'g++ ' .. CFLAGS .. ' -O3 -ffast-math -c crappisspuke.cpp -o crappisspuke.o ' .. LDFLAGS) | ||
24 | runCommand(nil, dir, 'g++ ' .. CFLAGS .. ' -O3 -ffast-math -c CDemo.cpp -o CDemo.o ' .. LDFLAGS) | ||
25 | runCommand('extantz', dir, 'g++ ' .. CFLAGS .. ' -O3 -ffast-math -c extantzCamera.cpp -o extantzCamera.o ' .. LDFLAGS) | ||
26 | runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' extantz.c crappisspuke.o CDemo.o extantzCamera.o -o extantz ' .. LDFLAGS .. ' ' .. libs .. ' && strip extantz') | ||
diff --git a/ClientHamr/extantz/build.sh b/ClientHamr/extantz/build.sh deleted file mode 100755 index d3ad3b0..0000000 --- a/ClientHamr/extantz/build.sh +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | #! /bin/bash | ||
2 | |||
3 | export LOCALDIR=`pwd` | ||
4 | |||
5 | # No need for a make file, or dependencies, the entire thing takes only a few seconds to build. | ||
6 | |||
7 | CFLAGS="-g -Wall -I include -I $LOCALDIR" | ||
8 | CFLAGS="$CFLAGS -I ../../libraries -I../../libraries/irrlicht-1.8.1/include -I/usr/X11R6/include" | ||
9 | CFLAGS="$CFLAGS $(pkg-config --cflags luajit)" | ||
10 | CFLAGS="$CFLAGS $(pkg-config --cflags elementary)" | ||
11 | CFLAGS="$CFLAGS $(pkg-config --cflags ephysics)" | ||
12 | CFLAGS="$CFLAGS -DPACKAGE_BIN_DIR=\"$LOCALDIR\"" | ||
13 | CFLAGS="$CFLAGS -DPACKAGE_LIB_DIR=\"$LOCALDIR\"" | ||
14 | CFLAGS="$CFLAGS -DPACKAGE_DATA_DIR=\"$LOCALDIR\" $CFLAGOPTS" | ||
15 | |||
16 | LDFLAGS="-L $LOCALDIR $(pkg-config --libs-only-L luajit) -L lib -L /usr/lib -L /lib -L../../libraries/irrlicht-1.8.1/lib/Linux " | ||
17 | libs="$(pkg-config --cflags --libs elementary) $(pkg-config --libs luajit) -lpthread -lm -ldl -lIrrlicht -lGL -lbz2" | ||
18 | |||
19 | echo "clean" | ||
20 | rm -f extantz crappisspuke.o CDemo.o extantzCamera.o extantz.edj | ||
21 | echo "edje" | ||
22 | edje_cc -id images extantz.edc extantz.edj | ||
23 | echo "Irrlicht" | ||
24 | #g++ -O3 -ffast-math crappisspuke.cpp -o crappisspuke -I../../libraries/irrlicht-1.8/include -I/usr/X11R6/include -L../../libraries/irrlicht-1.8/lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor && ./crappisspuke | ||
25 | g++ $CFLAGS -O3 -ffast-math -c crappisspuke.cpp -o crappisspuke.o $LDFLAGS | ||
26 | g++ $CFLAGS -O3 -ffast-math -c CDemo.cpp -o CDemo.o $LDFLAGS | ||
27 | echo "extantz" | ||
28 | g++ $CFLAGS -O3 -ffast-math -c extantzCamera.cpp -o extantzCamera.o $LDFLAGS | ||
29 | gcc $CFLAGS extantz.c crappisspuke.o CDemo.o extantzCamera.o -o extantz $LDFLAGS $libs && strip extantz | ||