wrmdep: Add -a/-all/all option to removed for all platforms rather than just the current platform.

This commit is contained in:
Henry
2015-01-10 23:18:34 +00:00
parent 623ac104f7
commit 9aff064bec

View File

@ -23,12 +23,13 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# #
# Script # Script
# wrmdep [file] # wrmdep [-a | -all | all] [file]
# #
# Description # Description
# Remove all .dep files from the object directory tree corresponding to the # Remove all .dep files from the object directory tree corresponding to the
# current source derectory or remove only the .dep files referring to the # current source derectory or remove only the .dep files referring to the
# optionally specified [file]. # optionally specified [file]. With the -a/-all/all option the dep files
# are removed for all platforms rather than just the current platform.
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
Script=${0##*/} Script=${0##*/}
@ -40,9 +41,11 @@ usage() {
exec 1>&2 exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: $Script [file] Usage: $Script [-a | -all | all] [file]
Remove all .dep files or remove .dep files referring to <file> Remove all .dep files or remove .dep files referring to <file>
With the -a/-all/all option the dep files are removed for all platform
rather than just the current platform.
USAGE USAGE
exit 1 exit 1
@ -53,12 +56,21 @@ USAGE
# Parse arguments and options # Parse arguments and options
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Default to processing only the current platform
all=
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
# Print help
-h | -help) -h | -help)
usage usage
;; ;;
# Non-stop compilation, ignoring errors
-a | -all | all)
all="all"
shift
;;
-*) -*)
usage "unknown option: '$*'" usage "unknown option: '$*'"
;; ;;
@ -78,6 +90,12 @@ checkEnv
findObjectDir . 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
if [ "$#" -eq 0 ] if [ "$#" -eq 0 ]
then then
echo "removing all .dep files ..." echo "removing all .dep files ..."