-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·48 lines (41 loc) · 1.9 KB
/
build.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
echo "=======================[ Building the executable : ]======================="
echo ""
mkdir build
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -E -e "s/PageRank/Proj/g" pagerank.gpr > proj.gpr
else
sed -E -e "/package Linker is/,/end Linker;/d" -e "s/PageRank/Proj/g" pagerank.gpr > proj.gpr
fi
for i in "$@"; do
if [[ "$i" == "-test" ]]; then
sed -E -i '' -e "s/for Main use \(\".*\"\);/for Main use \(\"testfull.adb\", \"testsparse.adb\"\);/g" proj.gpr
fi
done
gprbuild -P proj.gpr -cargs -gnatef
rm proj.gpr
echo ""
echo "==========================================================================="
for i in "$@"; do
if [[ "$i" == "-run" ]]; then
echo "\n\n"
echo "=======================[ Running the executable : ]========================"
echo ""
echo "---------------------------------------------------------------------------"
#sed -E -n -e '/for Main use \(\".*.adb\"\);/p' pagerank.gpr | sed -E -e 's/.*for Main use \(\"/.\/build\//' -e 's/.adb\"\);.*//' | bash
time ./build/pagerank -K 150 -P -E 0.0 -A 0.85 -R ./static/worm -C ./static/worm.net
echo "---------------------------------------------------------------------------"
echo ""
echo "==========================================================================="
elif [[ "$i" == "-test" ]]; then
echo "\n\n"
echo "=======================[ Running the executable : ]========================"
echo ""
echo "---------------------------------------------------------------------------"
./build/testfull
echo "---------------------------------------------------------------------------"
./build/testsparse
echo "---------------------------------------------------------------------------"
echo ""
echo "==========================================================================="
fi
done