STYLE: limit foamEtcFile -show-api to querying the META-INFO/api-info

- simplifies code, covers most cases.
  Can use wmake -show-api or wmakeBuildInfo to query the make rules.

STYLE: Allwmake script adjustments

- use bin/foamEtcFile instead of relying on PATH.
  The make environment may not have the OpenFOAM bin/ in it.

- simpler shell syntax
This commit is contained in:
Mark Olesen
2020-02-12 17:09:36 +01:00
parent 8ab37e13e2
commit d483123cef
10 changed files with 101 additions and 140 deletions

View File

@ -6,13 +6,14 @@ wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
echo " Check your OpenFOAM environment and installation"
exit 1
}
[ -d "$WM_PROJECT_DIR" -a -f "$WM_PROJECT_DIR/etc/bashrc" ] || {
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
echo "Argument parse error";
else
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments
fi
#------------------------------------------------------------------------------
# Preamble. Report tools or at least the mpirun location
@ -45,11 +46,11 @@ echo
"${WM_DIR:-wmake}"/src/Allmake
# Compile ThirdParty libraries and applications
if [ -d "$WM_THIRD_PARTY_DIR" ]
if [ -d "$WM_THIRD_PARTY_DIR" ] && [ -x "$WM_THIRD_PARTY_DIR/Allwmake" ]
then
"$WM_THIRD_PARTY_DIR/Allwmake"
"$WM_THIRD_PARTY_DIR"/Allwmake
else
echo "No ThirdParty directory found - skipping"
echo "No ThirdParty directory, or missing Allwmake - skipping"
fi
echo "========================================"
@ -74,7 +75,7 @@ fi
# Count files in given directory. Ignore "Test-*" binaries.
_foamCountDirEntries()
{
(cd "$1" 2>/dev/null && find -mindepth 1 -maxdepth 1 -type f 2>/dev/null) |\
(cd "$1" 2>/dev/null && find . -mindepth 1 -maxdepth 1 -type f 2>/dev/null) |\
sed -e '\@/Test-@d' | wc -l
}
@ -86,10 +87,10 @@ echo " ${WM_PROJECT_DIR##*/}"
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
echo " api = $(foamEtcFile -show-api 2>/dev/null)"
echo " patch = $(foamEtcFile -show-patch 2>/dev/null)"
echo " bin = $(_foamCountDirEntries $FOAM_APPBIN) entries"
echo " lib = $(_foamCountDirEntries $FOAM_LIBBIN) entries"
echo " api = $(bin/foamEtcFile -show-api 2>/dev/null)"
echo " patch = $(bin/foamEtcFile -show-patch 2>/dev/null)"
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
echo
echo "========================================"