forked from moteus/lua-bgcrypto-sha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lakefile
50 lines (40 loc) · 1.01 KB
/
lakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
PROJECT = 'bgcrypto'
INITLAKEFILE()
DEFINES = L{
DEFINES,
'RETURN_VALUES',
'VOID_RETURN=void',
'INT_RETURN=int'
}
local SHA = {}
for _, name in ipairs{'sha1','sha224','sha256','sha384','sha512',
'sha512_128','sha512_192','sha512_224','sha512_256'}
do
local sha = c.shared{name,
base = 'src',
src = {'sha/*.c', 'l52util.c', 'l' .. name .. '.c'},
exclude = {'sha/pwd2key.c'},
needs = {LUA_NEED},
incdir = {'sha'},
defines = DEFINES,
dynamic = DYNAMIC,
strip = true,
}
target(name, sha)
table.insert(SHA, sha)
end
target('build', SHA)
local INSTALL_LIST = {
file.group{odir = J(LIBDIR, 'bgcrypto'); src = J('src', 'lua', '*'); recurse = true};
file.group{odir = TESTDIR; src = J('test', '*')};
}
for _, sha in ipairs(SHA) do
table.insert(INSTALL_LIST,
(file.group{odir = J(LIBDIR, 'bgcrypto'); src = sha })
)
end
install = target('install', INSTALL_LIST)
target('test', install, function()
run_test('utest_sha.lua')
end)
default('build')