You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.2 KiB

#!/bin/bash
function get_config_val() {
echo $(sed -n "
/^\[.*\]/d
/^[ ]*$/d
s/;.*$//
s/^[ | ]*$2[ | ]*=[ | ]*\(.*\)[ | ]*/\1/p
" $1)
}
function doCopy()
{
if [ -e "../droi/$source" ] ;then
echo "==================Copy file from $source===================="
checkfile ../droi/$source
echo "======================Copy file end========================="
else
echo "Project rf files not exist!!!"
exit
fi
}
function checkfile(){
for file in `ls $1`
do
if [ -d $1"/"$file ]
then
checkfile $1"/"$file
else
local path=$1"/"$file
local filter=`echo $path | awk -F"/" '{print $4}'`
if [[ ! $filter =~ $source ]]
then
local dest=`echo $path | awk -F"$source/" '{print $2}'`
echo $dest
cp -a $path $dest
fi
fi
done
}
source=$1 #主板
project=$(get_config_val project.ini ${source}) #编译的工程
if [ "$project" = "" ]; then
echo "Please config project in project.ini"
exit 1
fi
echo "###Project=${project}###"
filename=$source"_"$(date +%0Y%0m%0d%0k%0M)
cmd1="./m $project.mak new"
cmd2="./modemRenameCopy.pl `pwd` $project"
cmd3="cp -a temp_modem ../droi/$source/$filename"
doCopy $source
$cmd1 && $cmd2 && $cmd3