diff --git a/Allwmake b/Allwmake
index c6e1ca4f8c8ca6fd451e909e46f0ac72f436a895..431140a92de2136f11eeb4d57a9b0accad9d20c1 100755
--- a/Allwmake
+++ b/Allwmake
@@ -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 "========================================"
 
diff --git a/applications/Allwmake b/applications/Allwmake
index ad65e1411204ee8ee4f6f6c0ec9114a030c1992d..005fec25701567ed9fa59103c013afabb5a22757 100755
--- a/applications/Allwmake
+++ b/applications/Allwmake
@@ -6,13 +6,14 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" 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
 
 #------------------------------------------------------------------------------
 
diff --git a/bin/foamEtcFile b/bin/foamEtcFile
index 024c16a33b687c2ba7056c557ac021caa4f5bafa..544ca7b543a79826c5ddf87dd75323f4e1167a29 100755
--- a/bin/foamEtcFile
+++ b/bin/foamEtcFile
@@ -7,14 +7,13 @@
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 #     Copyright (C) 2011-2016 OpenFOAM Foundation
-#     Copyright (C) 2017-2018 OpenCFD Ltd.
+#     Copyright (C) 2017-2020 OpenCFD Ltd.
 #------------------------------------------------------------------------------
 # License
-#     This file is part of OpenFOAM, licensed under GNU General Public License
-#     <http://www.gnu.org/licenses/>.
+#     This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
 #
 # Script
-#     foamEtcFile
+#     bin/foamEtcFile
 #
 # Description
 #     Locate user/group/other file as per '#includeEtc'.
@@ -61,8 +60,8 @@ options:
   -config           Add config directory prefix for shell type:
                         with -csh* for a config.csh/ prefix
                         with -sh*  for a config.sh/ prefix
-  -show-api         Print api value from wmake/rules, or meta-info and exit
-  -show-patch       Print patch value from meta-info and exit
+  -show-api         Print META-INFO api value and exit
+  -show-patch       Print META-INFO patch value and exit
   -with-api=NUM     Specify alternative api value to search with
   -quiet (-q)       Suppress all normal output
   -silent (-s)      Suppress stderr, except -csh-verbose, -sh-verbose output
@@ -109,54 +108,17 @@ groupDir="${WM_PROJECT_SITE:-$projectDir/site}"     # As per foamVersion.H
 
 #-------------------------------------------------------------------------------
 
-# The API locations. See wmake/wmakeBuildInfo
-rulesFile="$projectDir/wmake/rules/General/general"
-metaInfoDir="$projectDir/META-INFO"
-
-# Get api from rules/General/general
-#
-# Failure modes:
-# - No api information (can't find file etc).
-#   -> Fatal for building, but could be OK for a stripped down version
-#
-# Fallback. Get from api-info
-#
-getApi()
+# Get a value from META-INFO/api-info
+# $1 : keyword
+getApiInfo()
 {
-    local value
-
-    value="$(sed -ne '/^ *#/!{ /WM_VERSION.*OPENFOAM=/{ s@^.*OPENFOAM= *\([0-9][0-9]*\).*@\1@p; q }}' $rulesFile 2>/dev/null)"
-    if [ -z "$value" ] && [ -f "$metaInfoDir/api-info" ]
-    then
-        # Fallback. Get from api-info
-        value="$(sed -ne 's@^ *api *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
-    fi
-
-    if [ -n "$value" ]
-    then
-        echo "$value"
-    else
-        return 1
-    fi
-}
-
-
-# Get patch from meta-info / api-info
-#
-# Failure modes:
-# - No patch information (can't find file etc).
-#
-getPatchLevel()
-{
-    local value
-
-    # Fallback. Get from api-info
-    value="$(sed -ne 's@^ *patch *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
+    value="$(sed -ne 's@^'"$1"' *= *\([0-9][0-9]*\).*@\1@p' "$projectDir"/META-INFO/api-info 2>/dev/null)"
 
     if [ -n "$value" ]
     then
         echo "$value"
     else
+        echo "Could not determine OPENFOAM '$1' value" 1>&2
         return 1
     fi
 }
@@ -174,14 +136,12 @@ do
     -h | -help*)
         printHelp
         ;;
-    -show-api)
-        # Show API and exit
-        getApi
+    -show-api)  # Show API and exit
+        getApiInfo api
         exit $?
         ;;
-    -show-patch)
-        # Show patch level and exit
-        getPatchLevel
+    -show-patch)  # Show patch level and exit
+        getApiInfo patch
         exit $?
         ;;
     -with-api=*)
@@ -257,7 +217,7 @@ done
 #-------------------------------------------------------------------------------
 
 # Establish the API value
