aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/purkle/build.lua
blob: baa70ae4f7939a607c8aac99c9b8a8070f09189d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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(2)
  else
    print("ERROR - " .. err)
  end
  dir = workingDir
end

CFLAGS  = CFLAGS  .. ' -I../GuiLua'
LDFLAGS = '-L ' .. dir .. ' ' .. LDFLAGS
libs    = libs    .. ' -lGuiLua'

removeFiles(dir, {lib_d .. '/purkle.so'})

runCommand('C modules',		dir, 'gcc ' .. CFLAGS .. ' -fPIC -shared -o ' .. lib_d .. '/purkle.so purkle.c')