code_device/build.sh

25 lines
629 B
Bash
Executable File

sysarch=$(arch)
sys=$(cat /etc/issue)
sys=${sys%% *}
echo "------------------------------change cmake path:$1--------------------"
if [ "$sys" == "UnionTech" ];then
sed -i "s/kylin/$1/g" hgdriver/wrapper/CMakeLists.txt
elif [ "$sys" == "kylin" ];then
sed -i "s/uos/$1/g" hgdriver/wrapper/CMakeLists.txt
fi
cd ../
mkdir build
cd build
cmake ../code_device
make
if [ $? -ne 0 ];then
echo "--------------------------------------make fail---------------------------------------"
exit 1
fi
echo "--------------------------------------make succeed------------------------------------"
make