2021-01-02 00:13:11 +01:00
|
|
|
TAG="<sh-elf-gcc>"
|
|
|
|
|
2022-08-19 15:23:21 +02:00
|
|
|
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)"
|
|
|
|
|
2021-01-02 00:13:11 +01:00
|
|
|
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
|
|
|
|
}
|
2021-01-02 22:48:31 +01:00
|
|
|
|
|
|
|
# Names of binutils tools, otherwise GCC assumes sh3eb-elf-*
|
|
|
|
export AR_FOR_TARGET=sh-elf-ar
|
|
|
|
export AS_FOR_TARGET=sh-elf-as
|
|
|
|
export DLLTOOL_FOR_TARGET=sh-elf-dlltool
|
|
|
|
export LD_FOR_TARGET=sh-elf-ld
|
|
|
|
export NM_FOR_TARGET=sh-elf-nm
|
|
|
|
export OBJCOPY_FOR_TARGET=sh-elf-objcopy
|
|
|
|
export OBJDUMP_FOR_TARGET=sh-elf-objdump
|
|
|
|
export RANLIB_FOR_TARGET=sh-elf-ranlib
|
|
|
|
export READELF_FOR_TARGET=sh-elf-readelf
|
|
|
|
export STRIP_FOR_TARGET=sh-elf-strip
|