diff --git a/tutorials/Allclean b/tutorials/Allclean
index bbaca026e2..486d999d45 100755
--- a/tutorials/Allclean
+++ b/tutorials/Allclean
@@ -3,6 +3,15 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/LogFunctions # Tutorial log-file functions
echo "--------"
+
+# Remove old build/ directory
+buildDir="$WM_PROJECT_DIR/build/${WM_OPTIONS}/${PWD##*/}"
+if [ -d "$buildDir" ]
+then
+ echo "Removing old build directory: $buildDir" 1>&2
+ rm -rf $buildDir
+fi
+
removeLogs
echo "Cleaning tutorials ..."
diff --git a/tutorials/Alltest b/tutorials/Alltest
index 39da77fb7a..88123f35f6 100755
--- a/tutorials/Alltest
+++ b/tutorials/Alltest
@@ -7,20 +7,8 @@
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
-# This file is part of OpenFOAM.
-#
-# OpenFOAM is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenFOAM. If not, see .
+# This file is part of OpenFOAM, licensed under GNU General Public License
+# .
#
# Script
# Alltest
@@ -101,9 +89,8 @@ done
#------------------------------------------------------------------------------
-
#
-# set up a default scheme on all schemes
+# Set up a default scheme on all schemes
#
setDefaultFvSchemes()
{
@@ -180,6 +167,14 @@ then
rm -rf $TEST_RUN_DIR
fi
+# Remove old build/ directory
+buildDir="$WM_PROJECT_DIR/build/${WM_OPTIONS}/${TEST_RUN_DIR##*/}"
+if [ -d "$buildDir" ]
+then
+ echo "Removing old build directory: $buildDir" 1>&2
+ rm -rf $buildDir
+fi
+
echo "Modifying ${MAIN_CONTROL_DICT}" 1>&2
if [ -e ${MAIN_CONTROL_DICT}.orig ]
then