#!/bin/sh
. ./environ.sh
if [[ "$TARGET" == ""  || "$PREFIX" == "" ]] ; then
	echo "You need to set: TARGET and PREFIX"; exit 0;
fi
export PATH=$PATH:$PREFIX/$TARGET
cd gcc_build && rm -rf *
../gcc_sources/configure -v --quiet --target=$TARGET --prefix=$PREFIX \
   --with-gnu-as --with-gnu-ld --enable-languages=c \
   --enable-interwork --enable-multilib --with-newlib \
   --with-headers=${PREFIX}/newlib_sources/newlib/libc/include
make all install 2>&1 | tee make.log
cd ..

