-
-
Notifications
You must be signed in to change notification settings - Fork 618
/
Bootstrap.sh
executable file
·50 lines (43 loc) · 1.1 KB
/
Bootstrap.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
#!/bin/sh
DIR=$( cd "$( dirname "$0" )" && pwd )
cd "$DIR"
COSMO_FLAG=""
for arg in "$@"; do
if [ "$arg" = "-cosmo" ]; then
COSMO_FLAG="cosmo"
break
fi
done
PLATFORM_ARG=""
CONFIG_ARG=""
PREMAKE_OPTS_ARG=""
if [ -n "$PLATFORM" ]; then
PLATFORM_ARG="PLATFORM=$PLATFORM"
fi
if [ -n "$CONFIG" ]; then
CONFIG_ARG="CONFIG=$CONFIG"
fi
if [ -n "$PREMAKE_OPTS" ]; then
PREMAKE_OPTS_ARG="PREMAKE_OPTS=$PREMAKE_OPTS"
fi
case "$(uname -s)" in
Linux)
NPROC=$(nproc --all)
make -f Bootstrap.mak ${COSMO_FLAG:-linux} $PLATFORM_ARG $CONFIG_ARG $PREMAKE_OPTS_ARG -j$NPROC
;;
Darwin)
NPROC=$(sysctl -n hw.ncpu)
make -f Bootstrap.mak ${COSMO_FLAG:-osx} $PLATFORM_ARG $CONFIG_ARG $PREMAKE_OPTS_ARG -j$NPROC
;;
FreeBSD|OpenBSD|NetBSD)
NPROC=$(sysctl -n hw.ncpu)
make -f Bootstrap.mak ${COSMO_FLAG:-bsd} $PLATFORM_ARG $CONFIG_ARG $PREMAKE_OPTS_ARG -j$NPROC
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*)
make -f Bootstrap.mak ${COSMO_FLAG:-mingw} $PLATFORM_ARG $CONFIG_ARG $PREMAKE_OPTS_ARG -j$NPROC
;;
*)
echo "Unsupported platform"
exit 1
;;
esac