2016-08-13 23:39:40 +00:00
|
|
|
include("util/LLgen/build.lua")
|
|
|
|
|
|
|
|
llgen {
|
|
|
|
name = "llgen",
|
2022-07-14 21:57:54 +00:00
|
|
|
srcs = {
|
|
|
|
"./topgen.g",
|
|
|
|
}
|
2016-08-13 23:39:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cprogram {
|
|
|
|
name = "topgen",
|
|
|
|
srcs = {
|
2022-07-14 21:57:54 +00:00
|
|
|
"./hash.c",
|
|
|
|
"./LLlex.c",
|
|
|
|
"./main.c",
|
|
|
|
"./pattern.c",
|
|
|
|
"./symtab.c",
|
2016-08-13 23:39:40 +00:00
|
|
|
matching(filenamesof("+llgen"), "%.c$"),
|
|
|
|
},
|
|
|
|
deps = {
|
|
|
|
"+llgen",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
definerule("topgen",
|
|
|
|
{
|
|
|
|
srcs = { type="targets" },
|
|
|
|
},
|
|
|
|
function(e)
|
|
|
|
-- Remember this is executed from the caller's directory; local
|
|
|
|
-- target names will resolve there
|
|
|
|
|
|
|
|
return normalrule {
|
|
|
|
name = e.name,
|
|
|
|
outleaves = {
|
|
|
|
"gen.c",
|
|
|
|
"gen.h",
|
|
|
|
},
|
|
|
|
ins = {
|
|
|
|
"util/topgen+topgen",
|
|
|
|
e.srcs,
|
|
|
|
},
|
|
|
|
commands = {
|
|
|
|
"%{ins[1]} %{ins[2]} %{dir}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
)
|
|
|
|
|