forked from AbsInt/CompCert
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebug.sh
executable file
·62 lines (55 loc) · 1.2 KB
/
debug.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
#!/bin/bash
# This script is for development use
# Clean everything
pushd classics/$1/
if [ $? -ne 0 ]; then
echo 'Test not found. Possible tests are: '
ls classics
exit
fi
rm *.o
rm *.s
rm executable
popd
# Compilation
pushd classics/$1/
../../../../ccomp -c stanlib.c
if [ $? -ne 0 ]; then
echo 'Compilation of stan library failed'
exit
else
echo "Compilation success: library"
fi
../../../../ccomp -c parser.c
if [ $? -ne 0 ]; then
echo 'Compilation of runtime parser failed'
exit
else
echo "Compilation success: runtime parser"
fi
../../../../ccomp -c code.light.c
if [ $? -ne 0 ]; then
echo 'Compilation of stan program' $1 'failed'
cat code.stan.c.* > code.stan.c.all
exit
else
echo 'Compilation success: stan'
fi
../../../../ccomp -I. -c prelude.c
if [ $? -ne 0 ]; then
echo 'Compilation of prelude failed'
exit
else
echo "Compilation success: prelude"
fi
../../../../ccomp -I. -c Runtime.c
if [ $? -ne 0 ]; then
echo 'Compilation of runtime failed'
exit
else
echo "Compilation success: runtime"
fi
../../../../ccomp parser.o stanlib.o prelude.o Runtime.o code.light.o -o executable -lm
# Run
./executable $2 data.json params.json
popd