diff options
author | Alex Auvolat <alex@adnab.me> | 2016-07-30 23:17:12 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2016-07-30 23:17:12 +0200 |
commit | f58f65c30de315d4419f69a92a708cbed797ff37 (patch) | |
tree | efaaa82089523dc0f7a3b9a6ab4c963550f9b241 /src/bin | |
parent | fa5327d4cc5e47656326b8c0c55d23cd71b04462 (diff) | |
download | kogata-f58f65c30de315d4419f69a92a708cbed797ff37.tar.gz kogata-f58f65c30de315d4419f69a92a708cbed797ff37.zip |
Release mode (enables some optimizations) ; fix tests.
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/bam.lua | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/bin/bam.lua b/src/bin/bam.lua index 76b7b2a..d529ece 100644 --- a/src/bin/bam.lua +++ b/src/bin/bam.lua @@ -1,23 +1,24 @@ -local function bin_settings(name) - local s = TableDeepCopy(user_settings) - s.link.flags:Add("-T src/lib/linker.ld", - "-Xlinker -Map=build/bin/" .. name .. ".map") - if name == 'lua' or name == 'luac' then - s.cc.includes:Add("src/lib/lua") +return function(s, lib) + local function bin_settings(name) + local s = TableDeepCopy(s.user_settings) + s.link.flags:Add("-T src/lib/linker.ld") + if name == 'lua' or name == 'luac' then + s.cc.includes:Add("src/lib/lua") + end + return s end - return s -end -local function bin_exe(name, deps) - local s = bin_settings(name) + local function bin_exe(name, deps) + local s = bin_settings(name) - local src = Collect('src/bin/' .. name .. '/*.c') - local obj = Compile(s, src) + local src = Collect('src/bin/' .. name .. '/*.c') + local obj = Compile(s, src) - return Link(s, 'bin/' .. name .. ".bin", {obj, deps}) -end + return Link(s, 'bin/' .. name .. ".bin", {obj, deps}) + end -bin = { - bin_exe('lua', {liblua}), - -- bin_exe('luac', {liblua}), -} + return { + bin_exe('lua', {lib.liblua}), + -- bin_exe('luac', {liblua}), + } +end |