uploading compiler scripts
This commit is contained in:
16
bin/compiler/1-clean.sh
Executable file
16
bin/compiler/1-clean.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. "defines.sh"
|
||||||
|
|
||||||
|
echo "Cleaning build files"
|
||||||
|
|
||||||
|
CWD=$(pwd)
|
||||||
|
|
||||||
|
cd $BUILDPATH
|
||||||
|
|
||||||
|
make -f Makefile clean
|
||||||
|
make clean
|
||||||
|
find -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} \+
|
||||||
|
|
||||||
|
cd $CWD
|
||||||
|
|
||||||
19
bin/compiler/2-configure.sh
Executable file
19
bin/compiler/2-configure.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. "defines.sh"
|
||||||
|
|
||||||
|
CWD=$(pwd)
|
||||||
|
|
||||||
|
cd $BUILDPATH
|
||||||
|
|
||||||
|
echo "Build path: $BUILDPATH"
|
||||||
|
echo "DEBUG info: $CDEBUG"
|
||||||
|
echo "Compilation type: $CCTYPE"
|
||||||
|
# -DCMAKE_BUILD_TYPE=$CCTYPE disable optimization "slow and huge amount of ram"
|
||||||
|
# -DWITH_COREDEBUG=$CDEBUG compiled with debug information
|
||||||
|
|
||||||
|
cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH -DCONF_DIR=$CONFDIR -DSERVERS=$CSERVERS -DSCRIPTS=$CSCRIPTS \
|
||||||
|
-DCMAKE_C_COMPILER=$COMPILER_C -DCMAKE_CC_COMPILER=$COMPILER_CC -DCMAKE_CXX_COMPILER=$COMPILER_CXX \
|
||||||
|
-DTOOLS=$CTOOLS -DUSE_SCRIPTPCH=$CSCRIPTPCH -DUSE_COREPCH=$CCOREPCH -DWITH_COREDEBUG=$CDEBUG -DCMAKE_BUILD_TYPE=$CCTYPE -DWITH_WARNINGS=$CWARNINGS
|
||||||
|
|
||||||
|
cd $CWD
|
||||||
17
bin/compiler/3-build.sh
Executable file
17
bin/compiler/3-build.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. "defines.sh"
|
||||||
|
|
||||||
|
|
||||||
|
[ $MTHREADS == 0 ] && MTHREADS=`grep -c ^processor /proc/cpuinfo` && MTHREADS=$(($MTHREADS + 2))
|
||||||
|
|
||||||
|
echo "Using $MTHREADS threads"
|
||||||
|
|
||||||
|
CWD=$(pwd)
|
||||||
|
|
||||||
|
cd $BUILDPATH
|
||||||
|
|
||||||
|
time make -j $MTHREADS
|
||||||
|
make -j $MTHREADS install
|
||||||
|
|
||||||
|
cd $CWD
|
||||||
34
bin/compiler/config.sh.dist
Normal file
34
bin/compiler/config.sh.dist
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# AZTH
|
||||||
|
# compile azth plugins for custom features
|
||||||
|
CAZTH_PLG=1
|
||||||
|
# compile azth plugins for trinitycore features
|
||||||
|
CAZTH_TC_PLG=1
|
||||||
|
# enable unit test on TC load
|
||||||
|
CAZTH_UNIT_TEST=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=
|
||||||
21
bin/compiler/defines.sh
Normal file
21
bin/compiler/defines.sh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./config.sh.dist # "hack" to avoid missing conf variables
|
||||||
|
|
||||||
|
source ./config.sh # should overwrite previous
|
||||||
|
|
||||||
|
# you can choose build type from cmd argument
|
||||||
|
if [ ! -z $1 ]
|
||||||
|
then
|
||||||
|
CCTYPE=$1
|
||||||
|
CCTYPE=${CCTYPE^} # capitalize first letter if it's not yet
|
||||||
|
fi
|
||||||
|
|
||||||
|
BUILDPATH=$BINPATH
|
||||||
|
|
||||||
|
[ $CCTYPE == "Debug" ] && BUILDPATH="$BUILDPATH/debug/build/" || BUILDPATH="$BUILDPATH/release/build/"
|
||||||
|
|
||||||
|
[ $CCTYPE == "Debug" ] && BINPATH="$BINPATH/debug" || BINPATH="$BINPATH/release"
|
||||||
|
|
||||||
|
mkdir -p $BUILDPATH
|
||||||
|
mkdir -p $BINPATH
|
||||||
Reference in New Issue
Block a user