-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-all.sh
executable file
·74 lines (64 loc) · 1.48 KB
/
build-all.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
#!/bin/sh
# Script builds all packets
# ---- VARIABLES ----
cur_dir=$(pwd)
opt="" # option for each ./build.sh execution
msg="" # message that shows before each action
# Packets available for building
packets="\
instead \
instead-game-cat \
instead-game-lines \
instead-game-toilet3in1"
# ---- FUNCTIONS ----
print_usage() {
echo "Usage: $0 <option>"
echo
echo "OPTIONS:"
echo "-c | --clean - clean built files"
echo "-dc | --distclean - clean built files and result packets"
echo "-b | --build - Build all available packets"
echo "-a | --all - The same as \"--build\""
echo "-l | --list - Print list of packets to be built with \"-b\" option"
echo "-h | --help - This help"
}
process_all() {
for f in $packets; do
echo "<<<<<<<< $msg $f >>>>>>>>"
cd $f/src
./build.sh $opt
cd $cur_dir
done
}
# ---- ENTRY POINT ----
case "$1" in
"-c"|"--clean")
opt=--clean
msg=Cleaning
;;
"-dc"|"--distclean")
opt=--distclean
msg=Purging
;;
"-b"|"--build"|"-a"|"--all")
opt=--all
msg=Building
;;
"-l"|"--list")
echo "Available packets:"
for p in $packets; do
echo " - $p"
done
exit 0
;;
"-h"|"--help")
print_usage
exit 0
;;
*)
echo "Invalid argument specified" >&2
print_usage
exit 1
;;
esac
process_all