-[ -n "$projectApi" ] || projectApi=$(getApi)
+[ -n "$projectApi" ] || projectApi=$(getApiInfo api)
 
 
 # Split arguments into filename (for searching) and trailing bits for shell eval
diff --git a/bin/foamGetDict b/bin/foamGetDict
index 06e0adceb7c96a221b64e9b86736963be4f0b625..ebe5f304d95c0ea748559ecdd377a07096cce9c6 100755
--- a/bin/foamGetDict
+++ b/bin/foamGetDict
@@ -7,7 +7,7 @@
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 #     Copyright (C) 2018 OpenFOAM Foundation
-#     Copyright (C) 2019 OpenCFD Ltd.
+#     Copyright (C) 2019-2020 OpenCFD Ltd.
 #------------------------------------------------------------------------------
 # License
 #     This file is part of OpenFOAM.
@@ -166,7 +166,7 @@ fi
 # No api specified -with-api= or from environment (FOAM_API)
 if [ -z "$projectApi" ]
 then
-    projectApi="$(foamEtcFile -show-api 2>/dev/null)"
+    projectApi="$("$projectDir"/bin/foamEtcFile -show-api 2>/dev/null)"
 fi
 
 
diff --git a/src/Allwmake b/src/Allwmake
index 9fa030779a1b2c4f11e450e4fb335dea6682544f..7f42ca5cbb2738cbfb36f7eea91dd8203712f970 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -6,13 +6,14 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" 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
 
 #------------------------------------------------------------------------------
 
diff --git a/src/Allwmake-scan b/src/Allwmake-scan
index 2d12e096bd6c1295e6df21510363e5679070b158..07833797a04641a6dd9003df7efd5074660fa910 100755
--- a/src/Allwmake-scan
+++ b/src/Allwmake-scan
@@ -1,18 +1,8 @@
 #!/bin/sh
 # Allwmake with scan-build (clang)
 
-command -v scan-build > /dev/null || {
-    exec 1>&2
-    echo "No scan-build found, stopping"
-    echo
-    exit 2
-}
-
-comp_cc="$(command -v "$(wmake -show-c)")"
-comp_cxx="$(command -v "$(wmake -show-cxx)")"
-
-set -x
-scan-build --use-cc="$comp_cc" --use-c++="$comp_cxx" \
+scan-build \
+    --use-cc="$(wmake -show-path-c)" \
+    --use-c++="$(wmake -show-path-cxx)" \
     ./Allwmake "$@"
-
 #------------------------------------------------------------------------------
diff --git a/src/parallel/decompose/AllwmakeLnInclude b/src/parallel/decompose/AllwmakeLnInclude
index db014338bafa3d1a811ce5ef428a05afd1b26dab..5043fba1f2b05bb448570c74e30256db3c6a6ecb 100755
--- a/src/parallel/decompose/AllwmakeLnInclude
+++ b/src/parallel/decompose/AllwmakeLnInclude
@@ -1,5 +1,7 @@
 #!/bin/sh
-cd "${0%/*}" || exit    # Run from this directory
+cd "${0%/*}" || exit                                # Run from this directory
+
+#------------------------------------------------------------------------------
 
 wmakeLnInclude -u decompositionMethods
 wmakeLnInclude -u kahipDecomp
diff --git a/wmake/scripts/AllwmakeParseArguments b/wmake/scripts/AllwmakeParseArguments
index 80da8a5b75be06e741e96e07da02cb000577ad5a..eaac63e1a9333f40e5b5f92f51b71d7a31692275 100644
--- a/wmake/scripts/AllwmakeParseArguments
+++ b/wmake/scripts/AllwmakeParseArguments
@@ -6,11 +6,10 @@
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 #     Copyright (C) 2014-2017 OpenFOAM Foundation
-#     Copyright (C) 2019 OpenCFD Ltd.
+#     Copyright (C) 2019-2020 OpenCFD Ltd.
 #------------------------------------------------------------------------------
 # License
-#     This file is part of OpenFOAM, licensed under GNU General Public License
-#     <http://www.gnu.org/licenses/>.
+#     This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
 #
 # File
 #     wmake/scripts/AllwmakeParseArguments
@@ -22,14 +21,26 @@
 #     # Parse the arguments by sourcing this script
 #     . ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
 #
+# Parsed options (make)
+#     -k | -keep-going | -non-stop
+#     -j | -jN | -j N
+#
+# Parsed options (wmake)
+#     -debug
+#     -q | -queue
+#
+# Parsed options (special)
+#     -l | -log | -log=FILE
+#
 #------------------------------------------------------------------------------
