diff --git a/.murdock b/.murdock
index 89644b7ef59da7334c0f42c6d43e99dbc844b15a..3fd0bd4a5463abb86064c76afcda1e6e9b2cd843 100755
--- a/.murdock
+++ b/.murdock
@@ -73,10 +73,12 @@ compile() {
     [ "$board" = "makefile_broken" ] && error "$0: Makefile in \"$appdir\" seems to be broken!"
 
     # set build directory. CI ensures only one build at a time in $(pwd).
-    rm -rf build
     export BINDIR="$(pwd)/build"
     export PKGDIRBASE="${BINDIR}/pkg"
 
+    # Pre-build cleanup
+    rm -rf ${BINDIR}
+
     [ -n "$DWQ_WORKER" ] && \
         echo "-- running on worker ${DWQ_WORKER} thread ${DWQ_WORKER_THREAD}, build number $DWQ_WORKER_BUILDNUM."
 
@@ -96,10 +98,13 @@ compile() {
         fi
     fi
 
-    test -d ${BINDIR} && echo "-- build directory size: $(du -sh ${BINDIR} | cut -f1)"
+    if [ -d ${BINDIR} ]
+    then
+        echo "-- build directory size: $(du -sh ${BINDIR} | cut -f1)"
 
-    # cleanup
-    rm -Rf build
+        # cleanup
+        rm -rf ${BINDIR}
+    fi
 
     return $RES
 }