Builds libend (the simplest library). Becoming obvious I need to rework the way
ackbuilder deals with lists.
This commit is contained in:
@@ -30,9 +30,13 @@ end
|
||||
|
||||
local function concat(...)
|
||||
local r = {}
|
||||
for k, t in ipairs({...}) do
|
||||
for _, v in ipairs(t) do
|
||||
r[#r+1] = v
|
||||
for _, t in ipairs({...}) do
|
||||
if (type(t) == "table") and not t.is then
|
||||
for _, v in ipairs(t) do
|
||||
r[#r+1] = v
|
||||
end
|
||||
else
|
||||
r[#r+1] = t
|
||||
end
|
||||
end
|
||||
return r
|
||||
@@ -413,6 +417,10 @@ local typeconverters = {
|
||||
end
|
||||
return i
|
||||
end,
|
||||
|
||||
object = function(propname, i)
|
||||
return i
|
||||
end,
|
||||
}
|
||||
|
||||
local function definerule(rulename, types, cb)
|
||||
|
||||
@@ -146,6 +146,7 @@ definerule("clibrary",
|
||||
srcs = { type="targets", default={} },
|
||||
hdrs = { type="targets", default={} },
|
||||
deps = { type="targets", default={} },
|
||||
_cfile = { type="object", default=cfile },
|
||||
commands = {
|
||||
type="strings",
|
||||
default={
|
||||
@@ -155,16 +156,13 @@ definerule("clibrary",
|
||||
}
|
||||
},
|
||||
function (e)
|
||||
local csrcs = filenamesof(e.srcs, "%.c$")
|
||||
local hsrcs = filenamesof(e.srcs, "%.h$")
|
||||
|
||||
local ins = {}
|
||||
for _, csrc in fpairs(csrcs) do
|
||||
local n = basename(csrc):gsub("%.%w*$", "")
|
||||
ins[#ins+1] = cfile {
|
||||
for _, src in fpairs(e.srcs) do
|
||||
local n = basename(src):gsub("%.%w*$", "")
|
||||
ins[#ins+1] = e._cfile {
|
||||
name = e.name.."/"..n,
|
||||
cwd = e.cwd,
|
||||
srcs = {csrc, unpack(hsrcs)},
|
||||
srcs = {src},
|
||||
deps = e.deps,
|
||||
vars = {
|
||||
["+cflags"] = { "-I"..e.cwd, },
|
||||
|
||||
Reference in New Issue
Block a user