From e758e02f0781e45f91674aeb5c2259ce4add3b88 Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Thu, 3 Sep 2026 01:22:45 +0000 Subject: initial commit Signed-off-by: Chloe M. --- build.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 build.sh (limited to 'build.sh') diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..839b138 --- /dev/null +++ b/build.sh @@ -0,0 +1,64 @@ +#!/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 -- cgit v1.2.3