From a77d0c6356aa47149121e82ade37ebcc412b9853 Mon Sep 17 00:00:00 2001 From: Izaya Date: Sun, 23 Apr 2017 19:17:22 +1000 Subject: [PATCH] Made the build system accept --cfgfile and --modfile Also added a dir of example configs. This contributes to #1. --- build-production.cfg | 5 +++++ build.lua | 13 +++++++++++-- configs/desktop.cfg | 14 ++++++++++++++ configs/minimal-net-rexec.cfg | 4 ++++ configs/minimal-net.cfg | 3 +++ configs/minimal.cfg | 2 ++ modules.cfg | 2 ++ 7 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 build-production.cfg create mode 100644 configs/desktop.cfg create mode 100644 configs/minimal-net-rexec.cfg create mode 100644 configs/minimal-net.cfg create mode 100644 configs/minimal.cfg diff --git a/build-production.cfg b/build-production.cfg new file mode 100644 index 0000000..6487e88 --- /dev/null +++ b/build-production.cfg @@ -0,0 +1,5 @@ +optimise yes +listmods no +test yes +log yes +opath kernel.lua diff --git a/build.lua b/build.lua index e322eef..4a25332 100644 --- a/build.lua +++ b/build.lua @@ -19,10 +19,19 @@ end print("Initializing and reading configuration") ts={} tA = {...} +for k,v in ipairs(tA) do + if type(v) == "string" then + if v:sub(1,10) == "--cfgfile=" then + cfgfile = v:sub(11) + elseif v:sub(1,10) == "--modfile=" then + modfile = v:sub(11) + end + end +end ss="" +cfgfile = cfgfile or "build.cfg" +modfile = modfile or "modules.cfg" cfg={} -cfgfile = tA[1] or "build.cfg" -modfile = tA[2] or "modules.cfg" f=io.open(cfgfile,"rb") repeat line = f:read("*l") diff --git a/configs/desktop.cfg b/configs/desktop.cfg new file mode 100644 index 0000000..d12b4d2 --- /dev/null +++ b/configs/desktop.cfg @@ -0,0 +1,14 @@ +base/header.lua +drivers/dterm.lua +library/print.lua +drivers/keyboard.lua +library/net.lua +library/fs-min.lua +library/fs-std.lua +library/fs-ext.lua +util/fs-automount.lua +applications/shutil.lua +applications/evproxy-srv.lua +applications/evproxy-client.lua +applications/luash.lua +base/footer.lua diff --git a/configs/minimal-net-rexec.cfg b/configs/minimal-net-rexec.cfg new file mode 100644 index 0000000..f416915 --- /dev/null +++ b/configs/minimal-net-rexec.cfg @@ -0,0 +1,4 @@ +base/header.lua +library/net.lua +applications/rexec.lua +base/footer.lua diff --git a/configs/minimal-net.cfg b/configs/minimal-net.cfg new file mode 100644 index 0000000..f7051cb --- /dev/null +++ b/configs/minimal-net.cfg @@ -0,0 +1,3 @@ +base/header.lua +library/net.lua +base/footer.lua diff --git a/configs/minimal.cfg b/configs/minimal.cfg new file mode 100644 index 0000000..6d3f6bc --- /dev/null +++ b/configs/minimal.cfg @@ -0,0 +1,2 @@ +base/header.lua +base/footer.lua diff --git a/modules.cfg b/modules.cfg index d5f6ac5..d12b4d2 100644 --- a/modules.cfg +++ b/modules.cfg @@ -8,5 +8,7 @@ library/fs-std.lua library/fs-ext.lua util/fs-automount.lua applications/shutil.lua +applications/evproxy-srv.lua +applications/evproxy-client.lua applications/luash.lua base/footer.lua