forked from ongbe/trading_engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildWorld.sh
executable file
·39 lines (33 loc) · 911 Bytes
/
buildWorld.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
CORE_MINUS_1=$(cat /proc/cpuinfo | grep processor | tail -n 1 | awk '{print $3}')
TARGET_FOLDER=target
BIN_FOLDER=bin
BUILD_MODE=DEBUG
[[ -n $(which ctags) ]] && ctags -R .
###################################################
cd src/main/libjson
make clean
mkdir Objects_static/
make -j $CORE_MINUS_1
cd ../../..
###################################################
if [[ $@ == *"c"* && -d $TARGET_FOLDER ]]
then
rm -rf $TARGET_FOLDER
fi
[[ ! -d $TARGET_FOLDER ]] && mkdir $TARGET_FOLDER
[[ ! -d $BIN_FOLDER ]] && mkdir $BIN_FOLDER
cd $TARGET_FOLDER
if [[ $BUILD_MODE == "DEBUG" ]]
then
cmake -DCMAKE_BUILD_TYPE=Debug ../src/main/
else
cmake -DCMAKE_BUILD_TYPE=Release ../src/main/
fi
MAKE_VERBOSITY=""
if [[ $@ == *"v"* ]]
then
MAKE_VERBOSITY="VERBOSE=1"
fi
make -j $CORE_MINUS_1 $MAKE_VERBOSITY
find . -type f -executable | grep -v CMakeFiles | xargs -I{} cp {} ../$BIN_FOLDER