sh-elf-vhex/scripts/binutils/build.sh

68 lines
1.1 KiB
Bash
Raw Normal View History

#! /usr/bin/env bash
verbose=false
#
# Help screen
#
2021-11-16 17:43:29 +01:00
help() {
cat << OEF
2021-11-16 17:43:29 +01:00
Script for the building step of binutils for the Vhex kernel.
Usage $0 [options...]
Configurations:
-h, --help Display this help
--verbose Display extra information during the building step
OEF
exit 0
}
#
2021-11-16 17:43:29 +01:00
# Parse arguments
#
for arg; do case "$arg" in
--help | -h) help;;
--verbose) verbose=true;;
*)
echo "error: unreconized argument '$arg', giving up." >&2
exit 1
esac; done
#
# Building step
#
TAG='<sh-elf-vhex-binutils>'
2021-11-16 17:43:29 +01:00
# Check that the configuration step has been effectuated
2021-11-16 17:43:29 +01:00
if [[ ! -d ../../build/binutils/build ]]; then
echo "error: Are you sure to have configured binutils ? it seems that" >&2
echo " the build directory is missing..." >&2
exit 1
fi
cd ../../build/binutils/build
2021-11-16 17:43:29 +01:00
# Import some helpers
2021-11-15 17:04:56 +01:00
source ../../../scripts/utils.sh
2021-11-15 17:04:56 +01:00
2021-11-16 17:43:29 +01:00
# Build part
echo "$TAG Compiling binutils (usually 5-10 minutes)..."
2021-11-15 17:04:56 +01:00
$quiet $make_cmd -j"$cores"
echo "$TAG Installing to local folder..."
$quiet $make_cmd install-strip
2021-11-16 17:43:29 +01:00
exit 0