107 lines
3.2 KiB
Bash
Executable File
107 lines
3.2 KiB
Bash
Executable File
set -e
|
|
|
|
usage() {
|
|
echo "usage: $0 [variants] [--evmy] [--cache] [--cpri/--ecpri/--jesd] [--pcie] [--test caseid] " 1>&2
|
|
msg=${1:-}
|
|
if [ ! -z "${msg}" ]; then
|
|
echo "error:$1"
|
|
fi
|
|
exit 1
|
|
}
|
|
|
|
variants=
|
|
fronthaul_option="cpri"
|
|
backhaul_option="tmac"
|
|
cache_option="no"
|
|
test_option="no"
|
|
case_id=0
|
|
board_option="EVB"
|
|
arm_version=`git log --decorate -1 | sed -n '1p' | awk '{print substr($2,0)}'`
|
|
arm_build_date=`date +"%Y-%m-%d-%H:%M:%S"`
|
|
|
|
#判断tag是否存在
|
|
if [ -z `git log --decorate -1 | grep -oP '(?<=tag: ).*' | awk '{print substr($1,0)}'` ]
|
|
then
|
|
arm_tag="NULL";
|
|
else
|
|
arm_tag=`git log --decorate -1 | grep -oP '(?<=tag: ).*' | awk '{print substr($1,0)}'`
|
|
arm_tag=${arm_tag%?}
|
|
fi
|
|
|
|
while [[ "$#" > 0 ]]; do
|
|
case $1 in
|
|
--cache) cache_option="yes"; shift;;
|
|
|
|
--evmy) board_option="EVMY"; shift;;
|
|
--evb) board_option="EVB"; shift;;
|
|
--evmyf) board_option="EVMYF"; shift;;
|
|
--evmyt) board_option="EVMYT"; shift;;
|
|
|
|
--cpri) fronthaul_option="cpri"; shift;;
|
|
--ecpri) fronthaul_option="ecpri"; shift;;
|
|
--jesd) fronthaul_option="jesd"; shift;;
|
|
--pcie) backhaul_option="pcie"; 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 arm_version=${arm_version}
|
|
export arm_tag=${arm_tag}
|
|
export arm_build_date=${arm_build_date}
|
|
printf "#arm_version[%s], arm_tag[%s], arm_build_date:[%s]\n" $arm_version $arm_tag $arm_build_date
|
|
|
|
export DIR_ROOT=$(cd `dirname "$0"`;pwd)
|
|
#echo "# script_dir:${DIR_ROOT}"
|
|
export BUILD_DIR=${DIR_ROOT}/build
|
|
if [ -d ${BUILD_DIR} ]; then
|
|
rm -rf ${BUILD_DIR}
|
|
fi
|
|
|
|
mkdir -p ${BUILD_DIR}
|
|
if [[ "${fronthaul_option}" == "jesd" ]]; then
|
|
export RFIC_DIR=${DIR_ROOT}/driver/rfic/rf/
|
|
export CJSON_DIR=${DIR_ROOT}/driver/rfic/ucp/cJSON/inc/
|
|
export RFIC_APP_DIR=${DIR_ROOT}/rfic
|
|
export BOARD_TYPE=${board_option}
|
|
|
|
echo -e "\n"
|
|
echo "###### start building libjesd.a and librfic.a and rfic.out ######"
|
|
cd ${DIR_ROOT}/driver/rfic
|
|
#chmod +x build.sh
|
|
source ./build.sh
|
|
cp ${RFIC_DIR}/out/jesd/*.a ${BUILD_DIR}
|
|
cp ${RFIC_DIR}/out/jesd/*.h ${DIR_ROOT}/interface
|
|
|
|
cp ${RFIC_DIR}/out/rfic/*.a ${DIR_ROOT}/lib
|
|
cp ${RFIC_DIR}/out/rfic/ucp_api_rfic.h ${RFIC_APP_DIR}/inc/
|
|
cp ${CJSON_DIR}/xzJSON.h ${RFIC_APP_DIR}/inc/
|
|
|
|
cp ${RFIC_DIR}/out/app/*.out ${BUILD_DIR}
|
|
|
|
#echo -e "\n"
|
|
#echo "###### start building rfic.out ######"
|
|
#cd ${RFIC_APP_DIR}/
|
|
#make
|
|
fi
|
|
|
|
cd ${DIR_ROOT}/driver/tfu
|
|
source ./build.sh
|
|
cp build/libstc.a ${DIR_ROOT}/lib
|
|
cp build/libstc.a ${BUILD_DIR}
|
|
cp stc/inc/stc_drv_api.h ${DIR_ROOT}/interface
|
|
|
|
echo -e "\n"
|
|
echo "###### start building msgTransfer.out and libmsgTransfer.a ######"
|
|
cd ${DIR_ROOT}/
|
|
make cache_option=${cache_option} fronthaul_option=${fronthaul_option} backhaul_option=${backhaul_option} test_option=${test_option} test_id=${case_id}
|
|
|
|
cd ${DIR_ROOT}/lib
|
|
rm -rf *.*
|