mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
wrmo: Add -a/-all/all option to remove .o files from all platforms rather than just the current platform.
This commit is contained in:
19
wmake/wrmo
19
wmake/wrmo
@ -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
|
||||||
# wrmo [file]
|
# wrmo [-a | -all | all] [file]
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Remove all .o files from the object directory tree corresponding to the
|
# Remove all .o files from the object directory tree corresponding to the
|
||||||
# current source derectory or remove only the .o file corresponding to the
|
# current source derectory or remove only the .o file corresponding to the
|
||||||
# optionally specified [file].
|
# optionally specified [file]. With the -a/-all/all option the .o files
|
||||||
|
# are removed for all platforms rather than just the current platform.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
Script=${0##*/}
|
Script=${0##*/}
|
||||||
@ -53,12 +54,20 @@ 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
|
||||||
-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 +87,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 .o files ..."
|
echo "removing all .o files ..."
|
||||||
|
|||||||
Reference in New Issue
Block a user