C preprocessor; tabgen; now the pc86 boot.s builds using the ack
toolchain.
This commit is contained in:
110
lang/cem/cpp.ansi/build.lua
Normal file
110
lang/cem/cpp.ansi/build.lua
Normal file
@@ -0,0 +1,110 @@
|
||||
include("util/cmisc/build.lua")
|
||||
|
||||
local allocd_header = definerule(null,
|
||||
{
|
||||
srcs = { type="targets" }
|
||||
},
|
||||
function (e)
|
||||
return normalrule {
|
||||
name = e.name,
|
||||
ins = {
|
||||
"./make.allocd",
|
||||
unpack(e.srcs)
|
||||
},
|
||||
outleaves = replace(basename(e.srcs), "%.str$", ".h"),
|
||||
commands = {
|
||||
"%{ins[1]} < %{ins[2]} > %{outs}"
|
||||
}
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
allocd_header {
|
||||
name = "macro_h",
|
||||
srcs = { "./macro.str" }
|
||||
}
|
||||
|
||||
allocd_header {
|
||||
name = "replace_h",
|
||||
srcs = { "./replace.str" }
|
||||
}
|
||||
|
||||
normalrule {
|
||||
name = "tokenfile_g",
|
||||
ins = {
|
||||
"./make.tokfile",
|
||||
"./tokenname.c",
|
||||
},
|
||||
outleaves = { "tokenfile.g" },
|
||||
commands = {
|
||||
"sh %{ins[1]} < %{ins[2]} > %{outs}"
|
||||
}
|
||||
}
|
||||
|
||||
normalrule {
|
||||
name = "symbol2str_c",
|
||||
ins = {
|
||||
"./make.tokcase",
|
||||
"./tokenname.c",
|
||||
},
|
||||
outleaves = { "symbol2str.c" },
|
||||
commands = {
|
||||
"sh %{ins[1]} < %{ins[2]} > %{outs}"
|
||||
}
|
||||
}
|
||||
|
||||
normalrule {
|
||||
name = "next_c",
|
||||
ins = {
|
||||
"./make.next",
|
||||
"./*.str",
|
||||
},
|
||||
outleaves = { "next.c" },
|
||||
commands = {
|
||||
"sh %{ins} > %{outs}"
|
||||
}
|
||||
}
|
||||
|
||||
llgen {
|
||||
name = "llgen",
|
||||
srcs = {
|
||||
"+tokenfile_g",
|
||||
"./expression.g"
|
||||
}
|
||||
}
|
||||
|
||||
tabgen {
|
||||
name = "tabgen_c",
|
||||
srcs = { "./char.tab" }
|
||||
}
|
||||
|
||||
cprogram {
|
||||
name = "cpp",
|
||||
srcs = {
|
||||
"./*.c",
|
||||
"+llgen",
|
||||
"+next_c",
|
||||
"+symbol2str_c",
|
||||
"+tabgen_c",
|
||||
},
|
||||
deps = {
|
||||
"+llgen",
|
||||
"+macro_h",
|
||||
"+replace_h",
|
||||
"modules+headers",
|
||||
"modules/src/alloc+lib",
|
||||
"modules/src/idf+lib",
|
||||
"modules/src/input+lib",
|
||||
"modules/src/print+lib",
|
||||
"modules/src/string+lib",
|
||||
"modules/src/system+lib",
|
||||
}
|
||||
}
|
||||
|
||||
installable {
|
||||
name = "pkg",
|
||||
map = {
|
||||
["$(PLATDEP)/cpp.ansi"] = "+cpp"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user