mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-29 18:27:43 +08:00
50 lines
879 B
Bash
Executable File
50 lines
879 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#build drogon
|
|
function build_drogon() {
|
|
|
|
#Update the submodule and initialize
|
|
git submodule update --init
|
|
|
|
#Save current directory
|
|
current_dir="${PWD}"
|
|
|
|
#The folder in which we will build drogon
|
|
build_dir='./build'
|
|
if [ -d $build_dir ]; then
|
|
echo "Deleted folder: ${build_dir}"
|
|
rm -rf $build_dir
|
|
fi
|
|
|
|
#Create building folder
|
|
echo "Created building folder: ${build_dir}"
|
|
mkdir $build_dir
|
|
|
|
echo "Entering folder: ${build_dir}"
|
|
cd $build_dir
|
|
|
|
echo "Start building drogon ..."
|
|
cmake ..
|
|
|
|
#If errors then exit
|
|
if [ "$?" != "0" ]; then
|
|
exit
|
|
fi
|
|
|
|
make
|
|
|
|
#If errors then exit
|
|
if [ "$?" != "0" ]; then
|
|
exit
|
|
fi
|
|
|
|
echo "Installing ..."
|
|
sudo make install
|
|
|
|
#Go back to the current directory
|
|
cd $current_dir
|
|
#Ok!
|
|
}
|
|
|
|
build_drogon
|