blob: bc4e1332d79336b66e02e4f1e8442da31bb4e393 [file] [log] [blame]
#!/bin/bash
# Config item.
# static / shared
#LIB_TYPE=static
# gcc-4.9 / gcc-8.4
#export PLATFORM=gcc-4.9
# static / shared
export BUILD_LIB_TYPE=shared
# gcc-4.9 / gcc-8.4
ROOT_DIR=`pwd`
cd ..
grep "url" .git/config | cut -d " " -f 3 | grep "kernel_5.4.195"
if [ $? -eq "0" ]; then
export BUILD_PLATFORM=asr1806
else
export BUILD_PLATFORM=asr1803
fi
export BUILD_BRANCH=`git branch | grep "*" | cut -d " " -f 2`
cd $ROOT_DIR
export STAGING_DIR=
#TOOLCHAIN_DIR=$ROOT_DIR/toolchain/$BUILD_PLATFORM
#echo "toolchain : $ROOT_DIR"
function build()
{
cd mbtk
if [ -n "$1" ] ;then
case "$1" in
clean)
make clean
;;
*)
# exit 1;;
make -C $1
esac
else # 无参数
make || exit 1
fi
cd $ROOT_DIR
echo "Build MBTK success."
}
function file_copy()
{
ROOTFS_DIR=$ROOT_DIR/../asr_code/mbtk
if [ -d $ROOTFS_DIR ];then
echo "Copy MBTK out files..."
if [ ! -d $ROOTFS_DIR/bin ];then
mkdir $ROOTFS_DIR/bin
fi
if [ ! -d $ROOTFS_DIR/lib ];then
mkdir $ROOTFS_DIR/lib
fi
# Copy All SO Files.
cp -f out/lib/* $ROOTFS_DIR/lib
# Copy All Bin Files.
#cp -f out/bin/* $ROOTFS_DIR/bin
cp -f out/bin/at $ROOTFS_DIR/bin
cp -f out/bin/mbtk_ril $ROOTFS_DIR/bin
cp -f out/bin/mbtk_logd $ROOTFS_DIR/bin
cp -f out/bin/mbtk_adbd $ROOTFS_DIR/bin
else
echo "No found rootfs : $ROOTFS_DIR"
fi
}
function main()
{
if [ -n "$1" ] ;then
build $1
exit 0
fi
if [ -d out/bin -a -d out/lib ];then
build
file_copy
else
if [ ! -d out/bin ];then
mkdir -p out/bin/asr1803
mkdir -p out/bin/asr1806
fi
if [ ! -d out/lib ];then
mkdir -p out/lib
fi
build
file_copy
fi
}
main $1