-
-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."
+# Check environment
+[ -d "$WM_PROJECT_DIR" ] || {
+    exec 1>&2
+    echo "$Script error: The OpenFOAM environment not set or incorrect."
+    echo "    Check OpenFOAM entries in your dot-files and source them."
     exit 1
-fi
+}
+
 usage() {
     exec 1>&2
     while [ "$#" -ge 1 ]; do echo "$1"; shift; done
diff --git a/wmake/wmake b/wmake/wmake
index 8bc070eb4b710f9647951f9da34812f0390d70ea..bfbaecae28886947ef8260a420c274e49861dc2a 100755
--- a/wmake/wmake
+++ b/wmake/wmake
@@ -79,7 +79,7 @@ then
 cat<<HELP_FULL
   -debug            Define c++DBUG='-DFULLDEBUG -g -O0' as override
   -no-scheduler     Disable scheduled parallel compilation
-  -show-api         Print api value
+  -show-api         Print api value (from Make rules)
   -show-ext-so      Print shared library extension (with '.' separator)
   -show-c           Print C compiler value
   -show-cflags      Print C compiler flags
diff --git a/wmake/wmakeBuildInfo b/wmake/wmakeBuildInfo
index 3c3266b5287ca8dbe7cc4fc0a1d0f45a1612fd9f..e6b75b1ea6a07cedebb7c8b40d35131ac00b490b 100755
--- a/wmake/wmakeBuildInfo
+++ b/wmake/wmakeBuildInfo
@@ -6,23 +6,10 @@
 #   \\  /    A nd           | www.openfoam.com
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
-#     Copyright (C) 2018-2019 OpenCFD Ltd.
+#     Copyright (C) 2018-2020 OpenCFD Ltd.
 #------------------------------------------------------------------------------
 # License
-#     This file is part of OpenFOAM.
-#
-#     OpenFOAM is free software: you can redistribute it and/or modify it
-#     under the terms of the GNU General Public License as published by
-#     the Free Software Foundation, either version 3 of the License, or
-#     (at your option) any later version.
-#
-#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-#     for more details.
-#
-#     You should have received a copy of the GNU General Public License
-#     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+#     This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
 #
 # Script
 #     wmakeBuildInfo
@@ -38,12 +25,13 @@
 # Note
 #     Partial logic is also implemented in the bin/foamEtcFile
 #     -show-api and -show-patch options.
-#     Make sure that any changes here are also reflected there.
+#     Make sure that changes here are also reflected there.
 #
 #------------------------------------------------------------------------------
 # Locations
 rulesFile="${WM_DIR:-$WM_PROJECT_DIR/wmake}/rules/General/general"
-metaInfoDir="$WM_PROJECT_DIR/META-INFO"
+META_INFO="$WM_PROJECT_DIR/META-INFO"
+FOAM_GIT_DIR="$WM_PROJECT_DIR/.git"
 
 usage() {
     exec 1>&2
@@ -58,6 +46,7 @@ options:
                 (exit code 0 for no changes)
   -dry-run      In combination with -update
   -filter FILE  Filter @API@, @BUILD@ tags in file with make information
+  -no-git       Disable use of git for obtaining information
   -remove       Remove meta-info build information and exit
   -update       Update meta-info from make information
   -query        Report make-info and meta-info
@@ -131,6 +120,9 @@ do
         shift # Stop here, a file name follows
         break
         ;;
+    -no-git)
+        unset FOAM_GIT_DIR
+        ;;
     *)
         die "unknown option/argument: '$1'"
         ;;
@@ -142,8 +134,8 @@ done
 [ -d "$WM_PROJECT_DIR" ] || \
     die "Bad or unset environment variable: \$WM_PROJECT_DIR"
 
-[ -d "$WM_PROJECT_DIR/META-INFO" ] || \
-    die "No META-INFO/ directory for project"
+[ -d "$META_INFO" ] || \
+    die "No ${META_INFO##*/}/ directory for project"
 
 
 #------------------------------------------------------------------------------
@@ -151,12 +143,12 @@ done
 if [ "$optUpdate" = remove ]
 then
 
-    if [ -f "$metaInfoDir/build-info" ]
+    if [ -f "$META_INFO/build-info" ]
     then
-        echo "Removing project META-INFO/build-info" 1>&2
-        rm -f "$metaInfoDir/build-info" 2>/dev/null
+        echo "Removing project ${META_INFO##*/}/build-info" 1>&2
+        rm -f "$META_INFO/build-info" 2>/dev/null
     else
