summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorChloe M. <chloe@aptel.org>2026-09-03 01:22:45 +0000
committerChloe M. <chloe@aptel.org>2026-09-03 02:49:49 +0000
commite758e02f0781e45f91674aeb5c2259ce4add3b88 (patch)
treee6ea80f93bbad0f93b6c859d126f144af12ad32f /build.sh
initial commitmain
Signed-off-by: Chloe M. <chloe@aptel.org>
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh64
1 files changed, 64 insertions, 0 deletions
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