-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildAll.sh
More file actions
55 lines (47 loc) · 1.03 KB
/
buildAll.sh
File metadata and controls
55 lines (47 loc) · 1.03 KB
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
#!/bin/bash
# Domyślnie ustawienie trybu Release
BUILD_TYPE="Release"
# Enable testing
ENABLE_TESTS=false
# Build flags
BUILD_FLAGS=""
# Sprawdzenie, czy podano flagę -d
while getopts ":dt" opt; do
case ${opt} in
d )
BUILD_TYPE="Debug"
BUILD_FLAGS="${BUILD_FLAGS} -d"
;;
t )
ENABLE_TESTS=true
BUILD_FLAGS="${BUILD_FLAGS} -t"
;;
\? )
echo "Nieprawidłowy argument, poprawne użycie:" 1>&2
echo " > debug: ./buildAll.sh -d" 1>&2
echo " > release: ./buildAll.sh" 1>&2
exit 1
;;
esac
done
# Funkcja budująca program
build_program() {
PROGRAM_NAME="$1"
echo "Building $PROGRAM_NAME with flags $BUILD_FLAGS"
cd "$PROGRAM_NAME"
./build.sh $BUILD_FLAGS || exit 1
cd ..
}
# Lista programów do zbudowania
PROGRAMS=(
"communication"
"compression_encryption"
"management"
"transaction"
"core"
)
# Budowanie każdego programu
for PROGRAM in "${PROGRAMS[@]}"; do
build_program "$PROGRAM"
done
echo "All programs built successfully!"