一个小脚本----各种编译命令合入到同一个脚本

快速编译命令脚本

#/bin/bash

PROJECT=${1}
OPTION="${2}"
DIR="${3}"
if [ -d ${DIR} ];then
        rm -rf ${DIR}
        mkdir -p ${DIR}
    else
        mkdir -p ${DIR}    
fi


help_info() {
        echo
        echo "#################################################################################" 
        echo "#   Usage:                                                                       #"
        echo "#   ./fast_compiler.sh project_name option target_dir                                   #"
        echo "#   Example:                                                                     #"
        echo "#   ./fast_compiler.sh 项目名 camera camera_so                                           #"
        echo "#   If not exist directory camera_so, it will be created in current directory.   #"
        echo "#################################################################################"
        echo
}

if [  $# -lt 1 ];then
        help_info
        exit
elif [ "-h" = $1 ] || [ "help" = $1 ] || [ "-help" = $1 ];then
        help_info
        exit
fi


if [    $2 = "camera"   ];then
echo "fast compiler module:camera"
./mk mm mediatek/platform/mt6582/hardware/mtkcam/
cp out/target/product/${PROJECT}/system/lib/libcameracustom.so ./${DIR}/ -v
cp out/target/product/${PROJECT}/system/lib/libcam.utils.so ./${DIR}/ -v
cp out/target/product/${PROJECT}/system/lib/hw/camera.default.so ./${DIR}/ -v


elif [    $2 = "update_modem"   ];then
echo "fast compiler module:modem"
./mk ${PROJECT} update-modem
cp out/target/product/${PROJECT}/{*.txt,*.bin,*.img,DSP*,EBR2,EBR2,MBR} ./${DIR}/ -v
cp out/target/product/${PROJECT}/obj/CODEGEN/cgen/APDB_* ./${DIR}/ -v
cp out/target/product/${PROJECT}/system/etc/mddb/BPLG* ./${DIR}/ -v
 
elif [    $2 = "remake"   ];then
echo "fast compiler module:remake"

./mk ${PROJECT} remake
# Copy bin(s) for download
cp out/target/product/${PROJECT}/{*.txt,*.bin,*.img,DSP*,EBR1,EBR2,MBR} ./${DIR}/ -v

# Copy AP Database
#MTK_CGEN_AP_Editor_DB := $(MTK_CGEN_OUT_DIR)/APDB_$(MTK_PLATFORM)_$(MTK_CHIP_VER)_$(MTK_BRANCH)_$(MTK_WEEK_NO)
cp out/target/product/${PROJECT}/obj/CODEGEN/cgen/APDB_* ./${DIR}/ -v

# Copy Modem Database
cp out/target/product/${PROJECT}/system/etc/mddb/BPLG* ./${DIR}/ -v

elif [    $2 = "new"   ];then
echo "fast compiler module:new"

./mk ${PROJECT} new
# Copy bin(s) for download
cp out/target/product/${PROJECT}/{*.txt,*.bin,*.img,DSP*,EBR1,EBR2,MBR} ./${DIR}/ -v

# Copy AP Database
#MTK_CGEN_AP_Editor_DB := $(MTK_CGEN_OUT_DIR)/APDB_$(MTK_PLATFORM)_$(MTK_CHIP_VER)_$(MTK_BRANCH)_$(MTK_WEEK_NO)
cp out/target/product/${PROJECT}/obj/CODEGEN/cgen/APDB_* ./${DIR}/ -v

# Copy Modem Database
cp out/target/product/${PROJECT}/system/etc/mddb/BPLG* ./${DIR}/ -v


elif [    $2 = "lk"   ];then
echo "fast compiler module:lk"

./mk ${PROJECT} remake lk
cp out/target/product/${PROJECT}/lk.bin ./${DIR}/ -v

elif [    $2 = "kernel"   ];then
echo "fast compiler module:kernel"

./mk ${PROJECT} remake kernel
./mk bootimage
cp out/target/product/${PROJECT}/boot.img ./${DIR}/ -v

elif [    $2 = "pl"   ];then
echo "fast compiler module:pl"

./mk ${PROJECT} remake preloader
cp out/target/product/${PROJECT}/preloader*.bin ./${DIR}/ -v

elif [    $2 = "system"   ];then
echo "fast compiler module:system"

./mk ${PROJECT} remake dr
cp out/target/product/${PROJECT}/system.img ./${DIR}/ -v


else
echo "error"
fi



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值