#!/bin/bash # # Copyright (c) 2026, Apollo Telephone Laboratories. # Provided under the BSD-3 clause. # MAKE=make # # Check if a list of deps are installed on the host system # # $@: Dep list to check # check_deps() { for dep in $@ do printf "Checking if $dep is installed... " which $dep &>/dev/null if [ $? -ne 0 ] then echo "no" echo "fatal: Please install '$dep'!" exit 1 fi echo "yes" done } build_prepare() { check_deps \ rsync \ make \ clang \ rdar source dev/build.env } # # Build a directory with MAKE # # $1: Directory to build # $2: Target name # build_dir() { pushd $1 echo "[*] Building $1..." $MAKE popd } # # Begin the actual build process # build() { mkdir -p out build_dir \ boot \ "bootloader" } build_prepare build