From c501a8c75e6fce2e91d52f60a5454de5aa3ef8f1 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 20 Apr 2014 15:24:46 +1000 Subject: Convert build shell scripts to Lua, with common infrastructure. --- ClientHamr/GuiLua/build.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 ClientHamr/GuiLua/build.lua (limited to 'ClientHamr/GuiLua/build.lua') 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 @@ +#!/usr/bin/env lua + +local dir = ... + +if 'nil' == type(dir) then + local build, err = loadfile('../../build.lua') + if build then + setfenv(build, getfenv(2)) + build('') + else + print("ERROR - " .. err) + end + dir = readCommand('pwd') +end + +LDFLAGS = '-L ' .. dir .. ' ' .. LDFLAGS + +removeFiles(dir, {'test_c.so', 'GuiLua.o', 'libGuiLua.so', 'skang'}) + +runCommand('C modules', dir, 'gcc ' .. CFLAGS .. ' -fPIC -shared -o test_c.so test_c.c') +runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -fPIC -c GuiLua.c') +runCommand('C libraries', dir, 'gcc ' .. CFLAGS .. ' -shared -Wl,-soname,libGuiLua.so -o libGuiLua.so GuiLua.o') +runCommand('C apps', dir, 'gcc ' .. CFLAGS .. ' -Wl,-export-dynamic -o skang skang.c ' .. LDFLAGS .. ' -lGuiLua ' .. libs) -- cgit v1.1