diff --git a/wmake/scripts/wcleanBuild b/wmake/scripts/wcleanObjects similarity index 94% rename from wmake/scripts/wcleanBuild rename to wmake/scripts/wcleanObjects index b1651db0b1cc0639ca9a2142734e86bc58b592d9..a99871ca0a22c653ce763fea6e65c8e5ddf1992c 100755 --- a/wmake/scripts/wcleanBuild +++ b/wmake/scripts/wcleanObjects @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -11,14 +11,14 @@ # <http://www.gnu.org/licenses/>. # # Script -# wcleanBuild +# wcleanBuild, wcleanPlatform # # Usage # wcleanBuild <option | platform> [.. <option | platform>] # # Description # Deletes the specified 'build/' object files directories from the -# the project top-level 'build/' directory $WM_PROJECT_DIR. +# project top-level 'build/' directory $WM_PROJECT_DIR. # # special platforms # - 'all' removes all platforms. @@ -57,7 +57,7 @@ Usage: ${0##*/} <option | platform> [.. <option | platform>] options: -a, -all Same as 'all' - -c, -current Use \$WM_OPTIONS ($WM_OPTIONS) + -curr, -current Use \$WM_OPTIONS ($WM_OPTIONS) -comp, -compiler Use \$WM_ARCH\$WM_COMPILER* ($WM_ARCH$WM_COMPILER) -compiler=NAME Use \$WM_ARCH<NAME>* ($WM_ARCH<NAME>*) -h, -help Print the usage @@ -124,7 +124,7 @@ do echo break # Removed everything - can stop now ;; - -c | -current | current) + -curr | -current | current) name="$WM_OPTIONS" ;; -comp | -compiler | compiler) diff --git a/wmake/wclean b/wmake/wclean index 0a1e0bf696e649bbe0fe6be82021fcf5e10f105d..e583ea76891d3e585fb76e5ada714c7e99ab1b15 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -34,10 +34,8 @@ # lnInclude directories generated for libraries. # #------------------------------------------------------------------------------ -Script=${0##*/} # Note: need 'Script' for some functions in wmakeFunctions - -# Source the wmake functions -. ${0%/*}/scripts/wmakeFunctions +Script=${0##*/} # Use 'Script' for error messages in wmakeFunctions +. ${0%/*}/scripts/wmakeFunctions # Source wmake functions usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done diff --git a/wmake/wcleanBuild b/wmake/wcleanBuild index a0376ef976460fb07a2c3470bd7e10b128cd4911..b0d19ae4ee33d0fe47995de06a07b325e20c358b 120000 --- a/wmake/wcleanBuild +++ b/wmake/wcleanBuild @@ -1 +1 @@ -scripts/wcleanBuild \ No newline at end of file +scripts/wcleanObjects \ No newline at end of file diff --git a/wmake/wcleanPlatform b/wmake/wcleanPlatform index a0376ef976460fb07a2c3470bd7e10b128cd4911..b0d19ae4ee33d0fe47995de06a07b325e20c358b 120000 --- a/wmake/wcleanPlatform +++ b/wmake/wcleanPlatform @@ -1 +1 @@ -scripts/wcleanBuild \ No newline at end of file +scripts/wcleanObjects \ No newline at end of file diff --git a/wmake/wdep b/wmake/wdep index 346494d7625f4c7068c409e52760a3ba40970279..c9670d3b17ab1c07027a660f66aef84ff7f53e75 100755 --- a/wmake/wdep +++ b/wmake/wdep @@ -35,10 +35,8 @@ # the first occurrence. # #------------------------------------------------------------------------------ -Script=${0##*/} - -# Source the wmake functions -. ${0%/*}/scripts/wmakeFunctions +Script=${0##*/} # Use 'Script' for error messages in wmakeFunctions +. ${0%/*}/scripts/wmakeFunctions # Source wmake functions usage() { exec 1>&2 @@ -92,7 +90,7 @@ sourceFile=$1 if [ ! -e "$sourceFile" ] then - sourceFile=$(find . -name $sourceFile -print -quit) + sourceFile=$(find . -name "$sourceFile" -print -quit) if [ -z "$sourceFile" ] then echo "$Script: cannot find source file $1" 1>&2 diff --git a/wmake/wmake b/wmake/wmake index 85054ecd542746903b3b2933a4736078ca508cbd..c462e95824e7a55bde8b9eb23b860ec78456eca5 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd. #------------------------------------------------------------------------------- # License # This file is part of OpenFOAM. @@ -53,10 +53,8 @@ # wclean, wcleanPlatform, wcleanLnIncludeAll # #------------------------------------------------------------------------------ -Script=${0##*/} # Note: need 'Script' for some functions in wmakeFunctions - -# Source the wmake functions -. ${0%/*}/scripts/wmakeFunctions +Script=${0##*/} # Use 'Script' for error messages in wmakeFunctions +. ${0%/*}/scripts/wmakeFunctions # Source wmake functions usage() { exec 1>&2 @@ -106,13 +104,11 @@ make="make" #------------------------------------------------------------------------------ -# Set nCores to the number of cores on the local machine +# Set nCores to the number of cores on the machine nCores=0 allCores() { - nCores=$(egrep -c "^processor" /proc/cpuinfo 2>/dev/null) || \ - nCores=$(getconf _NPROCESSORS_ONLN 2>/dev/null) || \ - nCores=1 + nCores=$(getconf _NPROCESSORS_ONLN 2>/dev/null) || nCores=1 : ${nCores:=1} } @@ -132,7 +128,7 @@ do usage ;; -s | -silent) - export WM_QUIET=1 + export WM_QUIET=true ;; -a | -all | all) all=all @@ -146,10 +142,7 @@ do test $# -ge 2 && expr $2 + 1 > /dev/null 2>&1 \ && shift && nCores=$1 - if [ "$nCores" = 0 ] - then - allCores - fi + [ "$nCores" = 0 ] && allCores export WM_NCOMPPROCS=$nCores echo "Compiling enabled on $WM_NCOMPPROCS cores" ;; diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll index 369f2d10be86069b2686916eb35e0c1232977729..bfb4fe3d4854fee3e5bd03910066a9ba8ca19411 100755 --- a/wmake/wmakeLnIncludeAll +++ b/wmake/wmakeLnIncludeAll @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. #------------------------------------------------------------------------------- # License # This file is part of OpenFOAM. @@ -79,10 +79,7 @@ do test $# -ge 2 && expr $2 + 1 > /dev/null 2>&1 \ && shift && nCores=$1 - if [ "$nCores" = 0 ] - then - nCores=1 - fi + [ "$nCores" = 0 ] && nCores=1 ;; # Parallel compilation on specified number of cores -j[1-9]*) diff --git a/wmake/wmakePrintBuild b/wmake/wmakePrintBuild index 4e727a74384774dd376538b2f3af98b351f1f4d9..c6b21dbaabd4cd49d269730247e7f461b1093fe3 100755 --- a/wmake/wmakePrintBuild +++ b/wmake/wmakePrintBuild @@ -17,14 +17,12 @@ # Print the version used when building the project # #------------------------------------------------------------------------------ -Script=${0##*/} - usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<<USAGE -Usage: $Script [OPTION] +Usage: ${0##*/} [OPTION] options: -check check the git head commit vs. \$WM_PROJECT_DIR/.build (exit code 0 for no changes) diff --git a/wmake/wrmdep b/wmake/wrmdep index 119aecc86d212920bd0fdf1b50bc747c8db511ed..692f20fd0d902ff193848b735f88c3ef42af0ab8 100755 --- a/wmake/wrmdep +++ b/wmake/wrmdep @@ -52,10 +52,8 @@ # $WM_PROJECT_DIR. # #------------------------------------------------------------------------------ -Script=${0##*/} # Note: need 'Script' for some functions in wmakeFunctions - -# Source the wmake functions -. ${0%/*}/scripts/wmakeFunctions +Script=${0##*/} # Use 'Script' for error messages in wmakeFunctions +. ${0%/*}/scripts/wmakeFunctions # Source wmake functions usage() { exec 1>&2 diff --git a/wmake/wrmo b/wmake/wrmo index 517cdee925367a1b39616c205733124fa07698f0..71d2b4ca71af096b37d1d674426c35b8fec79ff2 100755 --- a/wmake/wrmo +++ b/wmake/wrmo @@ -35,10 +35,8 @@ # are removed for all platforms rather than just the current platform. # #------------------------------------------------------------------------------ -Script=${0##*/} # Note: need 'Script' for some functions in wmakeFunctions - -# Source the wmake functions -. ${0%/*}/scripts/wmakeFunctions +Script=${0##*/} # Use 'Script' for error messages in wmakeFunctions +. ${0%/*}/scripts/wmakeFunctions # Source wmake functions usage() { exec 1>&2