aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/bam.lua
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
commitf58f65c30de315d4419f69a92a708cbed797ff37 (patch)
treeefaaa82089523dc0f7a3b9a6ab4c963550f9b241 /src/kernel/bam.lua
parentfa5327d4cc5e47656326b8c0c55d23cd71b04462 (diff)
downloadkogata-f58f65c30de315d4419f69a92a708cbed797ff37.tar.gz
kogata-f58f65c30de315d4419f69a92a708cbed797ff37.zip
Release mode (enables some optimizations) ; fix tests.
Diffstat (limited to 'src/kernel/bam.lua')
-rw-r--r--src/kernel/bam.lua34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/kernel/bam.lua b/src/kernel/bam.lua
index 2dc724e..43328e6 100644
--- a/src/kernel/bam.lua
+++ b/src/kernel/bam.lua
@@ -1,19 +1,23 @@
-local kernel_settings = TableDeepCopy(common_settings)
+return function(s, common)
+ local kernel_settings = TableDeepCopy(s.common_settings)
-kernel_settings.cc.includes:Add("src/common/include/kogata",
- "src/kernel/include")
+ kernel_settings.cc.includes:Add("src/common/include/kogata",
+ "src/kernel/include")
-kernel_settings.link.flags:Add("-T src/kernel/linker.ld")
+ kernel_settings.link.flags:Add("-T src/kernel/linker.ld")
-kernel_source = {
- Collect('src/kernel/core/*.s'),
- Collect('src/kernel/dev/*.s'),
- Collect('src/kernel/core/*.c'),
- Collect('src/kernel/dev/*.c'),
- Collect('src/kernel/fs/*.c'),
- Collect('src/kernel/user/*.c'),
-}
-kernel_obj = Compile(kernel_settings, kernel_source)
-
-kernel = Link(kernel_settings, "kernel", {kernel_obj, common_libc, common_libkogata})
+ kernel_source = {
+ Collect('src/kernel/core/*.s'),
+ Collect('src/kernel/dev/*.s'),
+ Collect('src/kernel/core/*.c'),
+ Collect('src/kernel/dev/*.c'),
+ Collect('src/kernel/fs/*.c'),
+ Collect('src/kernel/user/*.c'),
+ }
+ obj = Compile(kernel_settings, kernel_source)
+ return {
+ obj = obj,
+ bin = Link(kernel_settings, "kernel", {obj, common.libc, common.libkogata})
+ }
+end