#
#  Link a program using the linker command file generated by XDC
#
link="$1"
shift
suffix=""
prefix=""
cmdFile=""
for c in $*; do
    case $c in
        *.xdl ) prefix=$suffix; suffix=""; cmdFile=$c ;;
        *     ) suffix=$suffix"$c " ;;
    esac
done
if [ ! -r "$cmdFile" ]; then
    echo "error: no linker command file specified";
    exit 1;
fi

$link  $prefix `cat $cmdFile` $suffix

