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 "========================================"
echo echo
# Compile wmake tools # Compile tools for wmake
(cd "${WM_DIR:-wmake}/src" && make) "${WM_DIR:?}"/src/Allmake
# Compile ThirdParty libraries and applications # Compile ThirdParty libraries and applications
if [ -d "$WM_THIRD_PARTY_DIR" ] if [ -d "$WM_THIRD_PARTY_DIR" ]

View File

@ -7,8 +7,20 @@
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM, licensed under GNU General Public License # This file is part of OpenFOAM.
# <http://www.gnu.org/licenses/>. #
# 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 # Script
# makeFiles # makeFiles
@ -19,7 +31,7 @@
# Usage : makeFiles # Usage : makeFiles
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
dirToString=$WM_DIR/platforms/$WM_ARCH$WM_COMPILER/dirToString dirToString="$WM_DIR/platforms/$WM_ARCH$WM_COMPILER"/dirToString
if [ -r Make/files ] if [ -r Make/files ]
then then

View File

@ -7,8 +7,20 @@
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM, licensed under GNU General Public License # This file is part of OpenFOAM.
# <http://www.gnu.org/licenses/>. #
# 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 # Script
# makeOptions # makeOptions

View File

@ -30,7 +30,7 @@ checkEnv()
for check in WM_PROJECT_DIR WM_OPTIONS WM_DIR for check in WM_PROJECT_DIR WM_OPTIONS WM_DIR
do do
eval test "\$$check" || { 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 exit 1
} }
done 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 # wmakeFilesAndOptions
# #
# Usage # Usage
# wmakeFilesAndOptions # wmakeFilesAndOptions [-help]
# #
# Description # Description
# Scan current directory for directories and source files # Scan current directory for directories and source files
@ -39,53 +39,38 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: $Script Usage: $Script [-help]
Scan current directory for directories and source files Scans current directory for directories and source files and constructs
and construct 'Make/files' and 'Make/options' the 'Make/files' and 'Make/options' files.
USAGE USAGE
exit 1 exit 1
} }
# Find -help anywhere
#------------------------------------------------------------------------------ for i
# Parse arguments and options
#------------------------------------------------------------------------------
while [ "$#" -gt 0 ]
do do
case "$1" in case "$i" in (-h | -help*) usage ;; esac
-h | -help*) # Provide immediate help
usage
;;
*)
# No options/arguments
usage "unexpected options/arguments: $*"
;;
esac
done done
#------------------------------------------------------------------------------
# No options/arguments
[ "$#" -eq 0 ] || {
echo "$Script error: Unexpected options/arguments: $*" 1>&2
exit 1
}
if [ -e Make ] if [ -e Make ]
then then
echo "$Script error: Make directory already exists" 1>&2 echo "$Script error: Make directory already exists" 1>&2
exit 1 exit 1
fi 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 mkdir Make
[ -e Make/files ] || $WM_DIR/scripts/makeFiles [ -e Make/files ] || "${0%/*}"/scripts/makeFiles
[ -e Make/options ] || $WM_DIR/scripts/makeOptions [ -e Make/options ] || "${0%/*}"/scripts/makeOptions
exit 0 # clean exit exit 0 # clean exit