drogon/build.sh

50 lines
862 B
Bash
Raw Normal View History

2018-11-16 07:31:08 +00:00
#!/bin/bash
#building drogon
function build_drogon() {
2018-11-16 10:25:41 +00:00
#Update the submodule and initialize
2018-11-16 07:31:08 +00:00
git submodule update --init
2018-11-16 10:25:41 +00:00
#Saving current directory
2018-11-16 07:31:08 +00:00
current_dir="${PWD}"
2018-11-16 10:25:41 +00:00
#The folder we will build
2018-11-16 07:31:08 +00:00
build_dir='./build'
if [ -d $build_dir ]; then
echo "Deleted folder: ${build_dir}"
2018-11-16 09:26:35 +00:00
rm -rf $build_dir
2018-11-16 07:31:08 +00:00
fi
2018-11-16 10:25:41 +00:00
#Creating building folder
2018-11-16 07:31:08 +00:00
echo "Created building folder: ${build_dir}"
2018-11-16 09:26:35 +00:00
mkdir $build_dir
2018-11-16 07:31:08 +00:00
echo "Entering folder: ${build_dir}"
cd $build_dir
echo "Start building drogon ..."
cmake ..
2018-11-16 10:25:41 +00:00
#If errors then exit
2018-11-16 07:31:08 +00:00
if [ "$?" != "0" ]; then
exit
fi
make
2018-11-16 10:25:41 +00:00
#If errors then exit
2018-11-16 07:31:08 +00:00
if [ "$?" != "0" ]; then
exit
fi
2018-11-16 10:25:41 +00:00
echo "Installing ..."
2018-11-16 07:31:08 +00:00
sudo make install
2018-11-16 10:25:41 +00:00
#Reback current directory
2018-11-16 07:31:08 +00:00
cd $current_dir
2018-11-16 10:25:41 +00:00
#Ok!
2018-11-16 07:31:08 +00:00
}
build_drogon