aboutsummaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/fonts/bam.lua36
-rw-r--r--res/keymaps/bam.lua24
2 files changed, 36 insertions, 24 deletions
diff --git a/res/fonts/bam.lua b/res/fonts/bam.lua
index 04974c4..4ba29d1 100644
--- a/res/fonts/bam.lua
+++ b/res/fonts/bam.lua
@@ -1,19 +1,25 @@
-fonts = {}
+return function(s)
+ local fonts = {}
-for _, file in pairs(Collect('res/fonts/*.s')) do
- local out = BuildOutput(host_settings, PathBase(file)) .. '.bf'
- AddJob(out, "nasm font " .. out, "nasm -o " .. out .. " " .. file)
- AddDependency(out, file)
- table.insert(fonts, out)
-end
+ local BO = s.host_settings.cc.Output
+
+ for _, file in pairs(Collect('res/fonts/*.s')) do
+ local out = BO(s.host_settings, PathBase(file)) .. '.bf'
+ AddJob(out, "nasm font " .. out, "nasm -o " .. out .. " " .. file)
+ AddDependency(out, file)
+ table.insert(fonts, out)
+ end
+
+ for _, file in pairs(Collect('res/fonts/*.c')) do
+ local obj = Compile(s.host_settings, file)
+ local tgt = BO(s.host_settings, PathBase(file) .. '_tmp')
+ local bin = Link(s.host_settings, tgt, obj)
-for _, file in pairs(Collect('res/fonts/*.c')) do
- local obj = Compile(host_settings, file)
- local tgt = BuildOutput(host_settings, PathBase(file) .. '_tmp')
- local bin = Link(host_settings, tgt, obj)
+ local out = BO(s.host_settings, PathBase(file)) .. '.bf'
+ AddJob(out, "call font " .. bin, "./" .. bin .. " > " .. out)
+ AddDependency(out, bin)
+ table.insert(fonts, out)
+ end
- local out = BuildOutput(host_settings, PathBase(file)) .. '.bf'
- AddJob(out, "call font " .. bin, "./" .. bin .. " > " .. out)
- AddDependency(out, bin)
- table.insert(fonts, out)
+ return fonts
end
diff --git a/res/keymaps/bam.lua b/res/keymaps/bam.lua
index 0657abc..7aef6c0 100644
--- a/res/keymaps/bam.lua
+++ b/res/keymaps/bam.lua
@@ -1,12 +1,18 @@
-keymaps = {}
+return function(s)
+ local keymaps = {}
-for _, file in pairs(Collect('res/keymaps/*.c')) do
- local obj = Compile(host_settings, file)
- local tgt = BuildOutput(host_settings, PathBase(file) .. '_tmp')
- local bin = Link(host_settings, tgt, obj)
+ local BO = s.host_settings.cc.Output
- local out = BuildOutput(host_settings, PathBase(file)) .. '.km'
- AddJob(out, "call font " .. bin, "./" .. bin .. " > " .. out)
- AddDependency(out, bin)
- table.insert(keymaps, out)
+ for _, file in pairs(Collect('res/keymaps/*.c')) do
+ local obj = Compile(s.host_settings, file)
+ local tgt = BO(s.host_settings, PathBase(file) .. '_tmp')
+ local bin = Link(s.host_settings, tgt, obj)
+
+ local out = BO(s.host_settings, PathBase(file)) .. '.km'
+ AddJob(out, "call font " .. bin, "./" .. bin .. " > " .. out)
+ AddDependency(out, bin)
+ table.insert(keymaps, out)
+ end
+
+ return keymaps
end