build_completion

This commit is contained in:
2022-07-13 18:26:49 +01:00
parent dbe0701019
commit 563c486773

View File

@@ -22,6 +22,22 @@ target:
EOF EOF
} }
complete -F build_completion build
build_completion()
{
local CANDIDATES="help clobber tests addon-checksums icecc docker make"
# Platforms
local PLATFORMS="native marlin bailey loggan"
if ! [[ "${COMP_WORDS[*]}" =~ "marlin" ||
"${COMP_WORDS[*]}" =~ "bailey" ||
"${COMP_WORDS[*]}" =~ "loggan" ||
"${COMP_WORDS[*]}" =~ "native" ]]; then
CANDIDATES+=" $PLATFORMS"
fi
COMPREPLY=($(compgen -W "$CANDIDATES" "${COMP_WORDS[${COMP_CWORD}]}"))
}
build() build()
{ {
local BUILD_PLATFORM=marlin local BUILD_PLATFORM=marlin
@@ -31,12 +47,14 @@ build()
local BUILD_MODE=dev local BUILD_MODE=dev
local PAX_DEBUG=on local PAX_DEBUG=on
local OPTIONS= local OPTIONS=
local DOCKER=0
local BUILD_ROOT=$(git rev-parse --show-toplevel)/os local REPO_ROOT=$(git rev-parse --show-toplevel)
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
BUILD_ROOT=$(p4 -Ztag -F %clientRoot% info)/os REPO_ROOT=$(p4 -Ztag -F %clientRoot% info)
fi fi
echo $BUILD_ROOT local BUILD_ROOT=$REPO_ROOT/os
#echo $BUILD_ROOT
# args=$(getopt fhstuec $*) # args=$(getopt fhstuec $*)
# if [ $? -ne 0 ]; then # if [ $? -ne 0 ]; then
@@ -46,19 +64,25 @@ build()
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
tests|\
hostunittests|\
unittests) unittests)
TARGET=build-tests-all TARGET=build-tests-all
PAX_DEBUG=off PAX_DEBUG=off
BUILD_PLATFORM=hostunittests BUILD_PLATFORM=hostunittests
;; ;;
host|\
hoststatic|\
unity|\ unity|\
native) native)
PAX_DEBUG=off PAX_DEBUG=off
BUILD_PLATFORM=$1 BUILD_PLATFORM=$1
DOCKER=1
;; ;;
reno|\ reno|\
bailey|\ bailey|\
marlin|\ marlin|\
loggan|\
madison) madison)
BUILD_PLATFORM=$1 BUILD_PLATFORM=$1
;; ;;
@@ -91,6 +115,12 @@ build()
nopax) nopax)
PAX_DEBUG=off PAX_DEBUG=off
;; ;;
make)
DOCKER=0
;;
docker)
DOCKER=1
;;
debug) debug)
BUILD_MODE=dbg BUILD_MODE=dbg
;; ;;
@@ -107,15 +137,26 @@ build()
done done
make \ if [ $DOCKER -eq 1 ]; then
ENABLE_ICECC=$ENABLE_ICECC \ $REPO_ROOT/os/scripts/docker/localcontainer/docker-u20-make \
BUILD_MODE=$BUILD_MODE \ ENABLE_ICECC=$ENABLE_ICECC \
PAX_DEBUG=$PAX_DEBUG \ BUILD_MODE=$BUILD_MODE \
BUILD_PLATFORM=$BUILD_PLATFORM \ PAX_DEBUG=$PAX_DEBUG \
$OPTIONS \ BUILD_PLATFORM=$BUILD_PLATFORM \
-j $JOBS \ $OPTIONS \
-C $BUILD_ROOT $TARGET -j $JOBS \
#make ENABLE_ICECC=1 PAX_DEBUG=on BUILD_PLATFORM=$1 -j $(nproc) -C os all -C $BUILD_ROOT $TARGET
else
make \
ENABLE_ICECC=$ENABLE_ICECC \
BUILD_MODE=$BUILD_MODE \
PAX_DEBUG=$PAX_DEBUG \
BUILD_PLATFORM=$BUILD_PLATFORM \
$OPTIONS \
-j $JOBS \
-C $BUILD_ROOT $TARGET
#make ENABLE_ICECC=1 PAX_DEBUG=on BUILD_PLATFORM=$1 -j $(nproc) -C os all
fi
} }
############################################################################### ###############################################################################
# #