ack/util/LLgen/build.lua
David Given 5e84be70fd Massive ackbuilder refactor --- cleaner and more expressive. Lists
are automatically flattened (leading to better build files), and the
list and filename functions are vastly more orthogonal.
2016-08-04 23:51:19 +02:00

44 lines
830 B
Lua

cprogram {
name = "llgen",
-- These use pre-LLgen'd versions of LLgen.c, Lpars.c and tokens.c. If
-- LLgen.g gets updated, they need rebuilding. Use the bootstrap script to
-- do this.
srcs = { "./src/*.c" },
vars = {
["+cflags"] = {
"-DLIBDIR=\\\""..posix.getcwd().."/"..cwd().."/lib\\\"",
"-DNON_CORRECTING"
},
}
}
definerule("llgen",
{
srcs = { type="targets" },
},
function(e)
-- Remember this is executed from the caller's directory; local
-- target names will resolve there
local fs = replace(basename(filenamesof(e.srcs)), "%.g$", "")
return normalrule {
name = e.name,
cwd = e.cwd,
outleaves = {
"Lpars.c",
"Lpars.h",
replace(fs, "$", ".c")
},
ins = {
"util/LLgen+llgen",
e.srcs,
},
commands = {
"cd %{dir} && %{abspath(ins)}"
}
}
end
)