+ # work out correct make command
+ case "$tree" in
+ waf*)
+ MAKECOMMAND="./waf"
+ ;;
+ *)
+ MAKECOMMAND="$MAKE"
+ if [ x"$MAKECOMMAND" = x ]; then
+ MAKECOMMAND=make
+ fi
+ ;;
+ esac
+
+ MMTIME=$MAXTIME
+ # some trees don't need as much time
+ case "$tree" in
+ rsync | tdb | talloc | libreplace | ccache* | waf*)
+ if [ "$compiler" != "checker" ]; then
+ MMTIME=`expr $MMTIME / 5`
+ fi
+ ;;
+ esac
+
+ # special build for some trees
+ case "$tree" in
+ waf*)
+ ./waf distclean && ./waf configure build
+ ;;
+ esac
+
+
+ for t in $*; do
+ if [ x"$BUILD_FARM_NUM_JOBS" = x ]; then
+ echo "$MAKECOMMAND $t"
+ $builddir/timelimit $MMTIME "$MAKECOMMAND" "$t"
+ status=$?
+ else
+ # we can parallelize everything and all targets
+ if [ x"$t" = xeverything ] || [ x"$t" = xall]; then
+ echo "$MAKECOMMAND" "-j$BUILD_FARM_NUM_JOBS" "$t"
+ $builddir/timelimit $MMTIME "$MAKECOMMAND" "-j$BUILD_FARM_NUM_JOBS" "$t"
+ status=$?
+ else
+ echo "$MAKECOMMAND $t"
+ $builddir/timelimit $MMTIME "$MAKECOMMAND" "$t"
+ status=$?
+ fi
+ fi
+
+ if [ $status != 0 ]; then
+ case "$t" in
+ test|check|installcheck)
+ ;;
+ *)
+ #run again with V=1, so we see failed commands
+ $builddir/timelimit $MMTIME "$MAKECOMMAND" "$t" V=1
+ status=$?
+ ;;
+ esac
+ fi
+
+ if [ $status != 0 ]; then
+ return $status;
+ fi
+
+ done
+
+ return 0
+}
+
+
+############################
+# do the coverage report
+############################
+
+action_lcovreport() {
+ if [ "$LCOV_REPORT" = "yes" ]; then
+ case "$tree" in
+ lorikeet-heimdal*)
+ lcov --directory $builddir --capture --output-file $builddir/$tree.lcov.info
+ ;;
+ samba_3_master*)
+ lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
+ ;;
+ samba_4*)
+ # rm -f heimdal/lib/*/{lex,parse,sel-lex}.{gcda,gcno}
+ lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
+ ;;
+ *)
+ lcov --base-directory $builddir --directory $builddir --capture --output-file $builddir/$tree.lcov.info
+ ;;
+ esac
+ genhtml -o $builddir/coverage $builddir/$tree.lcov.info
+ rc=$?
+ echo "return code: $rc"
+ else
+ echo "LCOV_REPORT not set and lcovreport asked"
+ echo "Most probably an error please fix !"
+ return 1
+ fi
+}