libraries/libnx/build.sh

53 lines
822 B
Bash
Raw Normal View History

#!/usr/bin/bash
# This file is part of noxos and licensed under the MIT open source license
set -e
workspace_setup() {
echo " --> Setting up workspace"
mkdir -pv build
mkdir -pv build/cmake
echo ""
}
check_toolchain() {
echo " --> Checking Toolchain"
hash gcc
echo " |--> found gcc"
hash ld
echo " |--> found ld"
hash nasm
echo " |--> found nasm"
hash cmake
echo " |--> found cmake"
echo " --> All checks passed"
}
libnx_build() {
echo " --> Building the noxos standard library"
cd build/cmake
cmake -S ../.. -B .
make
cd ../..
echo ""
}
echo "!=====[ libnx build script ]=====!"
case $1 in
"check")
check_toolchain
;;
*)
workspace_setup
libnx_build
;;
esac
echo "!=====[ Finished ]=====!"