2016-08-13 11:03:06 +00:00
|
|
|
normalrule {
|
|
|
|
name = "tokenfile_g",
|
|
|
|
ins = {
|
|
|
|
"./make.tokfile",
|
|
|
|
"./tokenname.c"
|
|
|
|
},
|
|
|
|
outleaves = { "tokenfile.g" },
|
|
|
|
commands = {
|
|
|
|
"sh %{ins[1]} < %{ins[2]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
llgen {
|
|
|
|
name = "llgen",
|
|
|
|
srcs = {
|
|
|
|
-- order here is important
|
|
|
|
"+tokenfile_g",
|
2022-07-14 21:57:54 +00:00
|
|
|
"./declar.g",
|
|
|
|
"./expression.g",
|
|
|
|
"./program.g",
|
|
|
|
"./statement.g",
|
2016-08-13 11:03:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "parameters_h",
|
|
|
|
ins = {
|
|
|
|
"./make.parameters",
|
|
|
|
"./Parameters",
|
|
|
|
},
|
|
|
|
outleaves = { "parameters.h" },
|
|
|
|
commands = {
|
|
|
|
"sh %{ins[1]} < %{ins[2]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-14 21:57:54 +00:00
|
|
|
local xh_files = {
|
|
|
|
"./def.xh",
|
|
|
|
"./desig.xh",
|
|
|
|
"./node.xh",
|
|
|
|
"./scope.xh",
|
|
|
|
"./type.xh",
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, f in ipairs(filenamesof(xh_files)) do
|
2017-08-06 09:15:53 +00:00
|
|
|
local name = replace(basename(f), "%.xh$", "")
|
2016-08-13 11:03:06 +00:00
|
|
|
normalrule {
|
|
|
|
name = name.."_h",
|
|
|
|
ins = {
|
|
|
|
"./make.allocd",
|
|
|
|
f
|
|
|
|
},
|
|
|
|
outleaves = { name..".h" },
|
|
|
|
commands = {
|
|
|
|
"%{ins[1]} < %{ins[2]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2022-07-14 21:57:54 +00:00
|
|
|
local xc_files = {
|
|
|
|
"./casestat.xc",
|
|
|
|
"./tmpvar.xc",
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, f in ipairs(filenamesof(xc_files)) do
|
2017-08-06 09:15:53 +00:00
|
|
|
local name = replace(basename(f), "%.xc$", "")
|
2016-08-13 11:03:06 +00:00
|
|
|
normalrule {
|
|
|
|
name = name.."_c",
|
|
|
|
ins = {
|
|
|
|
"./make.allocd",
|
|
|
|
f
|
|
|
|
},
|
|
|
|
outleaves = { name..".c" },
|
|
|
|
commands = {
|
|
|
|
"%{ins[1]} < %{ins[2]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "next_c",
|
|
|
|
ins = {
|
|
|
|
"./make.next",
|
2022-07-14 21:57:54 +00:00
|
|
|
xh_files,
|
|
|
|
xc_files
|
2016-08-13 11:03:06 +00:00
|
|
|
},
|
|
|
|
outleaves = { "next.c" },
|
|
|
|
commands = {
|
|
|
|
"sh %{ins} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "symbol2str_c",
|
|
|
|
ins = {
|
|
|
|
"./make.tokcase",
|
|
|
|
"./tokenname.c",
|
|
|
|
},
|
|
|
|
outleaves = { "symbol2str.c" },
|
|
|
|
commands = {
|
|
|
|
"%{ins[1]} < %{ins[2]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tabgen {
|
|
|
|
name = "chartab_c",
|
|
|
|
srcs = { "./char.tab" },
|
|
|
|
}
|
|
|
|
|
|
|
|
cprogram {
|
|
|
|
name = "em_pc",
|
|
|
|
srcs = {
|
2022-07-14 21:57:54 +00:00
|
|
|
"./body.c",
|
|
|
|
"./chk_expr.c",
|
|
|
|
"./code.c",
|
|
|
|
"./cstoper.c",
|
|
|
|
"./def.c",
|
|
|
|
"./desig.c",
|
|
|
|
"./enter.c",
|
|
|
|
"./error.c",
|
|
|
|
"./idf.c",
|
|
|
|
"./input.c",
|
|
|
|
"./label.c",
|
|
|
|
"./LLlex.c",
|
|
|
|
"./LLmessage.c",
|
|
|
|
"./lookup.c",
|
|
|
|
"./main.c",
|
|
|
|
"./misc.c",
|
|
|
|
"./node.c",
|
|
|
|
"./options.c",
|
|
|
|
"./progs.c",
|
|
|
|
"./readwrite.c",
|
|
|
|
"./scope.c",
|
|
|
|
"./stab.c",
|
|
|
|
"./tokenname.c",
|
|
|
|
"./type.c",
|
|
|
|
"./typequiv.c",
|
2016-08-13 11:03:06 +00:00
|
|
|
"+casestat_c",
|
|
|
|
"+chartab_c",
|
|
|
|
"+next_c",
|
|
|
|
"+symbol2str_c",
|
|
|
|
"+tmpvar_c",
|
|
|
|
matching(filenamesof("+llgen"), "%.c$"),
|
|
|
|
},
|
|
|
|
deps = {
|
|
|
|
"+def_h",
|
|
|
|
"+desig_h",
|
|
|
|
"+llgen",
|
|
|
|
"+node_h",
|
|
|
|
"+parameters_h",
|
|
|
|
"+scope_h",
|
|
|
|
"+type_h",
|
|
|
|
"h+emheaders",
|
2018-06-18 20:17:38 +00:00
|
|
|
"lang/pc/include+headers",
|
2016-08-13 11:03:06 +00:00
|
|
|
"modules+headers",
|
|
|
|
"modules/src/alloc+lib",
|
|
|
|
"modules/src/em_code+lib_k",
|
2016-08-14 12:09:38 +00:00
|
|
|
"modules/src/em_data+lib",
|
|
|
|
"modules/src/em_mes+lib",
|
2016-08-13 11:03:06 +00:00
|
|
|
"modules/src/flt_arith+lib",
|
|
|
|
"modules/src/idf+lib",
|
|
|
|
"modules/src/input+lib",
|
2016-08-14 12:09:38 +00:00
|
|
|
"modules/src/print+lib",
|
2016-08-13 11:03:06 +00:00
|
|
|
"modules/src/string+lib",
|
|
|
|
"modules/src/system+lib",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
installable {
|
|
|
|
name = "pkg",
|
|
|
|
map = {
|
|
|
|
["$(PLATDEP)/em_pc"] = "+em_pc",
|
|
|
|
["$(INSDIR)/share/man/man6/em_pc.6"] = "./em_pc.6"
|
|
|
|
}
|
|
|
|
}
|