From 623ac104f76b91bbef918bed092ec78aa3af705f Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 10 Jan 2015 22:33:39 +0000 Subject: [PATCH] Replaced rmoall with wrmo Description Remove all .o files from the object directory tree corresponding to the current source derectory or remove only the .o file corresponding to the optionally specified [file]. --- bin/rmclassall | 55 -------------- bin/rmoall | 55 -------------- wmake/{wdepFunctions => wmakeFunctions} | 0 wmake/wrmdep | 4 +- wmake/wrmo | 98 +++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 112 deletions(-) delete mode 100755 bin/rmclassall delete mode 100755 bin/rmoall rename wmake/{wdepFunctions => wmakeFunctions} (100%) create mode 100755 wmake/wrmo diff --git a/bin/rmclassall b/bin/rmclassall deleted file mode 100755 index 75cca2c3bb..0000000000 --- a/bin/rmclassall +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | -#------------------------------------------------------------------------------- -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . -# -# Script -# rmclassall -# -# Description -# remove all .class files -#------------------------------------------------------------------------------ - -# default is pwd -if [ "$#" -eq 0 ] -then - set -- . -elif [ "$1" = "-h" -o "$1" = "-help" ] -then - echo "Usage: ${0##*/} [dir1] .. [dirN]" - echo " remove all .class files" - exit 1 -fi - - -for i -do - if [ -d "$i" ] - then - echo "removing all .class files: $i" - find $i -name '*.class' -print | xargs -t rm 2>/dev/null - else - echo "no directory: $i" 1>&2 - fi -done - -#------------------------------------------------------------------------------ diff --git a/bin/rmoall b/bin/rmoall deleted file mode 100755 index 7c93aba937..0000000000 --- a/bin/rmoall +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | -#------------------------------------------------------------------------------- -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . -# -# Script -# rmoall -# -# Description -# remove all .o files -#------------------------------------------------------------------------------ - -# default is pwd -if [ "$#" -eq 0 ] -then - set -- . -elif [ "$1" = "-h" -o "$1" = "-help" ] -then - echo "Usage: ${0##*/} [dir1] .. [dirN]" - echo " remove all .o files" - exit 1 -fi - - -for i -do - if [ -d "$i" ] - then - echo "removing all .o files: $i" - find $i -name '*.o' -print | xargs -t rm 2>/dev/null - else - echo "no directory: $i" 1>&2 - fi -done - -#------------------------------------------------------------------------------ diff --git a/wmake/wdepFunctions b/wmake/wmakeFunctions similarity index 100% rename from wmake/wdepFunctions rename to wmake/wmakeFunctions diff --git a/wmake/wrmdep b/wmake/wrmdep index 531f08590f..e77fa9d0bb 100755 --- a/wmake/wrmdep +++ b/wmake/wrmdep @@ -33,8 +33,8 @@ #------------------------------------------------------------------------------ Script=${0##*/} -# Source the wdep functions -. ${0%/*}/wdepFunctions +# Source the wmakeFunctions +. ${0%/*}/wmakeFunctions usage() { exec 1>&2 diff --git a/wmake/wrmo b/wmake/wrmo new file mode 100755 index 0000000000..3a207695af --- /dev/null +++ b/wmake/wrmo @@ -0,0 +1,98 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation +# \\/ M anipulation | +#------------------------------------------------------------------------------- +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# Script +# wrmo [file] +# +# Description +# Remove all .o files from the object directory tree corresponding to the +# current source derectory or remove only the .o file corresponding to the +# optionally specified [file]. +# +#------------------------------------------------------------------------------ +Script=${0##*/} + +# Source the wmakeFunctions +. ${0%/*}/wmakeFunctions + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat< + +USAGE + exit 1 +} + + +#------------------------------------------------------------------------------ +# Parse arguments and options +#------------------------------------------------------------------------------ + +while [ "$#" -gt 0 ] +do + case "$1" in + -h | -help) + usage + ;; + -*) + usage "unknown option: '$*'" + ;; + *) + break + ;; + esac +done + +# Check environment variables +checkEnv + + +#------------------------------------------------------------------------------ +# Remove the selected .o files from the object tree +#------------------------------------------------------------------------------ + +findObjectDir . + +if [ "$#" -eq 0 ] +then + echo "removing all .o files ..." + find $objectsDir -name '*.o' -print | xargs -t rm 2>/dev/null +else + echo "removing .o files corresponding to $1 ..." + rm $objectsDir/${1%%.*}.o +fi + + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script usage + + +#------------------------------------------------------------------------------