#!/bin/sh

T=$1

TMP=`mktemp -t -d tpkg-temp.XXXXXXXXXX`
cd $TMP

tpkg-install-libc $T 2>&1 | tee -a log.$T
tpkg-make $T 2>&1 | tee -a log.$T 

cd binutils*
debuild  2>&1 | tee -a ../log.$T
debi 2>&1 | tee -a ../log.$T

cd ../gcc*
rm -rf ../binutils*
debuild  2>&1 | tee -a ../log.$T
debi 2>&1 | tee -a ../log.$T

cd ../gdb*
rm -rf ../gcc*
debuild  2>&1 | tee -a ../log.$T
debi 2>&1 | tee -a ../log.$T


rm -r $TMP
