diff --git a/wmake/rules/General/general b/wmake/rules/General/general index 8c433e46fabb4f58255dc65b4b178e93c96e79aa..f8786b6a2d09724cc5ace8a148154f96deb78714 100644 --- a/wmake/rules/General/general +++ b/wmake/rules/General/general @@ -17,7 +17,7 @@ GLIB_LIBS = COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[0-9].*//') DEFAULT_RULES = $(WM_DIR)/rules/$(WM_ARCH)$(COMPILER_FAMILY) RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) -WMAKE_BIN = $(WM_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER) +WMAKE_BIN = $(WM_PROJECT_DIR)/platforms/tools/$(WM_ARCH)$(WM_COMPILER) # Default compilation is 'Opt' - never permit an empty value ifeq ($(WM_COMPILE_OPTION),) diff --git a/wmake/scripts/wrap-lemon b/wmake/scripts/wrap-lemon index 5b01d9e77e64db1185fe9490a314a4a1efa224c3..f9080d95ce0fe81300a5bdf801db3a7f151ec163 100755 --- a/wmake/scripts/wrap-lemon +++ b/wmake/scripts/wrap-lemon @@ -6,11 +6,10 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------- -# 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. # # Script # wrap-lemon @@ -31,7 +30,7 @@ # #------------------------------------------------------------------------------ -binDir="${WMAKE_BIN:-$WM_PROJECT_DIR/wmake/platforms/$WM_ARCH$WM_COMPILER}" +binDir="${WMAKE_BIN:-$WM_PROJECT_DIR/platforms/tools/$WM_ARCH$WM_COMPILER}" etcDir="${WM_DIR:-$WM_PROJECT_DIR/wmake}/etc" # Executable and skeleton locations diff --git a/wmake/src/Allmake b/wmake/src/Allmake index 4ef5a56975b60daf798416648f793dc31846969e..9e78c5eb5284847bdb6acf6f07914ec6c403f673 100755 --- a/wmake/src/Allmake +++ b/wmake/src/Allmake @@ -1,23 +1,38 @@ #!/bin/sh -cd "${0%/*}" || exit # Run from this directory +cd "${0%/*}" || exit # This directory (/path/project/wmake/src) -if [ -z "$WM_DIR" ] # Require WM_DIR +if [ -z "$WM_DIR" ] # Require WM_DIR (/path/project/wmake) then - WM_DIR="$(\cd $(dirname $0)/.. && \pwd -L)" + WM_DIR="$(dirname "$(pwd -L)")" export WM_DIR fi +if [ -z "$WM_PROJECT_DIR" ] # Expect WM_PROJECT_DIR (/path/project) +then + echo "Warning (${0##*/}) : No WM_PROJECT_DIR set" 1>&2 + WM_PROJECT_DIR="${WM_DIR%/*}" + export WM_PROJECT_DIR +fi + +if [ -z "$WM_ARCH" ] || [ -z "$WM_COMPILER" ] +then + echo "Error (${0##*/}) : No WM_ARCH or WM_COMPILER set" + echo " Check your OpenFOAM environment and installation" + exit 1 +fi + case "$WM_COMPILER" in Mingw*) # Host wmake toolchain with system gcc (when cross-compiling) make \ WM_COMPILER=Gcc WM_COMPILER_TYPE=system \ - WMAKE_BIN="${WM_DIR}/platforms/${WM_ARCH}${WM_COMPILER}" + WMAKE_BIN="${WM_PROJECT_DIR}/platforms/tools/${WM_ARCH}${WM_COMPILER}" \ + "$@" ;; *) - # Compile wmake toolchain - make + # Regular wmake toolchain + make "$@" ;; esac