COMP: provide Allmake script for wmake tools

- convenient when bootstrapping some systems
This commit is contained in:
Mark Olesen 2018-11-22 09:35:17 +01:00
parent 775c64c7cd
commit 973a940028
6 changed files with 58 additions and 40 deletions

View File

@ -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" ]

View File

@ -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

View File

@ -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

View File

@ -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

9
wmake/src/Allmake Executable file
View File

@ -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
#------------------------------------------------------------------------------

View File

@ -26,7 +26,7 @@
# wmakeFilesAndOptions
#
# Usage
# wmakeFilesAndOptions
# wmakeFilesAndOptions [-help]
#
# Description
# Scan current directory for directories and source files
@ -39,53 +39,38 @@ 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
}
#------------------------------------------------------------------------------
# Parse arguments and options
#------------------------------------------------------------------------------
while [ "$#" -gt 0 ]
# Find -help anywhere
for i
do
case "$1" in
-h | -help*) # Provide immediate help
usage
;;
*)
# No options/arguments
usage "unexpected options/arguments: $*"
;;
esac
case "$i" in (-h | -help*) usage ;; esac
done
#------------------------------------------------------------------------------
# No options/arguments
[ "$#" -eq 0 ] || {
echo "$Script error: Unexpected options/arguments: $*" 1>&2
exit 1
}
if [ -e Make ]
then
echo "$Script error: Make directory already exists" 1>&2
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