#!/bin/bash #setup environment # project pro file pro_path=application pro_name=denali.pro pro_type_debug="debug" pro_type_release="release" pro_type=$pro_type_release pro_debug="CONFIG+=debug CONFIG+=qml_debug" pro_release="CONFIG+=qtquickcompiler" pro_build=$pro_release out_path="build" # gcc env gcc_qmake="/opt/Qt/5.12.4/gcc_64/bin/qmake" gcc_make="/usr/bin/make" gcc_out="gcc_64" gcc_spec="-spec linux-g++" # poky env poky_qmake="/opt/b2qt/2.5.3/sysroots/x86_64-pokysdk-linux/usr/bin/qmake" poky_make="/opt/b2qt/2.5.3/sysroots/x86_64-pokysdk-linux/usr/bin/make" poky_out="poky_64" poky_spec="-spec devices/linux-oe-generic-g++" #build type detection and set function (debug/release) function buildType() { echo if [[ "$1" = "debug" ]]; then pro_build=$pro_debug pro_type=$pro_type_debug echo "----- DEBUG BUILD ---------------------------" else echo "----- RELASE BUILD ---------------------------" fi echo } #check if the out folders already exists if [[ -e $out_path ]]; then rm -frd $out_path fi if [[ -e $pro_path ]]; then rm -frd $pro_path fi if [[ "$1" = "clean" ]]; then exit 0 fi #clone the application repository git clone ssh://git@dvm-linux02:7999/sw/application.git #set the build type (debug/release) buildType "$1" #create the build folder mkdir $out_path cd $out_path #build for gcc echo "-----------------------------------------------" echo "- Start building ---------- gcc_64 ------------" echo "-----------------------------------------------" mkdir -p $gcc_out"_"$pro_type cd $gcc_out"_"$pro_type $gcc_qmake ../../$pro_path/$pro_name $gcc_spec $pro_build $gcc_make -j4 #return back to out path cd .. #build for poky echo "-----------------------------------------------" echo "- Start building ---------- poky_64 -----------" echo "-----------------------------------------------" mkdir -p $poky_out"_"$pro_type cd $poky_out"_"$pro_type $poky_qmake ../../$pro_path/$pro_name $poky_spec $pro_build $poky_make -j4 #return back to out path cd .. #return back to main folder cd ..