-
Notifications
You must be signed in to change notification settings - Fork 4
/
run
executable file
·104 lines (95 loc) · 2.3 KB
/
run
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
NAME=eflete
BD=./build
remove_build_dir()
{
[ -d ${BD} ] && rm -rf $BD
}
meson_setup()
{
meson setup . $BD -Dbuildtype=debug -Dwarning_level=2 -Dwerror=true -Dbuild-tests=true
}
meson_compile()
{
meson compile -C $BD
}
meson_install()
{
meson install -C $BD
}
meson_uninstall()
{
if [ -d ${BD} ]; then
sudo ninja -C $BD uninstall
else
echo "Nothing to be done! At first build and install it by './run c && ./run i'"
fi
}
meson_test()
{
if [ -d ${BD} ]; then
meson test -C $BD # be sure that build-tests is true in meson options
else
echo "Nothing to be done! Needs to be compiled by './run c'"
fi
}
case "$1" in
s|setup)
remove_build_dir
meson_setup
;;
c|compile)
echo "$NAME: Compilation started"
remove_build_dir
meson_setup
meson_compile
echo "$NAME: Compilation finished"
;;
i|install)
meson_install
;;
u|uninstall)
meson_uninstall
;;
r|run)
exec $BD/src/bin/$NAME
;;
cl|clear)
rm -rf ~/.config/$NAME
;;
t|test)
meson_test
;;
cc|cocci)
exec ./scripts/coccinelle/coccicheck.sh
;;
cv|coverage)
remove_build_dir
meson setup . $BD -Db_coverage=true
meson_compile
meson_test
ninja coverage-text -C $BD
# ninja coverage-html -C $BD
;;
po|translation)
./po/potfiles-update.sh
ninja -C $BD po
;;
ts|timestamp)
find . -exec touch {} \;
;;
*)
echo "Usage: $0 [cmd]"
echo " s|setup setup meson build system"
echo " c|compile compile project using meson"
echo " i|install install project"
echo " u|uninstall uninstall project"
echo " r|run run local executable (in build dir)"
echo " cl|clear clear (remove) home config dir"
echo " t|test build tests"
echo " cc|cocci run coccinelle analysis"
echo " cv|coverage build coverage report"
echo " po|translation build (update) localization files"
echo " ts|timestemp update access time of each file"
;;
esac