1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-12-24 01:48:06 +11:00
This commit is contained in:
Jane Roxanne 2019-09-10 20:08:38 -05:00
parent 1cf9e94b54
commit c012911f36
3 changed files with 42 additions and 1 deletions

View File

@ -182,7 +182,7 @@ local tmpfile = os.tmpname()
local tmpf = io.open(tmpfile, "wb") local tmpf = io.open(tmpfile, "wb")
tmpf:write(env.code) tmpf:write(env.code)
tmpf:close() tmpf:close()
if (os.execute("luamin -f "..tmpfile.." > "..arg[2])) then if (os.execute("luamin -f "..tmpfile..">"..arg[2])) then
os.execute("stat -c \"Output: %s bytes\" "..arg[2]) os.execute("stat -c \"Output: %s bytes\" "..arg[2])
else else
io.stderr:write("Error: ") io.stderr:write("Error: ")

2
utils/mkmod.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
ls $1 | cpio -oD $1 > $2.zyr 2>/dev/null

39
utils/mkrelease.lua Executable file
View File

@ -0,0 +1,39 @@
if (not os.execute("stat .git>/dev/null 2>&1")) then
io.stderr:write("This script must be executed at the root (run utils/mkrelease.lua)\n")
os.exit(1)
end
os.execute("mkdir -p build/modules")
os.execute("mkdir -p build/loaders")
os.execute("mkdir -p build/microruntime")
local cwd = os.getenv("PWD")
local function dir(path, func)
local h = io.popen("ls "..path, "r")
for line in h:lines() do
func(line)
end
end
print("Building modules...")
dir("src/modules", function(entry)
print("MOD", entry)
os.execute("utils/mkmod.sh src/modules/"..entry.." build/"..entry)
end)
print("Building loaders...")
dir("src/loaders", function(entry)
print("LOADER", entry)
os.execute("cd src/loaders/"..entry.."; "..cwd.."/utils/luapreproc.lua init.lua "..cwd.."/build/loaders/"..entry..".bios>/dev/null")
end)
print("Building microruntimes...")
dir("src/microruntime", function(entry)
print("URT", entry)
os.execute("cd src/microruntime/"..entry.."; "..cwd.."/utils/luapreproc.lua init.lua "..cwd.."/build/microruntime/"..entry..".urt>/dev/null")
end)
print("Packing...")
os.execute("cd build; find * -depth | cpio -o > ../update.zy2 2>/dev/null")
print("Packaging complete. See update.zy2.")