Filename variables now get passed into ackbuilder on the command line.

This commit is contained in:
David Given
2016-08-15 00:47:08 +02:00
parent 420c47c386
commit 46bd70380c
2 changed files with 48 additions and 28 deletions

View File

@@ -602,6 +602,12 @@ end
local function install_make_emitter()
emit("hide = @\n")
function emitter:var(name, value)
-- Don't let emit insert spaces.
emit(name.."="..value.."\n")
end
function emitter:rule(name, ins, outs)
emit(".INTERMEDIATE:", name, "\n")
for i = 1, #ins do
@@ -656,6 +662,11 @@ local function install_ninja_emitter()
)
end
function emitter:var(name, value)
-- Don't let emit insert spaces.
emit(name.."="..unmake(value).."\n")
end
function emitter:rule(name, ins, outs)
if (#outs == 0) then
emit("build", name, ": phony", unmake(ins), "\n")
@@ -853,22 +864,33 @@ do
{
["make"] = function()
emitter_type = install_make_emitter
return 1
return 0
end,
["ninja"] = function()
emitter_type = install_ninja_emitter
return 1
return 0
end,
[" unrecognised"] = function(arg)
error(string.format("unrecognised argument '%s'", arg))
end,
[" files"] = function(files)
emitter_type()
for _, f in ipairs(files) do
loadbuildfile(f)
local _, _, name, value = f:find("^([%w_]+)=(.*)$")
if name then
emitter:var(name, value)
end
end
for _, f in ipairs(files) do
if not f:find("=") then
loadbuildfile(f)
end
end
end
},