/
make.sh
executable file
·74 lines (68 loc) · 1.12 KB
/
make.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
#!/usr/bin/env bash
# Run the tests and count failed tests.
#function run_tests ()
#{
# x=0
#
# for file in tests/bin/*
# do
# if test -x ${file}
# then
# ./${file}
# fi
# if test 0 -ne $?
# then
# x=$((x+=1))
# fi
# done
#
# echo "Number of failed tests: $x"
#}
# Build the library
function make ()
{
gprbuild -p imago.gpr
echo ""
}
# Build the tests
#function make_tests
#{
# gprbuild -p imago-tests.gpr
# echo ""
#}
# Clean up built files
function clean
{
gprclean imago.gpr
# gprclean imago-tests.gpr
}
if test $# -eq 0
then
echo "No valid argument specified"
echo ""
echo "./make.sh imago to build library only"
# echo "./make.sh check to build tests and run them"
echo "./make.sh all to build library"
# echo "./make.sh all to build library, tests and run the tests"
echo "./make.sh clean to clean up files generated by build process"
exit 0
fi
if test $1 = "imago"
then
clean
make
#elif test $1 = "check"
#then
# clean
# make_tests
# run_tests
elif test $1 = "all"
then
clean
make
make_tests
run_tests
elif test $1 = "clean"
then
clean
fi