-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·68 lines (59 loc) · 1.71 KB
/
build.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
60
61
62
63
64
65
66
67
68
#!/bin/bash
{
source mkrelease.sh
NJOBS="$(nproc)"
rm -rf cavecube*.tar.gz cavecube*.zip
buildrel() {
local TYPE="${1}"
local PLATFORM="${2}"
inf "Building ${TYPE} for ${PLATFORM}..."
make ${@:3} clean 1> /dev/null || _exit
RESPONSE=""
while ! make ${@:3} "-j${NJOBS}" 1> /dev/null; do
while [[ -z "${RESPONSE}" ]]; do
ask "${TB}Build failed. Retry?${TR} (${TB}Y${TR}es/${TB}N${TR}o/${TB}C${TR}lean): "
case "${RESPONSE,,}" in
y | yes)
break
;;
n | no)
break
;;
c | clean)
make ${@:3} clean 1> /dev/null || _exit
;;
*)
RESPONSE=""
;;
esac
done
case "${RESPONSE,,}" in
n | no)
RESPONSE="n"
break
;;
*)
RESPONSE=""
;;
esac
done
[[ "${RESPONSE}" == "n" ]] || pkgrel || _exit
make ${@:3} clean 1> /dev/null || _exit
[[ ! "${RESPONSE}" == "n" ]] || _exit 1
}
###################
## INTERPRETER ##
###################
# Linux x86_64
pkgrel() { _tar "bcbasic_linux_x86_64.tar.gz" cavecube; }
buildrel "interpreter" "Linux x86_64"
## Linux i686
#pkgrel() { _tar "bcbasic_linux_i686.tar.gz" cavecube; }
#buildrel "interpreter" "Linux i686" M32=y
# Windows x86_64
pkgrel() { _zip "bcbasic_windows_x86_64.zip" cavecube.exe; }
buildrel "interpreter" "Windows x86_64" WINCROSS=y
## Windows i686
#pkgrel() { _zip "bcbasic_windows_i686.zip" cavecube.exe; }
#buildrel "interpreter" "Windows i686" WINCROSS=y M32=y
}