-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathprewarm-nxdk.sh
executable file
·72 lines (63 loc) · 1.13 KB
/
prewarm-nxdk.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
69
70
71
72
#!/usr/bin/env bash
function print_help_and_exit() {
echo "Usage: $0 [<option> ...]"
echo ""
echo "Options:"
echo " --help - Print this message"
echo " --debug - Build the nxdk libraries with debug symbols"
echo " --lto - Build the nxdk libraries with link time optimization"
echo " --clean - Clean the nxdk libraries before building"
exit 1
}
DEBUG=n
LTO=n
CLEAN=n
set +u
while [ ! -z "${1}" ]; do
case "${1}" in
'--debug'*)
DEBUG=y
shift
;;
'--lto'*)
LTO=y
shift
;;
'--clean'*)
CLEAN=y
shift
;;
'-h'*)
print_help_and_exit
;;
'-?'*)
print_help_and_exit
;;
'--help'*)
print_help_and_exit
;;
*)
echo "Ignoring unknown option '${1}'"
break
;;
esac
done
set -u
if [[ "$(NXDK_DIR:+x)" == "x" ]]; then
eval "$("${NXDK_DIR}/bin/activate" -s)"
else
eval "$(./third_party/nxdk/bin/activate -s)"
fi
set -eu
set -o pipefail
if [[ "${CLEAN}" == "y" ]]; then
cd "${NXDK_DIR}"
make clean
fi
cd "${NXDK_DIR}/samples"
set -x
for x in *; do
pushd "${x}"
DEBUG="${DEBUG}" LTO="${LTO}" make -j12
popd
done