-        echo "Already removed project META-INFO/build-info" 1>&2
+        echo "Already removed project ${META_INFO##*/}/build-info" 1>&2
     fi
     exit 0
 
@@ -173,7 +165,7 @@ then
 
 else
 
-    [ "$#" -eq 0 ] || die "Unexpected option/arguments $@"
+    [ "$#" -eq 0 ] || die "Unexpected option/arguments $*"
 
     # Nothing specified? Default to -query-make
     if [ -z "$optCheck$optUpdate$optQuery" ]
@@ -221,22 +213,25 @@ getMakeInfo()
     # (api) from WM_DIR/rules/General/general
     # - extract WM_VERSION = OPENFOAM=<digits>
 
-    api="$(sed -ne '/^ *#/!{ /WM_VERSION.*OPENFOAM=/{ s@^.*OPENFOAM= *\([0-9][0-9]*\).*@\1@p; q }}' $rulesFile 2>/dev/null)"
+    api="$(sed -ne '/^ *#/!{ /WM_VERSION.*OPENFOAM=/{ s@^.*OPENFOAM= *\([0-9][0-9]*\).*@\1@p; q }}' "$rulesFile" 2>/dev/null)"
 
-    if [ -d "$metaInfoDir" ]
+    if [ -d "$META_INFO" ]
     then
         # (patch) from build-info - not from api-info
-        patch="$(sed -ne 's@^patch *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/build-info 2>/dev/null)"
+        patch="$(sed -ne 's@^patch *= *\([0-9][0-9]*\).*@\1@p' "$META_INFO/build-info" 2>/dev/null)"
     fi
 
     # Build info from git. Use short date format (YYYY-MM-DD) and sed instead
     # of the newer --date='format:%y%m%d'
-    build="$(git --git-dir=$WM_PROJECT_DIR/.git log -1 --date=short --format='%h=%ad' 2>/dev/null|sed 's/-//g;s/=/-/')"
-
-    # Branch info from git
-    if [ -n "$build" ]
+    if [ -d "$FOAM_GIT_DIR" ]
     then
-        branch="$(git --git-dir=$WM_PROJECT_DIR/.git rev-parse --abbrev-ref HEAD 2>/dev/null)"
+        build="$(git --git-dir="$FOAM_GIT_DIR" log -1 --date=short --format='%h=%ad' 2>/dev/null|sed 's/-//g;s/=/-/')"
+
+        # Branch info from git
+        if [ -n "$build" ]
+        then
+            branch="$(git --git-dir="$FOAM_GIT_DIR" rev-parse --abbrev-ref HEAD 2>/dev/null)"
+        fi
     fi
 
     make_api="$api"
@@ -269,15 +264,15 @@ getMetaInfo()
     local api patch build branch
     unset meta_api meta_patch meta_branch meta_build
 
-    if [ -d "$metaInfoDir" ]
+    if [ -d "$META_INFO" ]
     then
         # (api, patch) from api-info
         # (branch, build) from build-info
 
-        api="$(sed -ne 's@^api *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
-        patch="$(sed -ne 's@^patch *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
-        branch="$(sed -ne 's@^branch *= *\([^ ]*\).*@\1@p' $metaInfoDir/build-info 2>/dev/null)"
-        build="$(sed -ne 's@^build *= *\([^ ]*\).*@\1@p' $metaInfoDir/build-info 2>/dev/null)"
+        api="$(sed -ne 's@^api *= *\([0-9][0-9]*\).*@\1@p' "$META_INFO/api-info" 2>/dev/null)"
+        patch="$(sed -ne 's@^patch *= *\([0-9][0-9]*\).*@\1@p' "$META_INFO/api-info" 2>/dev/null)"
+        branch="$(sed -ne 's@^branch *= *\([^ ]*\).*@\1@p' "$META_INFO/build-info" 2>/dev/null)"
+        build="$(sed -ne 's@^build *= *\([^ ]*\).*@\1@p' "$META_INFO/build-info" 2>/dev/null)"
     fi
 
     meta_api="$api"
@@ -478,7 +473,7 @@ performUpdate()
     local outputFile
 
     # build-info
-    outputFile="$metaInfoDir/build-info"
+    outputFile="$META_INFO/build-info"
     if [ "$branch" != "${meta_branch}" ] || \
        [ "$build" != "${meta_build}" ] || \
        [ "$patch" != "${meta_patch}" ]
@@ -499,7 +494,7 @@ performUpdate()
 
 
     # api-info
-    outputFile="$metaInfoDir/api-info"
+    outputFile="$META_INFO/api-info"
     if [ "$api" != "${meta_api}" ]
     then
         patch="${meta_patch:-0}"        # <- From meta-info only