From 6c0e142409d57c11fc03bcbc3d79a4d646f885ff Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 30 Oct 2023 22:54:28 +0100 Subject: Meta: Create a simple toolchain compilation script --- meta/build.sh | 1 + meta/kernel.sh | 1 + meta/toolchain.sh | 13 +++++++++++++ meta/userland.sh | 3 +++ 4 files changed, 18 insertions(+) create mode 100755 meta/toolchain.sh (limited to 'meta') 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 -- cgit v1.2.3