123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #!/bin/bash
- qtmake=" "
- if [ ${#qtmake} -lt 5 ]; then
- echo "now need find qmake "
- optfiles=`find /opt -name 'qmake'`
- for entry in $optfiles
- do
- x=${entry:0-10:10}
- if [ "$x" == "/bin/qmake" ]; then
- qtmake="$entry"
- echo " -----find qmake"
- echo "$qtmake"
- fi
- done
- fi
- if [ ${#qtmake} -lt 5 ]; then
- echo "maybe agx,find qmake in usr folder "
- optfiles=`find /usr -name 'qmake'`
- for entry in $optfiles
- do
- x=${entry:0-14:14}
- if [ "$x" == "/qt5/bin/qmake" ]; then
- qtmake="$entry"
- echo " -----find qmake"
- echo "$qtmake"
- fi
- done
- fi
- check_result()
- {
-
- if [ "$1" != 0 ];then
- echo -e "\e[33m*************************************************\e[0m"
- echo -e "\e[31m Please modify build error first,Exit!\e[0m"
- echo -e "\e[33m*************************************************\e[0m"
- exit 1
- fi
- }
- module=$1
- echo -e "\e[33m module name: \e[1;33m $module \e[0m"
- projectDir=`pwd`
- echo -e "project folder \e[33m$projectDir\e[0m"
- MAKEOPT=-j8
- mkdir bin
- outputDir=$projectDir"/bin"
- echo -e "output folder \e[33m$outputDir\e[0m"
- cd src
- sourceDir=`pwd`
- echo -e "source code folder \e[33m$sourceDir\e[0m"
- moduleDir=`find . -type d -name $module`
- if [ $moduleDir ];then
- moduleDir=$sourceDir${moduleDir#*.}
- echo -e "module code folder \e[33m$moduleDir\e[0m"
- cd $moduleDir
- moduleName=$module".pro"
- echo -e "\e[1;35;47m START BUILD\e[0m"
- $qtmake $moduleName
- make $MAKEOPT
- check_result $?
- make clean
- cp $module $outputDir
- rm Makefile
- rm .qmake.stash
- rm $module
- cd $projectDir
- echo -e "\e[1;33;44m Build $module Success \e[0m"
- sleep 1
- echo -e "\e[35m Start deploy\e[0m"
- cp $outputDir"/"$module ./
- bash deploy.sh $module
- if [ "$?" == 1 ];then
- exit 1
- fi
- rm $module
- echo -e "\e[1;33;44m Deploy $module Success \e[0m"
- else
- echo -e "\e[31m Can't find module code, exit.....\e[0m"
- exit
- fi
|