singe/thirdparty/librs232/lakefile
2023-10-23 19:38:18 -05:00

40 lines
1 KiB
Text

PROJECT = 'rs232'
INITLAKEFILE()
DEFINES = L{DEFINES, 'RS232_EXPORT'}
luars232 = c.shared{'core',
src = {
J('src', 'rs232.c'),
J('src', IF(WINDOWS, 'rs232_windows.c', 'rs232_posix.c')),
J('bindings', 'lua', 'luars232.c'),
},
incdir = 'include',
needs = LUA_NEED,
defines = DEFINES,
dynamic = DYNAMIC,
strip = true,
}
target('build', luars232)
install = target('install', {
file.group{odir=J(LIBDIR, 'rs232'); src = luars232 };
file.group{odir=LIBDIR; src = J('bindings', 'lua', 'rs232.lua'), recurse = true };
file.group{odir=TESTDIR; src = J('bindings', 'lua', 'test'), recurse = true };
})
target('test', install, function()
if spawn(J(TESTDIR, 'testsrv.lua'), TESTDIR) then
run_test(TESTDIR, J(TESTDIR, 'utestcli.lua'))
end
if spawn(J(TESTDIR, 'testsrv_rs232.lua'), TESTDIR) then
run_test(TESTDIR, J(TESTDIR, 'utestcli_rs232.lua'))
end
if not test_summary() then
quit("test fail")
end
end)