forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-extensions.sh
More file actions
executable file
·52 lines (40 loc) · 1.08 KB
/
build-extensions.sh
File metadata and controls
executable file
·52 lines (40 loc) · 1.08 KB
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
#!/bin/bash
# Utility script called by the build system to compile extensions
set -eu
function err() {
echo "ERROR: $@" >&2
}
function do_cmd {
if [[ ! -z "${V}" ]]; then
echo "$@"
fi
"$@"
}
function build_widget {
do_cmd "$1" "$2" "'dummy1'" "'dummy2'" "'dummy3'" "$3" "$4" \
$(dirname "${5}") $(basename "${5}") \
"$6" "$7" "$8" "$9"
return 0
}
# Detect verbose mode
V=${V:-}
# Arguments 9 and above are the list of extensions to compile
readonly server_engine=$1
readonly packager=$2
readonly docs_extractor=$3
readonly docs_parser=$4
readonly destination_dir=$5
readonly remove_src=$6
readonly lc_compile=$7
readonly module_dir=$8
shift 8
# Find the dependency/build ordering of the extensions
readonly build_order=$(${lc_compile} --modulepath ${module_dir} --deps order -- $@)
# Loop over the extensions that need to be (re-)built
for ext in ${build_order} ; do
build_widget "${server_engine}" "${packager}" \
"${docs_extractor}" "${docs_parser}" \
"${ext}" \
"${destination_dir}" "${remove_src}" "${lc_compile}" \
"${module_dir}"
done