openfoam/Allwmake-plugins
Mark Olesen b7ce6bf69d CONFIG: inject -no-recursion into the argument list (#3198)
- sourcing a file with '-no-recursion "$@"' does not work with dash.
  Need to modify the argument list directly.
2025-03-19 15:28:57 +01:00

40 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
set -- -no-recursion "$@" # Parse arguments only
# Run from OPENFOAM top-level directory only
wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
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
fi
#------------------------------------------------------------------------------
# Additional components
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM plugins disabled (prefix=${FOAM_MODULE_PREFIX})"
echo "Can be built separately:"
echo
echo " ./Allwmake-plugins -prefix=..."
echo
echo ========================================
echo
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/plugins" 2>/dev/null && wmake -all )
esac
#------------------------------------------------------------------------------