Reduce the number of folders created outside of Clover source folder

Try to use ~/src/opt/local for TOOLCHAIN_DIR. If it doesn't exist,
we will use $CLOVERROOT/toolchain instead.
This commit is contained in:
Florin9doi 2019-11-04 23:47:52 +02:00
parent 19cbd1e3c9
commit fcc25ba1b6
3 changed files with 17 additions and 12 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@
.cache
Conf/.cache
Conf/target.txt
toolchain/
# /CloverPackage/
/CloverPackage/sym/

16
buildme
View File

@ -13,10 +13,9 @@
cd "$(dirname $([ -L $0 ] && readlink $0 || echo $0))"
declare -r CLOVERROOT="$PWD"
declare -r SYSNAME="$(uname)"
MYTOOLCHAIN=${1:-GCC53}
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-$(dirname $CLOVERROOT)/opt/local}
# Functions
pathmunge() {
if [[ ! $PATH =~ (^|:)$1(:|$) ]]; then
@ -57,13 +56,16 @@ fi
}
exportPaths() {
if [[ "$(uname)" == Darwin ]]; then
if [[ "$SYSNAME" == Linux ]]; then
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-/usr}
elif [[ "$SYSNAME" == Darwin ]]; then
pathmunge "$(xcode-select --print-path)"/usr/bin
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-"$CLOVERROOT"/toolchain}
fi
pathmunge "$TOOLCHAIN_DIR"/bin
export TOOLCHAIN_DIR=$TOOLCHAIN_DIR
export DIR_MAIN=${DIR_MAIN:-$(dirname $CLOVERROOT)}
export DIR_MAIN=${DIR_MAIN:-"$CLOVERROOT"/toolchain}
export DIR_TOOLS=${DIR_TOOLS:-$DIR_MAIN/tools}
export DIR_DOWNLOADS=${DIR_DOWNLOADS:-$DIR_TOOLS/download}
export DIR_LOGS=${DIR_LOGS:-$DIR_TOOLS/logs}
@ -72,7 +74,7 @@ export PREFIX=${TOOLCHAIN_DIR}
checkTools() {
# export any env vars before building anything
if [[ "$(uname)" == Darwin ]]; then
if [[ "$SYSNAME" == Darwin ]]; then
checkXCODE
exportPaths
local GCC53_BIN="$PREFIX/cross/bin/x86_64-clover-linux-gnu-gcc"
@ -163,7 +165,7 @@ echo "[BUILD CLOVER TEST]"
}
buildPkg() {
if [[ "$(uname)" == Darwin ]]; then
if [[ "$SYSNAME" == Darwin ]]; then
cd "${CLOVERROOT}"/CloverPackage
echo "[BUILD PKG]"
checkXCODE
@ -175,7 +177,7 @@ fi
}
buildApp() {
if [[ "$(uname)" == Darwin ]]; then
if [[ "$SYSNAME" == Darwin ]]; then
if [[ -f "${CLOVERROOT}"/CloverPackage/CloverV2/EFI/CLOVER/CLOVERX64.efi ]]; then
cd "${CLOVERROOT}"/CloverApp
echo "[BUILD APP]"

View File

@ -33,7 +33,7 @@ PLATFORMFILE=
MODULEFILE=
TARGETRULE=
SCRIPT_VERS="2019-09-06"
SCRIPT_VERS="2019-11-09"
# Macro
M_NOGRUB=0
@ -54,10 +54,12 @@ if [[ "$SYSNAME" == Linux ]]; then
export TOOLCHAIN=GCC53
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-/usr}
else
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-"$CLOVERROOT"/../../toolchain}
fi
if [[ ! -d $TOOLCHAIN_DIR ]]; then
TOOLCHAIN_DIR="${PWD}"/../opt/local
if [[ -d ~/src/opt/local ]]; then
TOOLCHAIN_DIR=~/src/opt/local
else
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-"$CLOVERROOT"/toolchain}
fi
export DIR_MAIN=${DIR_MAIN:-"$CLOVERROOT"/toolchain}
fi
export TOOLCHAIN_DIR
echo "TOOLCHAIN_DIR: $TOOLCHAIN_DIR"