2016-07-14 21:54:13 +00:00
|
|
|
include("util/LLgen/build.lua")
|
2016-08-07 19:56:53 +00:00
|
|
|
include("util/cmisc/build.lua")
|
2016-07-14 21:54:13 +00:00
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "parameters",
|
|
|
|
ins = { "./BigPars" },
|
|
|
|
outleaves = { "parameters.h" },
|
|
|
|
commands = {
|
|
|
|
"echo '#ifndef PARAMETERS_H' > %{outs}",
|
|
|
|
"echo '#define PARAMETERS_H' >> %{outs}",
|
|
|
|
"grep -v '^!' < %{ins} >> %{outs}",
|
|
|
|
"echo '#endif' >> %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-04 21:51:19 +00:00
|
|
|
local str_files = basename(filenamesof("./*.str"))
|
2016-07-14 21:54:13 +00:00
|
|
|
local str_targets = {}
|
|
|
|
|
|
|
|
for _, f in ipairs(str_files) do
|
|
|
|
local bf = f:gsub("%.str$", "")
|
|
|
|
str_targets[#str_targets+1] = normalrule {
|
|
|
|
name = "allocd_header/"..bf,
|
|
|
|
ins = { "./make.allocd", "./"..f },
|
|
|
|
outleaves = { bf..".h" },
|
|
|
|
commands = {
|
|
|
|
"%{ins[1]} < %{ins[2]} > %{outs}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "next-c",
|
|
|
|
ins = {
|
|
|
|
"./make.next",
|
|
|
|
"./*.str",
|
|
|
|
},
|
|
|
|
outleaves = { "next.c" },
|
|
|
|
commands = {
|
|
|
|
"%{ins} > %{outs[1]}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
clibrary {
|
|
|
|
name = "nextlib",
|
|
|
|
srcs = { "+next-c" },
|
|
|
|
hdrs = str_targets,
|
|
|
|
deps = {
|
|
|
|
"+parameters",
|
2016-08-04 21:51:19 +00:00
|
|
|
str_targets
|
2016-07-14 21:54:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
2016-08-07 19:56:53 +00:00
|
|
|
name = "tokenfile-g",
|
2016-07-14 21:54:13 +00:00
|
|
|
ins = {
|
|
|
|
"./make.tokfile",
|
|
|
|
"./tokenname.c",
|
|
|
|
},
|
2016-08-07 19:56:53 +00:00
|
|
|
outleaves = { "tokenfile.g" },
|
|
|
|
commands = {
|
|
|
|
"sh %{ins[1]} < %{ins[2]} > %{outs}",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
normalrule {
|
|
|
|
name = "symbol2str-c",
|
|
|
|
ins = {
|
|
|
|
"./make.tokcase",
|
|
|
|
"./tokenname.c",
|
|
|
|
},
|
|
|
|
outleaves = { "symbol2str.c" },
|
2016-07-14 21:54:13 +00:00
|
|
|
commands = {
|
|
|
|
"sh %{ins[1]} < %{ins[2]} > %{outs}",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
llgen {
|
|
|
|
name = "llgen",
|
|
|
|
srcs = {
|
2016-08-07 19:56:53 +00:00
|
|
|
"+tokenfile-g", -- must be first
|
2016-07-14 21:54:13 +00:00
|
|
|
"./*.g",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2016-08-07 19:56:53 +00:00
|
|
|
tabgen {
|
|
|
|
name = "tabgen",
|
|
|
|
srcs = { "./char.tab" }
|
|
|
|
}
|
|
|
|
|
2016-07-14 21:54:13 +00:00
|
|
|
cprogram {
|
|
|
|
name = "cemcom",
|
|
|
|
srcs = {
|
2016-08-07 19:56:53 +00:00
|
|
|
"./LLlex.c",
|
|
|
|
"./LLmessage.c",
|
|
|
|
"./arith.c",
|
|
|
|
"./blocks.c",
|
2016-07-14 21:54:13 +00:00
|
|
|
"./ch3.c",
|
|
|
|
"./ch3bin.c",
|
|
|
|
"./ch3mon.c",
|
|
|
|
"./code.c",
|
|
|
|
"./conversion.c",
|
|
|
|
"./cstoper.c",
|
|
|
|
"./dataflow.c",
|
|
|
|
"./declarator.c",
|
|
|
|
"./decspecs.c",
|
|
|
|
"./domacro.c",
|
|
|
|
"./dumpidf.c",
|
|
|
|
"./error.c",
|
|
|
|
"./eval.c",
|
|
|
|
"./expr.c",
|
|
|
|
"./field.c",
|
|
|
|
"./fltcstoper.c",
|
|
|
|
"./idf.c",
|
|
|
|
"./init.c",
|
|
|
|
"./input.c",
|
|
|
|
"./l_comment.c",
|
|
|
|
"./l_ev_ord.c",
|
|
|
|
"./l_lint.c",
|
|
|
|
"./l_misc.c",
|
|
|
|
"./l_outdef.c",
|
|
|
|
"./l_states.c",
|
|
|
|
"./label.c",
|
|
|
|
"./main.c",
|
|
|
|
"./options.c",
|
|
|
|
"./pragma.c",
|
|
|
|
"./proto.c",
|
|
|
|
"./replace.c",
|
|
|
|
"./skip.c",
|
|
|
|
"./stab.c",
|
|
|
|
"./stack.c",
|
|
|
|
"./struct.c",
|
|
|
|
"./switch.c",
|
|
|
|
"./tokenname.c",
|
|
|
|
"./type.c",
|
|
|
|
"./util.c",
|
2016-08-07 19:56:53 +00:00
|
|
|
"+symbol2str-c",
|
|
|
|
"+tabgen",
|
|
|
|
matching(filenamesof("+llgen"), "%.c$"),
|
2016-07-14 21:54:13 +00:00
|
|
|
},
|
|
|
|
deps = {
|
2016-08-07 19:56:53 +00:00
|
|
|
"./*.h",
|
2016-07-14 21:54:13 +00:00
|
|
|
"+llgen",
|
2016-08-14 12:09:38 +00:00
|
|
|
"+nextlib",
|
|
|
|
"+parameters",
|
2016-07-14 21:54:13 +00:00
|
|
|
"h+emheaders",
|
2016-08-14 12:09:38 +00:00
|
|
|
"modules+headers",
|
2016-07-22 22:30:31 +00:00
|
|
|
"modules/src/alloc+lib",
|
|
|
|
"modules/src/em_code+lib_k",
|
2016-08-14 12:09:38 +00:00
|
|
|
"modules/src/em_data+lib",
|
2016-08-07 19:56:53 +00:00
|
|
|
"modules/src/em_mes+lib",
|
2016-07-22 22:30:31 +00:00
|
|
|
"modules/src/flt_arith+lib",
|
|
|
|
"modules/src/idf+lib",
|
|
|
|
"modules/src/input+lib",
|
2016-08-07 19:56:53 +00:00
|
|
|
"modules/src/print+lib",
|
|
|
|
"modules/src/string+lib",
|
2016-07-22 22:30:31 +00:00
|
|
|
"modules/src/system+lib",
|
2016-07-14 21:54:13 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
installable {
|
|
|
|
name = "pkg",
|
|
|
|
map = {
|
|
|
|
["$(PLATDEP)/em_cemcom.ansi"] = "+cemcom"
|
|
|
|
}
|
|
|
|
}
|