forked from HandBrake/HandBrake-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-tools
More file actions
executable file
·42 lines (37 loc) · 805 Bytes
/
build-tools
File metadata and controls
executable file
·42 lines (37 loc) · 805 Bytes
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
#!/bin/bash
# vars
SELF="${BASH_SOURCE[0]}"
BASE_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd -P)
BASE_DIR="${BASE_DIR:-$(pwd)}"
TOOLS_DIR="${BASE_DIR}/tools"
SYSTEM_NAME=$(uname -s)
# discount
function build_discount {
cd "${TOOLS_DIR}/discount"
if make clean; then
make distclean
fi
if [[ "${SYSTEM_NAME}" == "Darwin" ]]; then
./configure.sh --mandir=/usr/local/share/man
else
./configure.sh
fi
make
}
# base directory (absolute)
cd "${BASE_DIR}"
# main
cd "${TOOLS_DIR}"
ERROR=false
for TOOL in */; do
TOOL="${TOOL%/}" # strip trailing slash
if ! build_${TOOL} >/dev/null 2>&1; then
ERROR=true
echo "Error: Unable to build tool '${TOOL}'." >&2
fi
done
# done
if [[ "${ERROR}" == true ]]; then
exit 1
fi
exit 0