Skip to content
Snippets Groups Projects
Commit 3e530711 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: unify cd, check for the cwd and error message

parent aaeab426
No related merge requests found
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmakeCheckPwd "$WM_PROJECT_DIR" || {
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
# Run from OPENFOAM top-level directory only
cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Allwmake error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
echo "Error (${0##*/}) : FOAM_EXT_LIBBIN not set"
echo " Check your OpenFOAM environment and installation"
exit 1
}
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
# Compile wmake support applications
(cd wmake/src && make)
......
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/applications"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
# Run from OPENFOAM applications/ directory only
cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/applications" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR/applications"
echo " Check your OpenFOAM environment and installation"
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Allwmake error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
echo "Error (${0##*/}) : FOAM_EXT_LIBBIN not set"
echo " Check your OpenFOAM environment and installation"
exit 1
}
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
wmake -all $targetType solvers
wmake -all $targetType utilities
......
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
[ -d "$WM_PROJECT_DIR" ] || {
echo " Error: WM_PROJECT_DIR directory does not exist"
echo " Check the OpenFOAM entries in your dot-files and source them."
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
echo "Error (${0##*/}) : no \$WM_PROJECT_DIR found"
echo " Check your OpenFOAM environment and installation"
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
exit 1
}
......
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/src"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
# Run from OPENFOAM src/ directory only
cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/src" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR/src"
echo " Check your OpenFOAM environment and installation"
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Allwmake error: FOAM_EXT_LIBBIN not set"
echo " Check the OpenFOAM entries in your dot-files and source them."
echo "Error (${0##*/}) : FOAM_EXT_LIBBIN not set"
echo " Check your OpenFOAM environment and installation"
exit 1
}
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
# Update OpenFOAM version strings if required
wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment