forked from TheChernoCommunity/GameProject-0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
59 lines (47 loc) · 1.4 KB
/
init.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
system=$(uname -s)
machine=$(uname -m)
# Fix virtual system on windows
for s in Windows CYGWIN MINGW MSYS UWIN; do
if [[ "$system" == "$s"* ]]; then
system=Windows
break
fi
done
echo "System is $system:$machine"
### Get premake binary
version=5.0.0-alpha13
location=.
download_base=https://github.com/premake/premake-core/releases/download/v$version/premake-$version
# Windows
if [[ "$system" == "Windows" ]]; then
file=$location/premake5.zip
curl -L -o $file $download_base-windows.zip
unzip -oqu $file -d $location/
rm -f $file
# Linux x86*
elif [[ "$system" == "Linux" && "$machine" == "x86"* ]]; then
file=$location/premake5.tar.gz
curl -L -o $file $download_base-linux.tar.gz
tar -xvzf $file -C $location/
rm -f $file
# macOS
elif [[ "$system" == "Darwin" ]]; then
file=$location/premake5.tar.gz
curl -L -o $file $download_base-macosx.tar.gz
tar -xvzf $file -C $location/
rm -f $file
# Prebuilt binaries not available. Build from source.
else
file=$location/premake5-src.zip
curl -L -o $file $download_base-src.zip
unzip -o $file -d $location/
echo "Premake binaries unavailable for $system:$machine. Building from source.."
make -f $location/Bootstrap.mak $system
cp $location/bin/release/premake5 $location/
rm -rf $location/premake-$version/
rm -f $file
fi
### Initialize submodules
git submodule update --init
git submodule foreach --recursive "git submodule update --init"