mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
restructured repository based on following standards:
https://github.com/HW-Core/directory-structure
This commit is contained in:
5
bin/compiler/includes/common.sh
Normal file
5
bin/compiler/includes/common.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
source "./config.sh.dist" # "hack" to avoid missing conf variables
|
||||
|
||||
if [ -f "./config.sh" ]; then
|
||||
source "./config.sh" # should overwrite previous
|
||||
fi
|
||||
16
bin/compiler/includes/defines.sh
Normal file
16
bin/compiler/includes/defines.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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
|
||||
|
||||
INSTALL_PATH=$(readlink -f "$BINPATH/../")
|
||||
|
||||
[ $CCTYPE == "Debug" ] && BUILDPATH="$BUILDPATH/debug/build/" || BUILDPATH="$BUILDPATH/release/build/"
|
||||
|
||||
[ $CCTYPE == "Debug" ] && BINPATH="$BINPATH/debug" || BINPATH="$BINPATH/release"
|
||||
55
bin/compiler/includes/functions.sh
Normal file
55
bin/compiler/includes/functions.sh
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
function clean() {
|
||||
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
|
||||
}
|
||||
|
||||
function configure() {
|
||||
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 -DSCRIPTS_COMMANDS=$CSCRIPTS -DSCRIPTS_CUSTOM=$CSCRIPTS -DSCRIPTS_EASTERNKINGDOMS=$CSCRIPTS -DSCRIPTS_EVENTS=$CSCRIPTS -DSCRIPTS_KALIMDOR=$CSCRIPTS \
|
||||
-DSCRIPTS_NORTHREND=$CSCRIPTS -DSCRIPTS_OUTDOORPVP=$CSCRIPTS -DSCRIPTS_OUTLAND=$CSCRIPTS -DSCRIPTS_PET=$CSCRIPTS -DSCRIPTS_SPELLS=$CSCRIPTS -DSCRIPTS_WORLD=$CSCRIPTS \
|
||||
-DTOOLS=$CTOOLS -DUSE_SCRIPTPCH=$CSCRIPTPCH -DUSE_COREPCH=$CCOREPCH -DWITH_COREDEBUG=$CDEBUG -DCMAKE_BUILD_TYPE=$CCTYPE -DWITH_WARNINGS=$CWARNINGS \
|
||||
-DAZTH_WITH_UNIT_TEST=$CAZTH_UNIT_TEST -DAZTH_WITH_CUSTOM_PLUGINS=$CAZTH_CUSTOM_PLG -DAZTH_WITH_PLUGINS=$CAZTH_PLG \
|
||||
-DCMAKE_C_COMPILER=$CCOMPILERC -DCMAKE_CXX_COMPILER=$CCOMPILERCXX
|
||||
|
||||
cd $CWD
|
||||
|
||||
runHooks "ON_AFTER_CONFIG"
|
||||
}
|
||||
|
||||
|
||||
function build() {
|
||||
[ $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
|
||||
|
||||
runHooks "ON_AFTER_BUILD"
|
||||
}
|
||||
19
bin/compiler/includes/includes.sh
Normal file
19
bin/compiler/includes/includes.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source "$CURRENT_PATH/../../bash_shared/includes.sh"
|
||||
|
||||
AZTH_PATH_COMPILER="$AZTH_PATH_BIN/compiler"
|
||||
|
||||
function azth_on_after_build() {
|
||||
# move the run engine
|
||||
cp -rvf "$AZTH_PATH_BIN/runners/"* "$INSTALL_PATH/bin/"
|
||||
}
|
||||
|
||||
registerHooks "ON_AFTER_BUILD" azth_on_after_build
|
||||
|
||||
source "$AZTH_PATH_COMPILER/includes/defines.sh"
|
||||
|
||||
source "$AZTH_PATH_COMPILER/includes/functions.sh"
|
||||
|
||||
mkdir -p $BUILDPATH
|
||||
mkdir -p $BINPATH
|
||||
Reference in New Issue
Block a user