diff --git a/wmake/wclean b/wmake/wclean index f8d475a33..9a963605f 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -38,7 +38,7 @@ Script=${0##*/} # Source the wmake functions # shellcheck source=scripts/wmakeFunctions -. ${0%/*}/scripts/wmakeFunctions +. "${0%/*}/scripts/wmakeFunctions" error() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done diff --git a/wmake/wdep b/wmake/wdep index 64db3f623..6dd0ad27b 100755 --- a/wmake/wdep +++ b/wmake/wdep @@ -39,7 +39,7 @@ Script=${0##*/} # Source the wmake functions # shellcheck source=scripts/wmakeFunctions -. ${0%/*}/scripts/wmakeFunctions +. "${0%/*}/scripts/wmakeFunctions" usage() { cat< /dev/null 2>&1 \ + [ $# -ge 2 ] && [ "$2" -gt 0 ] > /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 644fab084..b2a9ecd66 100755 --- a/wmake/wrmdep +++ b/wmake/wrmdep @@ -55,7 +55,7 @@ Script=${0##*/} # Source the wmake functions # shellcheck source=scripts/wmakeFunctions -. ${0%/*}/scripts/wmakeFunctions +. "${0%/*}/scripts/wmakeFunctions" usage() { cat</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 "$objectsDir" "$1" + fi ;; diff --git a/wmake/wrmo b/wmake/wrmo index a0fe20bd0..9adb8ab0d 100755 --- a/wmake/wrmo +++ b/wmake/wrmo @@ -39,7 +39,7 @@ Script=${0##*/} # Source the wmake functions # shellcheck source=scripts/wmakeFunctions -. ${0%/*}/scripts/wmakeFunctions +. "${0%/*}/scripts/wmakeFunctions" usage() { cat<