Repository navigation
Expand file tree
/
Copy pathclear_tools
More file actions
executable file
·70 lines (54 loc) · 2.45 KB
/
Copy pathclear_tools
File metadata and controls
executable file
·70 lines (54 loc) · 2.45 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
set -e
root=`dirname $0`
cd "$root"
root=`pwd`
################################################################################
# On FreeBSD, always ensure /usr/local/bin comes first in PATH if existing
test "$(uname -s 2> /dev/null)" = "FreeBSD" && {
test -d "/usr/local/bin" && {
export PATH="/usr/local/bin:${PATH:-}"
}
}
################################################################################
# Prefer gmake if available and MAKE is unset
test -z "${MAKE:-}" && {
command -v "gmake" > /dev/null 2>&1 && {
export MAKE="$(command -v gmake)"
}
}
################################################################################
printf 'INF: clearing examples in %s\n' "$root"
(cd "$root/examples" && "${MAKE:-make}" clean)
rm -f "$root/examples/hellomsb.prt"
rm -f "$root/examples/lzexemsc.old"
printf 'INF: removing native tool binaries ...\n'
rm -rf "$root/bin/emu2.built" "$root/bin/tnylpo" "$root/bin/nasm" "$root/bin/upx"
rm -rf "$root/bin/cmdinfo" "$root/bin/bin2cmd" "$root/bin/exe2cmd" "$root/bin/cmdmod" \
"$root/bin/h862bin" "$root/bin/doscat" "$root/bin/hexcom" "$root/bin/ansi2kr" \
"$root/bin/drpli_objfix" "$root/bin/tnylpo-convert" \
"$root/bin/pc" "$root/bin/crc" "$root/bin/mlbr" \
"$root/bin/mzchecksum" "$root/bin/bin2asm"
printf 'INF: cleaning src/tools ...\n'
(cd "$root/src/tools" && "${MAKE:-make}" clean)
printf 'INF: cleaning src/aztec43-acc ...\n'
(cd "$root/src/aztec43-acc" && "${MAKE:-make}" clean)
printf 'INF: removing share trees ...\n'
rm -rf "$root/share/pcdev" "$root/share/emu" "$root/share/aztec"?? \
"$root/share/cpm" "$root/share/cb86"* \
"$root/share/dr"* "$root/share/f77"* "$root/share/turbo"* \
"$root/share/intel" "$root/share/m2cb"* \
"$root/share/xlisp" "$root/share/plicpm" \
"$root/share/polypascpm" "$root/share/polypasdos" \
"$root/share/mfcobolcpm" "$root/share/lzexe"
printf 'INF: removing fetch logs ...\n'
rm -f "$root"/fetch-*.log
printf 'INFO: removing test output ...\n'
(cd "$root/src/aztecreg" && "${MAKE:-make}" clean)
rm -f "$root"/src/cpmtest/*.cmd "$root"/src/cpmtest/*.out
printf 'INF: removing legacy build trees ...\n'
# Remove legacy root-level build trees (relocated to archive/ - transitional)
rm -rf "$root/emu2" "$root/tnylpo" "$root/nasm" "$root/upx" "$root/cmdtools"
rm -f "$root/bin/bin2cmd" "$root/bin/cmdinfo" "$root/bin/exe2cmd"
rmdir "$root/share" > /dev/null 2>&1 || true
printf 'INF: clear completed\n'