aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/GuiLua/build.lua
blob: 3fcfffbbe794aa9d50d1bf5603015becf061f343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)