forked from WohlSoft/Moondust-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_deps.sh
More file actions
executable file
·89 lines (73 loc) · 1.6 KB
/
build_deps.sh
File metadata and controls
executable file
·89 lines (73 loc) · 1.6 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#/bin/bash
bak=~+
cd $PWD
OurOS="linux_defaut"
if [[ "$OSTYPE" == "darwin"* ]]; then
OurOS="macos"
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
OurOS="linux"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
OurOS="freebsd"
fi
echo $OurOS
#=======================================================================
errorofbuid()
{
printf "\n\n=========ERROR!!===========\n\n"
cd $bak
exit 1
}
checkState()
{
if [ $? -eq 0 ]
then
echo "[good]"
else
errorofbuid
fi
}
buildLibs()
{
# build libraries
cd "$PrjPath/_Libs/_sources"
InstallTo=$(echo ~+/../_builds/$OurOS)
if [[ "$OurOS" == "macos" ]]; then
InstallTo=$(readlink $InstallTo)
else
InstallTo=$(readlink -f $InstallTo)
fi
echo $InstallTo
source ./___build_script.sh
}
PrjPath=$PWD
if [ -f "$PWD/_paths.sh" ]
then
source "$PWD/_paths.sh"
else
echo ""
echo "_paths.sh is not exist! Run \"generate_paths.sh\" first!"
errorofbuid
fi
#=======================================================================
if [[ "$1" == "no-libs" ]]; then
echo "Building of tag.gz libraries skiped"
echo "Building SDL2_mixer, OOLua and Box2D..."
else
buildLibs
fi
cd "$PrjPath/_Libs"
$QMake CONFIG+=release CONFIG-=debug DEFINES+=USE_LUA_JIT
checkState
#=======================================================================
make
checkState
#=======================================================================
# copy data and configs into the build directory
make install
checkState
cd ..
#=======================================================================
printf "\n\n=========BUILT!!===========\n\n"
cd $bak
# if [[ $1 != "no-pause" ]]; then read -n 1; fi
exit 0