aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/build.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-21 17:53:25 +1000
committerDavid Walter Seikel2014-04-21 17:53:25 +1000
commite9447ecc19114cee9550c7aaea89a4d3de3cfa3f (patch)
tree8f99cefa904c2ee80ac83abea394a54cf51bea0b /libraries/build.lua
parentAdded LumbrJack (logging) and Runnr (Lua function / script runner). (diff)
downloadSledjHamr-e9447ecc19114cee9550c7aaea89a4d3de3cfa3f.zip
SledjHamr-e9447ecc19114cee9550c7aaea89a4d3de3cfa3f.tar.gz
SledjHamr-e9447ecc19114cee9550c7aaea89a4d3de3cfa3f.tar.bz2
SledjHamr-e9447ecc19114cee9550c7aaea89a4d3de3cfa3f.tar.xz
Move LumbrJack and Runnr to the libraries directory, and use them from GuiLua.
Diffstat (limited to 'libraries/build.lua')
-rwxr-xr-xlibraries/build.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/libraries/build.lua b/libraries/build.lua
new file mode 100755
index 0000000..8b48b70
--- /dev/null
+++ b/libraries/build.lua
@@ -0,0 +1,24 @@
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 = workingDir
14end
15
16LDFLAGS = '-L ' .. dir .. ' ' .. LDFLAGS
17
18removeFiles(dir, {'LumbrJack.o', 'libLumbrJack.so', 'Runnr.o', 'libRunnr.so'})
19
20runCommand('C libraries', dir, 'gcc ' .. CFLAGS .. ' -fPIC -c LumbrJack.c')
21runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -shared -Wl,-soname,libLumbrJack.so -o libLumbrJack.so LumbrJack.o')
22
23runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -fPIC -c Runnr.c')
24runCommand(nil, dir, 'gcc ' .. CFLAGS .. ' -shared -Wl,-soname,libRunnr.so -o libRunnr.so Runnr.o')