This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
prepare.sh
executable file
·93 lines (78 loc) · 1.56 KB
/
prepare.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
# Copyright: 2015 Masatake YAMATO
# License: GPL-2 or later
help ()
{
echo "$0 CTAGS-EXECUTABLE UNITS-SCRIPT"
}
case "$1" in
-h|--help|help|-?)
help
exit 0
;;
esac
if [ $# -lt 2 ]; then
echo "### Too few arguments" 1>&2
help 1>&2
exit 2
fi
if [ $# -gt 2 ]; then
echo "### Too many arguments" 1>&2
help 1>&2
exit 2
fi
if [ ! -e "$1" ]; then
echo "cannot find dentry for ctags executable: $1" 1>&2
exit 1
fi
if [ ! -f "$1" ]; then
echo "cannot find file for ctags executable: $1" 1>&2
exit 1
fi
if [ ! -x "$1" ]; then
echo "not an executable: $1" 1>&2
exit 1
fi
CTAGS=$1
if [ ! -e "$2" ]; then
echo "cannot find dentry for units test-harness script: $2" 1>&2
exit 1
fi
if [ ! -f "$1" ]; then
echo "cannot find file for units test-harness script: $2" 1>&2
exit 1
fi
UNITS=$2
echo -n Making symlink for ctags...
if ! ln -f -s $CTAGS ./ctags; then
echo "failed to make a symlink for ctags executable" 1>&2
exit 1
else
echo done
fi
echo -n Making misc directory...
if ! mkdir -p ./misc; then
echo "failed to make misc directory" 1>&2
exit 1
else
echo done
fi
echo -n Making symlink for units...
if ! ln -r -f -s $UNITS ./misc/units; then
echo "failed to make a symlink for units test harness script" 1>&2
exit 1
else
echo done
fi
echo -n libexec...
if ! mkdir -p ./libexec; then
echo "failed to make libexec directory" 1>&2
exit 1
else
echo done
fi
echo -n datadir...
for d in Units/*.d; do
(cd $d; ln -f -s ../../optlib ./optlib)
done
echo done