feature (build system): added toolchain check to build.sh

This commit is contained in:
antifallobst 2023-03-10 12:48:57 +01:00
parent cebae95696
commit 088efd4b56
1 changed files with 33 additions and 5 deletions

View File

@ -30,6 +30,27 @@ workspace_setup() {
echo "" 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"
hash xorriso
echo " |--> found xorriso"
hash qemu-system-x86_64
echo " |--> found qemu"
[ ! -d "/usr/share/ovmf/x64/" ] && echo "OVMF binaries not found!" && exit 255
echo " |--> found ovmf"
echo " --> All checks passed"
}
kernel_build() { kernel_build() {
echo " --> Building kernel" echo " --> Building kernel"
@ -88,11 +109,18 @@ generate_image() {
echo "!=====[ NoxOS build script ]=====!" echo "!=====[ NoxOS build script ]=====!"
case $1 in
"check")
check_toolchain
;;
*)
workspace_setup workspace_setup
kernel_build kernel_build
[ ! -d "build/limine" ] && limine_install [ ! -d "build/limine" ] && limine_install
generate_initial_ramdisk generate_initial_ramdisk
generate_image generate_image
;;
esac
echo "!=====[ Finished ]=====!" echo "!=====[ Finished ]=====!"