-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile-test.null
66 lines (58 loc) · 1.13 KB
/
compile-test.null
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
#!/bin/bash
me="$(basename "${BASH_SOURCE[0]}")"
my_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
usage() {
echo "Usage: $me <test_name> [options]"
echo ""
echo " -h | --help show this message and exit"
echo " -d | --debug compile in debug mode (full debug info)"
echo " -r | --release compile in release mode"
echo " -a | --assembly produce assembly listing"
echo ""
echo "Examples:"
echo " $me intrinsics/floatadd --release"
exit
}
if [ $# -lt 1 ]
then
usage
else
test_name=$1
if [ ! -d "$test_name" ]
then
echo "The specified test \"$test_name\" does not exist"
exit 1
fi
shift
fi
flags="-\;+ -\(+"
while test $# -gt 0
do
case "$1" in
"-h" | "--help")
usage
;;
"-d" | "--debug")
flags="$flags -d3"
;;
"-r" | "--release")
flags="$flags -d0"
;;
"-a" | "--assembly")
flags="$flags -a"
;;
esac
shift
done
include="$SAMP_SERVER_ROOT/pawno/include"
if [ -d "$include" ]
then
flags="$flags -i$include"
fi
include="$my_dir/include"
if [ -d "$include" ]
then
flags="$flags -i$include"
fi
cd $test_name
pawncc $flags -c test.pwn