sh-elf-binutils/util.sh

28 lines
538 B
Bash

TAG="<sh-elf-binutils>"
if command -v gmake >/dev/null 2>&1; then
MAKE_COMMAND=gmake
else
MAKE_COMMAND=make
fi
if ! command -v fxsdk >/dev/null 2>&1; then
echo "$TAG error: fxSDK is not installed"
exit 1
elif ! fxsdk path sysroot >/dev/null 2>&1; then
echo "$TAG error: need fxSDK ≥ 2.9 with 'path' command"
exit 1
fi
SYSROOT="$(fxsdk path sysroot)"
run_quietly() {
out="$1"
shift 1
"$@" >$out 2>&1
if [[ "$?" != 0 ]]; then
echo "$tag error: build failed, please check $(pwd)/$out o(x_x)o"
exit 1
fi
}