2023-07-12 14:14:31 +08:00
|
|
|
set -e
|
|
|
|
|
|
|
|
usage() {
|
2023-07-21 09:17:30 +08:00
|
|
|
echo "usage: $0 [variants] [--evmy] [--cache] [--jesd] [--test caseid] " 1>&2
|
2023-07-12 14:14:31 +08:00
|
|
|
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
|
2023-07-21 09:17:30 +08:00
|
|
|
board_option="EVB"
|
2023-07-12 14:14:31 +08:00
|
|
|
|
|
|
|
while [[ "$#" > 0 ]]; do
|
|
|
|
case $1 in
|
|
|
|
--cache) cache_option="yes"; shift;;
|
|
|
|
|
2023-07-21 09:17:30 +08:00
|
|
|
--evmy) board_option="EVMY"; shift;;
|
|
|
|
--evb) board_option="EVB"; shift;;
|
|
|
|
|
2023-07-12 14:14:31 +08:00
|
|
|
--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}"
|
2023-09-22 12:14:28 +08:00
|
|
|
export RFIC_DIR=${DIR_ROOT}/driver/rfic/adrv9026
|
2023-09-25 09:39:45 +08:00
|
|
|
export CJSON_DIR=${DIR_ROOT}/driver/rfic/ucp/cJSON
|
|
|
|
export RFIC_APP_DIR=${DIR_ROOT}/rfic
|
2023-07-12 14:14:31 +08:00
|
|
|
export BUILD_DIR=${DIR_ROOT}/build
|
|
|
|
|
|
|
|
if [ -d ${BUILD_DIR} ]; then
|
|
|
|
rm -rf ${BUILD_DIR}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${fronthaul_option}" == "jesd" ]]; then
|
2023-07-21 09:17:30 +08:00
|
|
|
export BOARD_TYPE=${board_option}
|
2023-07-14 17:29:38 +08:00
|
|
|
chmod +x build_jesd.sh
|
|
|
|
source ./build_jesd.sh
|
2023-07-21 09:57:43 +08:00
|
|
|
cp ${RFIC_DIR}/out/rfic/*.a ${DIR_ROOT}/lib
|
|
|
|
cp ${RFIC_DIR}/out/rfic/*.h ${DIR_ROOT}/interface
|
|
|
|
cp ${RFIC_DIR}/out/jesd/*.a ${DIR_ROOT}/lib
|
|
|
|
cp ${RFIC_DIR}/out/jesd/*.h ${DIR_ROOT}/interface
|
|
|
|
mkdir -p ${BUILD_DIR}
|
|
|
|
cp ${DIR_ROOT}/lib/*.a ${BUILD_DIR}/
|
2023-09-25 09:39:45 +08:00
|
|
|
|
2023-09-25 10:50:42 +08:00
|
|
|
#cp ${BUILD_DIR}/librfic.a ${RFIC_APP_DIR}/lib/
|
2023-09-25 09:39:45 +08:00
|
|
|
cp ${DIR_ROOT}/interface/ucp_api_rfic.h ${RFIC_APP_DIR}/inc/
|
|
|
|
cp ${CJSON_DIR}/xzJSON.h ${RFIC_APP_DIR}/inc/
|
|
|
|
|
|
|
|
chmod +x build_rfic.sh
|
|
|
|
source ./build_rfic.sh
|
|
|
|
cp ${RFIC_APP_DIR}/build/*.out ${BUILD_DIR}/
|
2023-07-12 14:14:31 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd ${DIR_ROOT}/
|
|
|
|
make cache_option=${cache_option} fronthaul_option=${fronthaul_option} test_option=${test_option} test_id=${case_id}
|
|
|
|
|
2023-07-21 10:04:33 +08:00
|
|
|
cd ${DIR_ROOT}/lib
|
2023-09-25 09:39:45 +08:00
|
|
|
rm -rf *.*
|