From a0ba496158d08aad6f60c9efe8b43930fbfaac51 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Fri, 10 Jun 2022 11:53:53 +0200
Subject: [PATCH] STYLE: add note about compilation location into Allwmake

---
 Allwclean             |  2 +-
 Allwmake              | 11 +++--------
 applications/Allwmake |  9 ++-------
 src/Allwmake          |  9 ++-------
 4 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/Allwclean b/Allwclean
index 04cca3f..05bebd0 100755
--- a/Allwclean
+++ b/Allwclean
@@ -1,5 +1,5 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
+cd "${0%/*}" || exit                                # Run from this directory
 
 #------------------------------------------------------------------------------
 
diff --git a/Allwmake b/Allwmake
index e80e426..6cffdf2 100755
--- a/Allwmake
+++ b/Allwmake
@@ -1,15 +1,12 @@
 #!/bin/sh
-cd "${0%/*}" || exit                            # Run from this directory
+cd "${0%/*}" || exit                                # Run from this directory
 targetType=libso
-# Parse arguments for library compilation
-if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
-then  . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments
-fi
+. "${WM_PROJECT_DIR:?}"/wmake/scripts/AllwmakeParseArguments
 
 #------------------------------------------------------------------------------
 # Build into FOAM_USER_{APPBIN,LIBBIN} unless otherwise specified with
 # -prefix or FOAM_MODULE_{APPBIN,LIBBIN} env varables
-
+#------------------------------------------------------------------------------
 moduleName="avalanche"
 
 #------------------------------------------------------------------------------
@@ -22,11 +19,9 @@ echo "  ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
 echo "  prefix = ${FOAM_MODULE_PREFIX:-default (user)}"
 echo
 
-
 src/Allwmake $targetType $*
 applications/Allwmake $targetType $*
 
-
 # Some summary information
 echo
 date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
diff --git a/applications/Allwmake b/applications/Allwmake
index 8a80421..877b20b 100755
--- a/applications/Allwmake
+++ b/applications/Allwmake
@@ -1,11 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-
-# Parse arguments for library compilation
-if [ -f $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments ]
-then  . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-fi
-
+cd "${0%/*}" || exit                                # Run from this directory
+. "${WM_PROJECT_DIR:?}"/wmake/scripts/AllwmakeParseArguments
 #------------------------------------------------------------------------------
 
 wmake -all $targetType solvers
diff --git a/src/Allwmake b/src/Allwmake
index 055b8ce..3286e60 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -1,11 +1,6 @@
 #!/bin/sh
-cd ${0%/*} || exit 1                        # Run from this directory
-
-# Parse arguments for library compilation
-if [ -f $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments ]
-then  . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-fi
-
+cd "${0%/*}" || exit                                # Run from this directory
+. "${WM_PROJECT_DIR:?}"/wmake/scripts/AllwmakeParseArguments
 #------------------------------------------------------------------------------
 
 wmake $targetType avalanche
-- 
GitLab