2016-09-20 22:43:10 +00:00
|
|
|
include("first/yacc.lua")
|
|
|
|
|
|
|
|
flex {
|
|
|
|
name = "flex",
|
|
|
|
srcs = { "./*.l" },
|
|
|
|
}
|
|
|
|
|
|
|
|
yacc {
|
|
|
|
name = "yacc",
|
|
|
|
srcs = { "./*.y" },
|
|
|
|
}
|
|
|
|
|
2016-09-24 16:31:35 +00:00
|
|
|
normalrule {
|
|
|
|
name = "ircodes",
|
2016-09-26 20:12:46 +00:00
|
|
|
outleaves = { "ircodes-dyn.h", "ircodes.c" },
|
2016-09-24 16:31:35 +00:00
|
|
|
ins = {
|
|
|
|
"./ircodes.sh",
|
|
|
|
"./ir.dat"
|
|
|
|
},
|
|
|
|
commands = {
|
|
|
|
"%{ins[1]} %{ins[2]} %{outs[1]} %{outs[2]}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
clibrary {
|
|
|
|
name = "lib",
|
|
|
|
srcs = {
|
2016-09-26 20:12:46 +00:00
|
|
|
matching(filenamesof("+ircodes"), "%.c$"),
|
|
|
|
},
|
|
|
|
deps = {
|
|
|
|
"+ircodes",
|
|
|
|
"./ircodes.h"
|
2016-09-24 16:31:35 +00:00
|
|
|
},
|
|
|
|
hdrs = {
|
2016-09-24 20:46:08 +00:00
|
|
|
matching(filenamesof("+ircodes"), "%.h$"),
|
2016-09-26 20:12:46 +00:00
|
|
|
"./ircodes.h",
|
2016-09-24 20:46:08 +00:00
|
|
|
"./mcgg.h"
|
2016-09-24 16:31:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-20 22:43:10 +00:00
|
|
|
cprogram {
|
|
|
|
name = "mcgg",
|
|
|
|
srcs = {
|
|
|
|
"./*.c",
|
|
|
|
matching(filenamesof("+flex"), "%.c$"),
|
|
|
|
matching(filenamesof("+yacc"), "%.c$")
|
|
|
|
},
|
|
|
|
deps = {
|
2016-09-24 20:46:08 +00:00
|
|
|
"./iburg.h",
|
2016-09-24 16:31:35 +00:00
|
|
|
"+lib",
|
2016-09-25 10:18:39 +00:00
|
|
|
"+yacc",
|
|
|
|
"modules/src/data+lib",
|
2016-10-09 10:32:36 +00:00
|
|
|
"modules+headers",
|
2016-09-20 22:43:10 +00:00
|
|
|
}
|
|
|
|
}
|
2016-09-24 15:20:40 +00:00
|
|
|
|
|
|
|
definerule("mcgg",
|
|
|
|
{
|
|
|
|
srcs = { type="targets" }
|
|
|
|
},
|
|
|
|
function(e)
|
|
|
|
-- Remember this is executed from the caller's directory; local
|
|
|
|
-- target names will resolve there
|
|
|
|
if (#e.srcs ~= 1) then
|
|
|
|
error("you must supply exactly one input file")
|
|
|
|
end
|
|
|
|
|
2016-10-22 08:48:22 +00:00
|
|
|
local cpptable = cppfile {
|
|
|
|
name = e.name.."/cpptable",
|
|
|
|
outleaf = "cpptable",
|
|
|
|
srcs = e.srcs
|
|
|
|
}
|
|
|
|
|
2016-09-24 15:20:40 +00:00
|
|
|
return normalrule {
|
|
|
|
name = e.name,
|
|
|
|
cwd = e.cwd,
|
|
|
|
outleaves = {
|
|
|
|
"tables.c",
|
2016-10-15 16:38:46 +00:00
|
|
|
"tables.h",
|
2016-09-24 15:20:40 +00:00
|
|
|
},
|
|
|
|
ins = {
|
|
|
|
"util/mcgg+mcgg",
|
2016-10-22 08:48:22 +00:00
|
|
|
cpptable
|
2016-09-24 15:20:40 +00:00
|
|
|
},
|
|
|
|
commands = {
|
2016-10-15 16:38:46 +00:00
|
|
|
"%{ins[1]} -i %{ins[2]} -o %{outs[1]} -h %{outs[2]}",
|
2016-09-24 15:20:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
)
|
2016-09-20 22:43:10 +00:00
|
|
|
|