diff --git a/Allwmake b/Allwmake index 67c26d0a3d5d0648233760bae48df245f629e294..3f6a7523d28865d3799297f12fa5eaff278df40b 100755 --- a/Allwmake +++ b/Allwmake @@ -2,8 +2,9 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments +. wmake/scripts/AllwmakeParseArguments +# Perform various checks wmakeCheckPwd "$WM_PROJECT_DIR" || { echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR" echo " The environment variables are inconsistent with the installation." diff --git a/applications/Allwmake b/applications/Allwmake index d851254b23a2f237fc5d08e17369e5b2bd25365c..2b725832bf081db818ea8421f9c6a17aa05b271e 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -2,8 +2,9 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments +. ../wmake/scripts/AllwmakeParseArguments +# Perform various checks 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." diff --git a/src/Allwmake b/src/Allwmake index 5e6eedf3fcc346a7dc6736365a8ac9a51506f682..29d16a152882c7dbdf855cca5975d46a70cb653a 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -2,8 +2,9 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments +. ../wmake/scripts/AllwmakeParseArguments +# Perform various checks 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." diff --git a/wmake/scripts/AllwmakeParseArguments b/wmake/scripts/AllwmakeParseArguments index a985064effb564da3a768fac92f73e0d2bfda98a..0736876adf056671d55f43c2266a8010a4bd2e2b 100644 --- a/wmake/scripts/AllwmakeParseArguments +++ b/wmake/scripts/AllwmakeParseArguments @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -34,6 +34,15 @@ #------------------------------------------------------------------------------ Script=${0##*/} +if [ -z "$WM_PROJECT_DIR" ] +then + echo "$Script error: The OpenFOAM environment is not set." + echo " Check the OpenFOAM entries in your dot-files and source them." + echo " If in doubt, please read:" + echo " http://openfoam.org/download/source/setting-environment" + exit 1 +fi + usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done