aboutsummaryrefslogtreecommitdiff
path: root/src/sysbin
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-13 22:31:46 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-13 22:31:46 +0200
commit360da84db0d7165c84d160b518f39cd16006c758 (patch)
treea6fea5da753ec4ac5a37237cefda52801f9647ac /src/sysbin
parent27a6934ea3073c3eaf782cc7615ce4ed0dbf4a18 (diff)
downloadkogata-360da84db0d7165c84d160b518f39cd16006c758.tar.gz
kogata-360da84db0d7165c84d160b518f39cd16006c758.zip
Migrate to BAM build tool
Diffstat (limited to 'src/sysbin')
-rw-r--r--src/sysbin/bam.lua23
-rw-r--r--src/sysbin/giosrv/Makefile12
-rw-r--r--src/sysbin/init/Makefile12
-rw-r--r--src/sysbin/init/main.c4
-rw-r--r--src/sysbin/login/Makefile12
-rw-r--r--src/sysbin/shell/Makefile12
-rw-r--r--src/sysbin/terminal/Makefile12
7 files changed, 25 insertions, 62 deletions
diff --git a/src/sysbin/bam.lua b/src/sysbin/bam.lua
new file mode 100644
index 0000000..819bc43
--- /dev/null
+++ b/src/sysbin/bam.lua
@@ -0,0 +1,23 @@
+local function sysbin_settings(name)
+ local s = TableDeepCopy(user_settings)
+ s.link.flags:Add("-T src/sysbin/linker.ld",
+ "-Xlinker -Map=build/" .. name .. ".map")
+ return s
+end
+
+local function sysbin_exe(name)
+ local s = sysbin_settings(name)
+
+ local src = Collect('src/sysbin/' .. name .. '/*.c')
+ local obj = Compile(s, src)
+
+ return Link(s, name .. ".bin", {obj, libkogata})
+end
+
+sysbin = {
+ sysbin_exe('init'),
+ sysbin_exe('giosrv'),
+ sysbin_exe('login'),
+ sysbin_exe('terminal'),
+ sysbin_exe('shell'),
+}
diff --git a/src/sysbin/giosrv/Makefile b/src/sysbin/giosrv/Makefile
deleted file mode 100644
index 9adc05a..0000000
--- a/src/sysbin/giosrv/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-OBJ = main.o
-
-LIB = ../../lib/libkogata/libkogata.lib
-
-CFLAGS = -I ./include -I ../../common/include -I ../../lib/include
-
-LDFLAGS = -T ../linker.ld -Xlinker -Map=giosrv.map
-
-OUT = giosrv.bin
-
-include ../../rules.make
diff --git a/src/sysbin/init/Makefile b/src/sysbin/init/Makefile
deleted file mode 100644
index e56d4c0..0000000
--- a/src/sysbin/init/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-OBJ = main.o
-
-LIB = ../../lib/libkogata/libkogata.lib
-
-CFLAGS = -I ./include -I ../../common/include -I ../../lib/include
-
-LDFLAGS = -T ../linker.ld -Xlinker -Map=init.map
-
-OUT = init.bin
-
-include ../../rules.make
diff --git a/src/sysbin/init/main.c b/src/sysbin/init/main.c
index f1cb77a..36ca884 100644
--- a/src/sysbin/init/main.c
+++ b/src/sysbin/init/main.c
@@ -156,7 +156,7 @@ int main(int argc, char **argv) {
btree_t *cmdline = read_cmdline();
if (cmdline == 0) PANIC("[init] Could not parse cmdline");
- // Later : setup config: and read config file
+ // setup config:
if (btree_find(cmdline, "config") == 0) {
PANIC("[init] No config=xxx option specified on command line");
} else {
@@ -170,7 +170,7 @@ int main(int argc, char **argv) {
if (!ok) PANIC("[init] Could not setup config:");
}
- // Setup sys: partition
+ // Setup sys:
setup_sys();
// Setup GIP channel for communication between giosrv and login
diff --git a/src/sysbin/login/Makefile b/src/sysbin/login/Makefile
deleted file mode 100644
index 1232fa8..0000000
--- a/src/sysbin/login/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-OBJ = main.o
-
-LIB = ../../lib/libkogata/libkogata.lib
-
-CFLAGS = -I ./include -I ../../common/include -I ../../lib/include
-
-LDFLAGS = -T ../linker.ld -Xlinker -Map=login.map
-
-OUT = login.bin
-
-include ../../rules.make
diff --git a/src/sysbin/shell/Makefile b/src/sysbin/shell/Makefile
deleted file mode 100644
index 80d1009..0000000
--- a/src/sysbin/shell/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-OBJ = main.o
-
-LIB = ../../lib/libkogata/libkogata.lib
-
-CFLAGS = -I ./include -I ../../common/include -I ../../lib/include
-
-LDFLAGS = -T ../linker.ld -Xlinker -Map=shell.map
-
-OUT = shell.bin
-
-include ../../rules.make
diff --git a/src/sysbin/terminal/Makefile b/src/sysbin/terminal/Makefile
deleted file mode 100644
index cdbf2fe..0000000
--- a/src/sysbin/terminal/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-OBJ = main.o
-
-LIB = ../../lib/libkogata/libkogata.lib
-
-CFLAGS = -I ./include -I ../../common/include -I ../../lib/include
-
-LDFLAGS = -T ../linker.ld -Xlinker -Map=terminal.map
-
-OUT = terminal.bin
-
-include ../../rules.make