libraries/libnxdrv/build.sh

45 lines
760 B
Bash
Executable File

#!/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
echo ""
}
check_toolchain() {
echo " --> Checking Toolchain"
hash gcc
echo " |--> found gcc"
hash ld
echo " |--> found ld"
echo " --> All checks passed"
}
libnxdrv_build() {
echo " --> Building the noxos standard library driver interface"
gcc src/libnxdrv.c -o build/libnxdrv.so -Iinc -nostdlib -nolibc -Bsymbolic --shared
echo ""
}
echo "!=====[ libnx build script ]=====!"
case $1 in
"check")
check_toolchain
;;
*)
workspace_setup
libnxdrv_build
;;
esac
echo "!=====[ Finished ]=====!"