ack/mach/i80/libem/build.lua
David Given 79a38ecc08 Instead of using parameterised rsts for stack access, add a huge swathe of
automatically built helper tools. Star Trek goes up from 40243 to 40779 bytes,
but should be a lot faster.
2019-02-13 22:45:22 +01:00

69 lines
1.1 KiB
Lua

local generated = {}
definerule("generate",
{
body = { type="string" },
offset = { type="object" },
},
function(e)
return normalrule {
name = e.name,
ins = { "./generate.sh", "./"..e.body },
outleaves = { e.name..".s" },
commands = {
"%{ins[1]} "..e.body.." "..e.offset.." > %{outs}"
}
}
end
)
for i = 1, 128 do
generated[#generated+1] = generate {
name = "fload"..i,
body = "fload.h",
offset = i
}
generated[#generated+1] = generate {
name = "floadn"..i,
body = "floadn.h",
offset = i
}
generated[#generated+1] = generate {
name = "fstore"..i,
body = "fstore.h",
offset = i
}
generated[#generated+1] = generate {
name = "fstoren"..i,
body = "fstoren.h",
offset = i
}
generated[#generated+1] = generate {
name = "faddr"..i,
body = "faddr.h",
offset = i
}
generated[#generated+1] = generate {
name = "faddrn"..i,
body = "faddrn.h",
offset = i
}
end
for _, plat in ipairs(vars.plats) do
acklibrary {
name = "lib_"..plat,
srcs = concat("./*.s", generated),
vars = {
plat = plat,
["+ackcflags"] = {"-Imach/i80/libem"}
},
}
end