code_device/build.sh

24 lines
613 B
Bash
Raw Normal View History

2022-05-05 07:57:02 +00:00
sysarch=$(arch)
2022-05-06 01:20:20 +00:00
sys=$(cat /etc/issue)
sys=${sys%% *}
2022-05-03 03:56:07 +00:00
2022-05-05 07:57:02 +00:00
echo "------------------------------change cmake path:$1--------------------"
2022-05-06 01:20:20 +00:00
if [ "$sys" == "UnionTech" ];then
2022-05-05 07:57:02 +00:00
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
2022-05-03 03:56:07 +00:00
2022-05-05 07:57:02 +00:00
mkdir build
cd build
cmake ..
make -j6
2022-05-03 03:56:07 +00:00
2022-05-05 07:57:02 +00:00
if [ $? -ne 0 ];then
echo "--------------------------------------make fail---------------------------------------"
exit 1
fi
echo "--------------------------------------make succeed------------------------------------"
2022-05-04 02:14:14 +00:00
2022-05-05 07:57:02 +00:00
make