yb_arm/build.sh

54 lines
1.3 KiB
Bash
Raw Normal View History

2023-07-12 14:14:31 +08:00
set -e
usage() {
echo "usage: $0 [variants] [--cache] [--jesd] [--test caseid] " 1>&2
msg=${1:-}
if [ ! -z "${msg}" ]; then
echo "error:$1"
fi
exit 1
}
variants=
fronthaul_option="cpri"
cache_option="no"
test_option="no"
case_id=0
while [[ "$#" > 0 ]]; do
case $1 in
--cache) cache_option="yes"; shift;;
--cpri) fronthaul_option="cpri"; shift;;
--jesd) fronthaul_option="jesd"; shift;;
--test) test_option="yes";
if [[ ! -z "$2" ]] && [[ -n "$(echo $2 | sed -n " /^[0-9]\+$/p")" ]]; then
case_id=$2; shift;
fi
shift;;
--*| -*) usage "unknown option $1"; exit 1;;
*) variants+=" $1"; shift;;
esac;
done
export DIR_ROOT=$(cd `dirname "$0"`;pwd)
#echo "# script_dir:${DIR_ROOT}"
export RFIC_DIR=${DIR_ROOT}/driver/rfic
export BUILD_DIR=${DIR_ROOT}/build
if [ -d ${BUILD_DIR} ]; then
rm -rf ${BUILD_DIR}
fi
if [[ "${fronthaul_option}" == "jesd" ]]; then
2023-07-14 17:29:38 +08:00
chmod +x build_jesd.sh
source ./build_jesd.sh
2023-07-12 14:14:31 +08:00
cp ${RFIC_DIR}/librfic.a ${DIR_ROOT}/lib
fi
cd ${DIR_ROOT}/
make cache_option=${cache_option} fronthaul_option=${fronthaul_option} test_option=${test_option} test_id=${case_id}