From 2a81864b727f4de9e63d7ca91a0a703280bfdc46 Mon Sep 17 00:00:00 2001 From: Yun Liu Date: Fri, 16 Nov 2018 15:31:08 +0800 Subject: [PATCH 1/2] update script and add more comments --- build.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 8f2e8a64..768eba69 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,49 @@ -#!/bin/sh -git submodule update --init -mkdir build -cd build -cmake .. -make +#!/bin/bash + +#building drogon +function build_drogon() { + + #update the submodule and initialize + git submodule update --init + + #saving current directory + current_dir="${PWD}" + + #the folder we will build + build_dir='./build' + if [ -d $build_dir ]; then + echo "Deleted folder: ${build_dir}" + rm -rf build + fi + + #creating building folder + echo "Created building folder: ${build_dir}" + mkdir build + + echo "Entering folder: ${build_dir}" + cd $build_dir + + echo "Start building drogon ..." + cmake .. + + #errors exit + if [ "$?" != "0" ]; then + exit + fi + + make + + #errors exit + if [ "$?" != "0" ]; then + exit + fi + + echo "Installing header files ..." + sudo make install + + #reback current directory + cd $current_dir + #ok! +} + +build_drogon From c19c536f6c2b212fe8c7ba566dcfb103f1e0d375 Mon Sep 17 00:00:00 2001 From: Yun Liu Date: Fri, 16 Nov 2018 17:26:35 +0800 Subject: [PATCH 2/2] fixed some bugs --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 768eba69..9c8a2166 100755 --- a/build.sh +++ b/build.sh @@ -13,12 +13,12 @@ function build_drogon() { build_dir='./build' if [ -d $build_dir ]; then echo "Deleted folder: ${build_dir}" - rm -rf build + rm -rf $build_dir fi #creating building folder echo "Created building folder: ${build_dir}" - mkdir build + mkdir $build_dir echo "Entering folder: ${build_dir}" cd $build_dir