2016-08-07 19:56:53 +00:00
|
|
|
include("first/yacc.lua")
|
|
|
|
|
|
|
|
yacc {
|
|
|
|
name = "yacc",
|
|
|
|
srcs = { "./mktab.y" }
|
|
|
|
}
|
|
|
|
|
|
|
|
flex {
|
|
|
|
name = "flex",
|
|
|
|
srcs = { "./scan.l" }
|
|
|
|
}
|
|
|
|
|
2017-11-10 03:22:13 +00:00
|
|
|
local headers = {
|
2019-05-10 17:17:40 +00:00
|
|
|
"./alloc.h", "./ext.h", "./getline.h", "./line.h", "./lookup.h", "./optim.h",
|
|
|
|
"./param.h", "./pattern.h", "./pop_push.h", "./proinf.h","./putline.h",
|
|
|
|
"./reg.h","./tes.h", "./types.h","./util.h"
|
2017-11-10 03:22:13 +00:00
|
|
|
}
|
|
|
|
|
2016-08-07 19:56:53 +00:00
|
|
|
cprogram {
|
|
|
|
name = "mktab",
|
|
|
|
srcs = {
|
|
|
|
matching(filenamesof("+yacc"), "%.c$"),
|
|
|
|
matching(filenamesof("+flex"), "%.c$"),
|
|
|
|
},
|
2017-11-10 03:22:13 +00:00
|
|
|
deps = concat(
|
|
|
|
headers,
|
2016-08-07 19:56:53 +00:00
|
|
|
"+flex",
|
|
|
|
"+yacc",
|
2017-11-10 03:22:13 +00:00
|
|
|
"modules/src/em_data+lib"
|
|
|
|
)
|
2016-08-07 19:56:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "pattern_c",
|
|
|
|
ins = {
|
|
|
|
"+mktab",
|
|
|
|
"./patterns",
|
|
|
|
"lang/cem/cpp.ansi+cpp"
|
|
|
|
},
|
|
|
|
outleaves = { "pattern.c" },
|
|
|
|
commands = {
|
|
|
|
"%{ins[3]} < %{ins[2]} | %{ins[1]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "pop_push_c",
|
|
|
|
ins = {
|
|
|
|
"./pop_push.awk",
|
|
|
|
"h/em_table"
|
|
|
|
},
|
|
|
|
outleaves = { "pop_push.c" },
|
|
|
|
commands = {
|
|
|
|
"awk -f %{ins[1]} < %{ins[2]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
local function variant(name, cflags)
|
|
|
|
cprogram {
|
|
|
|
name = name,
|
|
|
|
srcs = {
|
|
|
|
"+pattern_c",
|
|
|
|
"+pop_push_c",
|
2022-07-14 21:57:54 +00:00
|
|
|
"./alloc.c",
|
|
|
|
"./backward.c",
|
|
|
|
"./cleanup.c",
|
|
|
|
"./flow.c",
|
|
|
|
"./getline.c",
|
|
|
|
"./lookup.c",
|
|
|
|
"./main.c",
|
|
|
|
"./peephole.c",
|
|
|
|
"./process.c",
|
|
|
|
"./putline.c",
|
|
|
|
"./reg.c",
|
|
|
|
"./special.c",
|
|
|
|
"./tes.c",
|
|
|
|
"./util.c",
|
|
|
|
"./var.c",
|
2016-08-07 19:56:53 +00:00
|
|
|
},
|
2017-11-10 03:22:13 +00:00
|
|
|
deps = concat(
|
|
|
|
headers,
|
2016-08-07 19:56:53 +00:00
|
|
|
"h+emheaders",
|
|
|
|
"modules/src/alloc+lib",
|
|
|
|
"modules/src/print+lib",
|
|
|
|
"modules/src/string+lib",
|
|
|
|
"modules/src/system+lib",
|
2017-11-10 03:22:13 +00:00
|
|
|
"modules/src/em_data+lib"
|
|
|
|
),
|
2016-08-07 19:56:53 +00:00
|
|
|
vars = {
|
|
|
|
["+cflags"] = cflags
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
variant("em_opt", {})
|
|
|
|
variant("em_opt2", {"-DGLOBAL_OPT"})
|
|
|
|
|
|
|
|
installable {
|
|
|
|
name = "pkg",
|
|
|
|
map = {
|
|
|
|
["$(PLATDEP)/em_opt"] = "+em_opt",
|
|
|
|
["$(PLATDEP)/em_opt2"] = "+em_opt2",
|
|
|
|
["$(INSDIR)/share/man/man6/em_opt.6"] = "./em_opt.6",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|