#!/bin/sh

set -xe

bt="buildtype=release"

if [ "$1" = "debug" ]; then
  bt="buildtype=debug"
fi

make -B all_lz4
make -B all_kernel        "$bt"
make -B all_libsystem     "$bt"
make -B all_liballoc      "$bt"
make -B all_libprocess    "$bt"
make -B all_libterminal   "$bt"
make -B all_libstring     "$bt"
make -B all_libkb         "$bt"
make -B all_libaux        "$bt"
make -B all_libarena      "$bt"
make -B all_libioutil     "$bt"
make -B all_libmath       "$bt"
make -B all_libfat        "$bt"
make -B all_libdebugconsole "$bt"
make -B all_apps          "$bt"
make -B all_dist
./aux/limine_iso_amd64.sh
