From e698061ebaf0cf1a10c11c51a6c6cd46a331959c Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 13 Sep 2025 14:53:43 -0400 Subject: initial commit Signed-off-by: Ian Moffett --- src/tools/bootstrap | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 src/tools/bootstrap (limited to 'src/tools/bootstrap') diff --git a/src/tools/bootstrap b/src/tools/bootstrap new file mode 100755 index 0000000..66664fa --- /dev/null +++ b/src/tools/bootstrap @@ -0,0 +1,61 @@ +#!/bin/bash +set -e + +SYSTEM_NAME="$(uname -s)" +MAKE="make" +GIT="git" +GCC="gcc" +CLANG="clang" + +if [ "$SYSTEM_NAME" = "OpenBSD" ] +then + MAKE="$(which gmake)" +fi + +# arg0: Output path. +# arg1: Command for downloading +try_fetch() { + if [[ -d $2 ]] + then + echo "try_fetch: Skipping $2: already exists" + else + ${@:1} + fi +} + +fetch() { + mkdir -p cc/ + try_fetch "git clone https://github.com/limine-bootloader/limine.git --branch=v9.3.0-binary --depth=1" "shim/limine" + try_fetch "git clone https://github.com/EthosZero/toolchain --depth=1" "cc/toolchain" +} + +build_limine() { + $MAKE -C shim/limine/ +} + +build_omar() { + $MAKE -C tools/omar +} + +build() { + build_limine + build_omar +} + +echo "----------------------------------" +echo +echo " Fetching sources... " +echo +echo "----------------------------------" +echo -e "\n" + +fetch # Fetch sources + +echo "----------------------------------" +echo +echo " Building sources... " +echo +echo "----------------------------------" +echo -e "\n" + +build # Build sources -- cgit v1.2.3