diff --git a/Allwmake b/Allwmake index 702d3c3ff05da3289ab713f8f8f75b2047b0a04e..fd6c8acc2c2fc40d19bdf0cbe27d08da99bd5cdd 100755 --- a/Allwmake +++ b/Allwmake @@ -30,8 +30,8 @@ echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}" echo "========================================" echo -# Compile wmake tools -(cd "${WM_DIR:-wmake}/src" && make) +# Compile tools for wmake +"${WM_DIR:?}"/src/Allmake # Compile ThirdParty libraries and applications if [ -d "$WM_THIRD_PARTY_DIR" ] diff --git a/wmake/scripts/makeFiles b/wmake/scripts/makeFiles index 6cea689aac6f8cf3da57094f16d3dc7a10878b38..07806c923873e8356250dfe2ee49503182605ab2 100755 --- a/wmake/scripts/makeFiles +++ b/wmake/scripts/makeFiles @@ -7,8 +7,20 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # License -# This file is part of OpenFOAM, licensed under GNU General Public License -# <http://www.gnu.org/licenses/>. +# 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 <http://www.gnu.org/licenses/>. # # Script # makeFiles @@ -19,7 +31,7 @@ # Usage : makeFiles # #------------------------------------------------------------------------------ -dirToString=$WM_DIR/platforms/$WM_ARCH$WM_COMPILER/dirToString +dirToString="$WM_DIR/platforms/$WM_ARCH$WM_COMPILER"/dirToString if [ -r Make/files ] then diff --git a/wmake/scripts/makeOptions b/wmake/scripts/makeOptions index 6101889ec5ac41b58aeaf1cc41155c05c2b2b9cc..db1585485ddd7500a9219e1e1580993ec1223ab4 100755 --- a/wmake/scripts/makeOptions +++ b/wmake/scripts/makeOptions @@ -7,8 +7,20 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # License -# This file is part of OpenFOAM, licensed under GNU General Public License -# <http://www.gnu.org/licenses/>. +# 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 <http://www.gnu.org/licenses/>. # # Script # makeOptions diff --git a/wmake/scripts/wmakeFunctions b/wmake/scripts/wmakeFunctions index d25a88116733633b399805fac5c958653574c969..b4800baeaf912fa5dd4ca511ffcdffe1046dde9c 100644 --- a/wmake/scripts/wmakeFunctions +++ b/wmake/scripts/wmakeFunctions @@ -30,7 +30,7 @@ checkEnv() for check in WM_PROJECT_DIR WM_OPTIONS WM_DIR do eval test "\$$check" || { - echo "$Script error: environment variable \$$check not set" 1>&2 + echo "$Script error: Environment variable \$$check not set" 1>&2 exit 1 } done diff --git a/wmake/src/Allmake b/wmake/src/Allmake new file mode 100755 index 0000000000000000000000000000000000000000..2505c3c414bc705bedd4fd8e29cd71dc7d0c8b39 --- /dev/null +++ b/wmake/src/Allmake @@ -0,0 +1,9 @@ +#!/bin/sh +cd "${0%/*}" || exit 1 # Run from this directory +[ -d "${WM_DIR:?}" ] || exit 1 # Require WM_DIR + +# Compile tools for wmake + +make + +#------------------------------------------------------------------------------ diff --git a/wmake/wmakeFilesAndOptions b/wmake/wmakeFilesAndOptions index 488a80add9ca755bcc8c549d6be95f70c1cbc77e..19bb5858064a76875391b8b9ccbc7459f78452b7 100755 --- a/wmake/wmakeFilesAndOptions +++ b/wmake/wmakeFilesAndOptions @@ -26,7 +26,7 @@ # wmakeFilesAndOptions # # Usage -# wmakeFilesAndOptions +# wmakeFilesAndOptions [-help] # # Description # Scan current directory for directories and source files @@ -39,32 +39,28 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<<USAGE -Usage: $Script +Usage: $Script [-help] - Scan current directory for directories and source files - and construct 'Make/files' and 'Make/options' +Scans current directory for directories and source files and constructs +the 'Make/files' and 'Make/options' files. USAGE exit 1 } +# Find -help anywhere +for i +do + case "$i" in (-h | -help*) usage ;; esac +done -#------------------------------------------------------------------------------ -# Parse arguments and options #------------------------------------------------------------------------------ -while [ "$#" -gt 0 ] -do - case "$1" in - -h | -help*) # Provide immediate help - usage - ;; - *) - # No options/arguments - usage "unexpected options/arguments: $*" - ;; - esac -done +# No options/arguments +[ "$#" -eq 0 ] || { + echo "$Script error: Unexpected options/arguments: $*" 1>&2 + exit 1 +} if [ -e Make ] then @@ -72,20 +68,9 @@ then exit 1 fi -#------------------------------------------------------------------------------ -# Check environment variables -#------------------------------------------------------------------------------ -for check in WM_DIR WM_ARCH WM_COMPILER -do - eval test "\$$check" || { - echo "$Script error: environment variable \$$check not set" 1>&2 - exit 1 - } -done - mkdir Make -[ -e Make/files ] || $WM_DIR/scripts/makeFiles -[ -e Make/options ] || $WM_DIR/scripts/makeOptions +[ -e Make/files ] || "${0%/*}"/scripts/makeFiles +[ -e Make/options ] || "${0%/*}"/scripts/makeOptions exit 0 # clean exit