summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-30 22:54:28 +0100
committerAnton Kling <anton@kling.gg>2023-10-31 00:18:38 +0100
commit6c0e142409d57c11fc03bcbc3d79a4d646f885ff (patch)
treefa925bac319193d203b8697592dc18c117ca617c /meta
parent34342b53c39aa3f22326b6e4eda960cc20cfa0f0 (diff)
Meta: Create a simple toolchain compilation script
Diffstat (limited to 'meta')
-rwxr-xr-xmeta/build.sh1
-rwxr-xr-xmeta/kernel.sh1
-rwxr-xr-xmeta/toolchain.sh13
-rwxr-xr-xmeta/userland.sh3
4 files changed, 18 insertions, 0 deletions
diff --git a/meta/build.sh b/meta/build.sh
index 39d778a..66b093b 100755
--- a/meta/build.sh
+++ b/meta/build.sh
@@ -1,4 +1,5 @@
#!/bin/sh
scriptdir="$(dirname "$0")"
cd "$scriptdir"
+export PATH="$PATH:$(pwd)/../toolchain/bin/bin"
./kernel.sh && ./userland.sh && ./sync.sh
diff --git a/meta/kernel.sh b/meta/kernel.sh
index 4cd02b8..dd74999 100755
--- a/meta/kernel.sh
+++ b/meta/kernel.sh
@@ -1,4 +1,5 @@
#!/bin/sh
scriptdir="$(dirname "$0")"
cd "$scriptdir"
+export PATH="$PATH:$(pwd)/../toolchain/bin/bin"
make -C ../kernel
diff --git a/meta/toolchain.sh b/meta/toolchain.sh
new file mode 100755
index 0000000..c50008f
--- /dev/null
+++ b/meta/toolchain.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# This script compiles the operating system toolchain(GCC, Binutils)
+scriptdir="$(dirname "$0")"
+cd "$scriptdir"
+cd ..
+
+# Install the headers from LibC
+mkdir -p ./sysroot/usr/include/
+cp -r ./userland/libc/include ./sysroot/usr/
+
+cd ./toolchain/
+./build-binutils.sh
+./build-gcc.sh
diff --git a/meta/userland.sh b/meta/userland.sh
index 1686023..94ab441 100755
--- a/meta/userland.sh
+++ b/meta/userland.sh
@@ -1,9 +1,12 @@
#!/bin/sh
scriptdir="$(dirname "$0")"
cd "$scriptdir"
+export PATH="$PATH:$(pwd)/../toolchain/bin/bin"
cd ..
make -C ./userland/libgui
make -C ./userland/libc
+mkdir -p ./sysroot/lib
+make install -C ./userland/libc
make -C ./userland/sh
make -C ./userland/terminal
make -C ./userland/snake