ack/lang/m2/libm2/build.lua
David Given d623440c77 Add the core of a simple em22 platform. Unfortunately it doesn't work; the old
em libmon vanished decades ago (or never existed), and also ass appears to have
a different idea of what the em opcodes are to everything else and gets
confused.
2018-06-10 20:25:48 +09:00

60 lines
1 KiB
Lua

include("plat/build.lua")
local installmap = {}
local function addheader(dir, list)
for _, f in ipairs(list) do
local b = basename(f)
installmap[concatpath("$(PLATIND)/include/modula2/", dir, b)] = f
end
end
addheader("", filenamesof("./*.def"))
installable {
name = "headers",
map = installmap
}
for _, plat in ipairs(vars.plats) do
acklibrary {
name = "lib_"..plat,
srcs = {
"./*.c",
"./*.mod",
"./EM.e",
"./LtoUset.e",
"./absf.e",
"./par_misc.e",
},
hdrs = {}, -- must be empty
deps = {
"lang/cem/libcc.ansi/headers+pkg",
"plat/"..plat.."/include+pkg",
"h+emheaders",
},
vars = { plat = plat }
}
ackfile {
name = "mrt_"..plat,
srcs = { "./head_m2.e" },
vars = { plat = plat },
deps = {
"h+emheaders"
}
}
local suffix = plat:find("^em") and "m" or "o"
installable {
name = "pkg_"..plat,
map = {
["$(PLATIND)/"..plat.."/modula2."..suffix] = "+mrt_"..plat,
["$(PLATIND)/"..plat.."/libmodula2.a"] = "+lib_"..plat,
"+headers",
}
}
end