build system on MultICE cleanup

This commit is contained in:
Izaya 2017-06-26 12:49:56 +00:00
parent df6d6257f9
commit d5f77ef8c9
2 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env lua5.2
--#!/usr/bin/env lua5.2
-- Initialization
log = ""
prefix=""
oldprint=print
function print(...)
oldprint(...)
@ -26,24 +27,32 @@ for k,v in ipairs(tA) do
cfgfile = v:sub(11)
elseif v:sub(1,10) == "--modfile=" then
modfile = v:sub(11)
elseif v:sub(1,9) == "--prefix=" then
prefix=v:sub(10)
print("Prefix is: "..prefix)
end
end
end
ss=""
cfgfile = cfgfile or "build.cfg"
modfile = modfile or "modules.cfg"
cfgfile=prefix..cfgfile
modfile=prefix..modfile
cfg={}
f=io.open(cfgfile,"rb")
repeat
line = f:read("*l")
print(line)
if line ~= nil then
w={}
for wo in line:gmatch("%S+") do table.insert(w, wo) end
cfg[w[1]] = w[2]
cfg[w[1] or ""] = w[2] or ""
end
until line == nil or line == ""
cfg.opath = cfg.opath or "kernel.lua"
cfg.ospath = cfg.ospath or "skernel.lua"
cfg.opath = prefix .. cfg.opath
cfg.ospath = prefix .. cfg.ospath
print()
-- Module list
print("Reading modules to load")
@ -63,7 +72,7 @@ print(tostring(#tm).." modules to load.\n")
print("Loading modules")
for k,v in ipairs(tm) do
print(" - "..v.." - modules/"..v)
f=io.open("modules/"..v,"rb")
f=io.open(prefix.."modules/"..v,"rb")
if cfg.optimise == "yes" then
data = f:read("*a")
else
@ -92,7 +101,7 @@ for k,v in pairs(ts) do
ss=ss..v
io.write(".")
end
print()
print("")
-- Output
print("Outputting to "..cfg.opath)
@ -125,7 +134,7 @@ end
-- Write log
if cfg.log == "yes" then
f=io.open("build.log","wb")
f=io.open(prefix.."build.log","wb")
f:write(log)
f:close()
end

View File

@ -29,4 +29,7 @@ applications/skex2.lua
applications/luash.lua
applications/ircbridge.lua
applications/autoluash.lua
util/build-wrapper-h.lua
util/build.lua
util/build-wrapper-e.lua
base/footer.lua