Split aal arguments properly.

This commit is contained in:
David Given 2022-07-18 16:48:14 +02:00
parent 01c2342e18
commit c573b9bce2

View file

@ -49,24 +49,24 @@ definerule("acklibrary",
function (e) function (e)
local em = (e.vars.plat or ""):find("^em") local em = (e.vars.plat or ""):find("^em")
local commands = { local function splitter(srcs, num, cmd)
"rm -f %{outs[1]}", local commands = {
} }
local t = {} local t = {}
local function flush() local function flush()
commands[#commands+1] = commands[#commands+1] = cmd:gsub("%%%%", asstring(t))
"ACKDIR=$(INSDIR) $(INSDIR)/bin/aal qc %{outs[1]} ".. t = {}
asstring(t) end
t = {} for _, target in ipairs(srcs) do
end t[#t+1] = target
for _, target in ipairs(filenamesof(e.srcs)) do if #t == num then
t[#t+1] = target flush()
if #t == 100 then end
end
if #t ~= 0 then
flush() flush()
end end
end return table.concat(commands, " && ")
if #t ~= 0 then
flush()
end end
return clibrary { return clibrary {
@ -77,9 +77,15 @@ definerule("acklibrary",
"util/arch+pkg", "util/arch+pkg",
e.deps e.deps
}, },
vars = {
splitter = splitter
},
_cfile = ackfile, _cfile = ackfile,
suffix = em and ".m" or ".o", suffix = em and ".m" or ".o",
commands = commands commands = {
"rm -f %{outs[1]}",
"%{splitter(ins, 100, 'ACKDIR=$(INSDIR) $(INSDIR)/bin/aal qc '..tostring(outs[1])..' %%')}"
}
} }
end end
) )