diff --git a/wmake/wmake b/wmake/wmake
index 33c9de9..1ed18b7 100755
--- a/wmake/wmake
+++ b/wmake/wmake
@@ -153,7 +153,7 @@ do
         # Parallel compilation on all cores of local machine
         -j)
             useAllCores
-            test $# -ge 2 && (($2 + 1)) > /dev/null 2>&1 \
+            test $# -ge 2 && expr $2 + 1 > /dev/null 2>&1 \
                 && shift && export WM_NCOMPPROCS=$1
             echo "Compiling enabled on $WM_NCOMPPROCS cores"
             ;;
@@ -222,11 +222,11 @@ then
     WM_NCOMPPROCS=$(wmakeScheduler -count) || unset WM_NCOMPPROCS
 fi
 
-if [ "$WM_NCOMPPROCS" ]
+if [ -n "$WM_NCOMPPROCS" ]
 then
     parOpt="-j $WM_NCOMPPROCS"
 
-    if [ "$WM_NCOMPPROCS" -gt 1 ] && [ ! "$MAKEFLAGS" ]
+    if [ "$WM_NCOMPPROCS" -gt 1 ] && [ -z "$MAKEFLAGS" ]
     then
         lockDir=$HOME/.$WM_PROJECT/.wmake
 
diff --git a/wmake/wrmdep b/wmake/wrmdep
index 644fab0..70154f5 100755
--- a/wmake/wrmdep
+++ b/wmake/wrmdep
@@ -92,6 +92,18 @@ error() {
     exit 1
 }
 
+removeDepFiles()
+{
+    if [ "$#" -eq 1 ]
+    then
+        find "$1" -name '*.dep' -print0 | xargs -0t rm 2>/dev/null
+    elif [ "$#" -eq 2 ]
+    then
+        find "$1" -name '*.dep' -exec grep -q "$2" '{}' \; \
+             -exec rm '{}' \; -print
+    fi
+}
+
 #------------------------------------------------------------------------------
 # Parse arguments and options
 #------------------------------------------------------------------------------
@@ -144,20 +156,37 @@ files)
 
     findObjectDir .
 
-    # With the -a/-all option replace the current platform with a wildcard
-    if [ "$all" = "all" ]
-    then
-        objectsDir=$(echo "$objectsDir" | sed s%"$WM_OPTIONS"%*% )
-    fi
-
+    # First give the verbose information for the current searching method
     if [ "$#" -eq 0 ]
     then
         echo "removing all .dep files ..."
-        find "$objectsDir" -name '*.dep' -print0 | xargs -0t rm 2>/dev/null
     else
         echo "removing .dep files referring to $1 ..."
-        find "$objectsDir" -name '*.dep' -exec grep -q "$1" '{}' \; \
-             -exec rm '{}' \; -print
+    fi
+
+    # With the -a/-all option replace the current platform with a wildcard
+    if [ "$all" = "all" ]
+    then
+
+        # Handle the removal on all platforms for consistency
+        mainPath=${objectsDir%%/$WM_OPTIONS*}
+        objSubPath=${objectsDir##*$WM_OPTIONS/}
+
+        for pathEntry in "$mainPath"/*
+        do
+            if [ -e "$pathEntry/$objSubPath" ]
+            then
+                # Note:
+                # If $1 is empty, it should still work for the default method
+                removeDepFiles "$pathEntry/$objSubPath" $1
+            fi
+        done
+
+    else
+
+        # Handle only the removal for the current WM_OPTIONS
+        removeDepFiles $@
+
     fi
 
     ;;
