快速编译命令脚本
#/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