#!/bin/sh

. /etc/profile
. /etc/flenv

echo "INFO: plus-build..."

pushd $flpath/bin

buildlist=`ls -1 [12]*.sh`

for target in $buildlist ; do
	if [ ! -e "$target.done" ]; then
		$target || { echo "ERROR: failed to build: $target" ; popd ; exit 1 ;}
		touch $target.done
	else
		echo "$target.done exists, skipping $target"
	fi
done

if [ $flinstpath != $mingwpath ] ; then
	cp -rf $flinstpath/* $mingwpath
fi

popd

echo "INFO: plus-build finished"
