CONFIG: relocate wmake binaries into project platforms/tools (#1647)

- can aid when creating source-only or binary-only packages
This commit is contained in:
Mark Olesen 2020-04-03 18:52:10 +02:00
parent 8075804b18
commit a8b6d01b87
3 changed files with 25 additions and 11 deletions

View File

@ -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),)

View File

@ -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

View File

@ -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