-
Notifications
You must be signed in to change notification settings - Fork 108
/
mvm
executable file
·53 lines (53 loc) · 1.31 KB
/
mvm
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
#!/usr/bin/env bash
set -e
# A=all(a,d,f) T=Threaded a=assert d=debug f=fast
A=;D=;F=;T=
if [ $# = 0 ]; then
A=1;D=1;F=1
else
while getopts 'ASTadf?' opt "$@"; do
case $opt in
A) A=1;D=1;F=1;;
S) echo -S not yet implemented\; use -A for now 1>&1; exit 1;;
T) T=1;;
a) A=1;;
d) D=1;;
f) F=1;;
*) echo usage $0 [-A] [-a\ [-d] [-f]; exit 0;;
esac
done
if [ "$1" = -- ]; then
if [ "$A$D$F" = "" ]; then
A=1;D=1;F=1
fi
fi
shift `expr $OPTIND - 1` # drop options, pass other args to make
fi
if ../../../scripts/checkSCCSversion ; then exit 1; fi
if [ -z "$T" ]; then # single-threaded VM
if [ -n "$D" ]; then
rm -rf builddbg/vm/*.exe
make $@ debug 2>&1 | tee LOGD ; test ${PIPESTATUS[0]} -eq 0
fi
if [ -n "$A" ]; then
rm -rf buildast/vm/*.exe
make $@ assert 2>&1 | tee LOGA ; test ${PIPESTATUS[0]} -eq 0
fi
if [ -n "$F" ]; then
rm -rf build/vm/*.exe
make $@ product 2>&1 | tee LOGF ; test ${PIPESTATUS[0]} -eq 0
fi
else # multi-threaded VM
if [ -n "$D" ]; then
rm -rf buildmtdbg/vm/*.exe
make $@ debugmt 2>&1 | tee LOGTD ; test ${PIPESTATUS[0]} -eq 0
fi
if [ -n "$A" ]; then
rm -rf buildmtast/vm/*.exe
make $@ assertmt 2>&1 | tee LOGTA ; test ${PIPESTATUS[0]} -eq 0
fi
if [ -n "$F" ]; then
rm -rf buildmt/vm/*.exe
make $@ productmt 2>&1 | tee LOGTF ; test ${PIPESTATUS[0]} -eq 0
fi
fi