-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakeall.sh
More file actions
40 lines (33 loc) · 814 Bytes
/
Copy pathmakeall.sh
File metadata and controls
40 lines (33 loc) · 814 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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGET="${1:-all}"
MODS_DIR="${ROOT_DIR}/bof24"
if [ ! -d "${MODS_DIR}" ]; then
echo "bof24 目录不存在: ${MODS_DIR}" >&2
exit 1
fi
built=()
failed=()
for dir in "${MODS_DIR}"/*; do
[ -d "${dir}" ] || continue
name="$(basename "${dir}")"
[ "${name}" = "base_template" ] && continue
if [ -f "${dir}/Makefile" ]; then
echo "==> ${name}: make ${TARGET}"
if make -C "${dir}" "${TARGET}"; then
built+=("${name}")
else
failed+=("${name}")
fi
fi
done
echo ""
echo "完成: ${#built[@]} 成功, ${#failed[@]} 失败"
if [ ${#built[@]} -gt 0 ]; then
printf "成功: %s\n" "${built[@]}"
fi
if [ ${#failed[@]} -gt 0 ]; then
printf "失败: %s\n" "${failed[@]}"
exit 1
fi