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}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-14 21:57:54 +00:00
|
|
|
local str_files = {
|
|
|
|
"./code.str",
|
|
|
|
"./declar.str",
|
|
|
|
"./def.str",
|
|
|
|
"./estack.str",
|
|
|
|
"./expr.str",
|
|
|
|
"./field.str",
|
|
|
|
"./idf.str",
|
|
|
|
"./l_brace.str",
|
|
|
|
"./l_outdef.str",
|
|
|
|
"./l_state.str",
|
|
|
|
"./macro.str",
|
|
|
|
"./next.str",
|
|
|
|
"./proto.str",
|
|
|
|
"./stack.str",
|
|
|
|
"./stmt.str",
|
|
|
|
"./struct.str",
|
|
|
|
"./switch.str",
|
|
|
|
"./type.str",
|
|
|
|
"./util.str"
|
|
|
|
}
|
|
|
|
|
|
|
|
local str_bases = basename(filenamesof(str_files))
|
|
|
|
|
2016-07-14 21:54:13 +00:00
|
|
|
local str_targets = {}
|
|
|
|
|
2022-07-14 21:57:54 +00:00
|
|
|
for _, f in ipairs(str_bases) do
|
|
|
|
local bf = f:gsub("%.str$", ""):gsub("^$./", "")
|
2016-07-14 21:54:13 +00:00
|
|
|
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",
|
2022-07-14 21:57:54 +00:00
|
|
|
str_files
|
2016-07-14 21:54:13 +00:00
|
|
|
},
|
|
|
|
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
|
2022-07-14 21:57:54 +00:00
|
|
|
"./declar.g",
|
|
|
|
"./expression.g",
|
|
|
|
"./ival.g",
|
|
|
|
"./program.g",
|
|
|
|
"./statement.g",
|
2016-07-14 21:54:13 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
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",
|
|
|
|
"./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",
|
|
|
|
"./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 = {
|
2017-11-10 03:22:13 +00:00
|
|
|
"./LLlex.h", "./align.h", "./arith.h", "./atw.h",
|
|
|
|
"./class.h", "./decspecs.h", "./file_info.h",
|
|
|
|
"./input.h", "./interface.h", "./l_class.h",
|
|
|
|
"./l_comment.h", "./l_em.h", "./l_lint.h",
|
|
|
|
"./label.h", "./level.h", "./mes.h", "./sizes.h",
|
|
|
|
"./specials.h", "./tokenname.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"
|
|
|
|
}
|
|
|
|
}
|