ack/mach/proto/as/build.lua
David Given bff5c4019c Baby steps towards building a platform --- make the assembler work.
Add ackbuilder support for C preprocessor files and yacc.
2016-07-24 00:50:02 +02:00

47 lines
826 B
Lua

include("first/yacc.lua")
definerule("build_as",
{
arch = { type="string" }
},
function(e)
-- Remember this is executed from the caller's directory; local
-- target names will resolve there
local archlib = clibrary {
name = e.name.."/archlib",
srcs = {},
hdrs = { "mach/"..e.arch.."/as/mach*.c" }
}
local preprocessedy = cppfile {
name = e.name.."/yaccinput",
srcs = { "mach/proto/as/comm2.y" },
outleaf = "comm2.y",
deps = {
"h+emheaders",
archlib,
},
}
local yaccfiles = yacc {
name = e.name.."/yacc",
srcs = { preprocessedy }
}
return cprogram {
name = e.name,
srcs = {
"mach/proto/as/*.c",
yaccfiles, -- for .c file
},
deps = {
"h+emheaders",
"modules/src/object+lib",
archlib,
yaccfiles, -- for .h file
}
}
end
)