starting bash rewriting job [WIP]

This commit is contained in:
Yehonal
2016-07-28 13:33:10 +02:00
committed by Yehonal
parent 548d0db9d5
commit 42ad4da954
14 changed files with 213 additions and 156 deletions
+2 -5
View File
@@ -1,8 +1,5 @@
#!/bin/bash
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_PATH/includes/common.sh"
source "$CURRENT_PATH/includes/includes.sh"
clean
bash "$CURRENT_PATH/compiler.sh" 1
+2 -5
View File
@@ -1,8 +1,5 @@
#!/bin/bash
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_PATH/includes/common.sh"
source "$CURRENT_PATH/includes/includes.sh"
configure
bash "$CURRENT_PATH/compiler.sh" 2
+2 -5
View File
@@ -1,8 +1,5 @@
#!/bin/bash
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_PATH/includes/common.sh"
source "$CURRENT_PATH/includes/includes.sh"
build
bash "$CURRENT_PATH/compiler.sh" 3
+2 -2
View File
@@ -1,7 +1,7 @@
## How to compile:
first of all, if you need some custom configuration you have to copy and rename
config.sh.dist in config.sh and configure it
/conf/config.sh.dist in /conf/config.sh and configure it
* for a "clean" compilation you must run all scripts in their order:
@@ -21,4 +21,4 @@ config.sh.dist in config.sh and configure it
## Note:
For an optimal development process and **really faster** compilation time, is suggested to use clang instead of gcc
For an optimal development process and **really faster** compilation time, is suggested to use clang instead of gcc
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_PATH/includes/includes.sh"
function all() {
clean
configure
build
}
function run_option() {
if test "${comp_functions[$1-1]+'test'}"; then
${comp_functions[$1-1]}
else
echo "invalid option"
fi
}
comp_options=("Clean" "Configure" "Build" "All")
comp_functions=("clean" "configure" "build" "all")
runHooks "ON_AFTER_OPTIONS" #you can create your custom options
# push exit after custom options
comp_options+=('Exit')
comp_functions+=('exit 0')
# run option directly if specified in argument
[ ! -z $1 ] && run_option $1 && exit 0
PS3='[ Please enter your choice ]: '
select opt in "${comp_options[@]}"
do
case $opt in
'Exit')
break
;;
*)
run_option $REPLY
;;
esac
done
-38
View File
@@ -1,38 +0,0 @@
#!/bin/bash
# set preferred compilers
#CCOMPILERC="/usr/bin/clang-3.6"
#CCOMPILERCC="/usr/bin/clang-3.6"
#CCOMPILERCXX="/usr/bin/clang++-3.6"
CCOMPILERC="/usr/bin/gcc"
CCOMPILERCC="/usr/bin/gcc"
CCOMPILERCXX="/usr/bin/g++"
# how many thread must be used for compilation ( leave zero to use all available )
MTHREADS=0
# enable/disable warnings during compilation
CWARNINGS=1
# enable/disable some debug informations ( it's not a debug compilation )
CDEBUG=0
# specify compilation type
CCTYPE=Release
# compile scripts
CSCRIPTS=1
# compile server
CSERVERS=1
# compile tools
CTOOLS=0
# use precompiled headers ( fatest compilation but not optimized if you change headers often )
CSCRIPTPCH=1
CCOREPCH=1
# absolute root path of your azerothshard repository
SRCPATH=
# absolute path where binary files must be stored
BINPATH=
# absolute path where config. files must be stored
CONFDIR=
-5
View File
@@ -1,5 +0,0 @@
source "./config.sh.dist" # "hack" to avoid missing conf variables
if [ -f "./config.sh" ]; then
source "./config.sh" # should overwrite previous
fi