-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·48 lines (43 loc) · 1018 Bytes
/
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
#!/bin/bash
# build.sh
# Function to display usage
usage() {
echo "Usage: $0 [host|pico|all]"
echo " host: Build and run host tests"
echo " pico: Build Pico targets"
echo " all: Build both (in separate directories)"
exit 1
}
# Create build directories if they don't exist
mkdir -p build-host
mkdir -p build-pico
case "$1" in
"host")
echo "Building host tests..."
cd build-host
cmake -DBUILD_PICO=OFF ..
make
./flight_controller_tests_host
;;
"pico")
echo "Building Pico targets..."
cd build-pico
cmake -DBUILD_HOST=OFF -DPICO_BOARD=pico2 ..
make
;;
"all")
echo "Building host tests..."
cd build-host
cmake -DBUILD_PICO=OFF ..
make
./flight_controller_tests_host
cd ..
echo "Building Pico targets..."
cd build-pico
cmake -DBUILD_HOST=OFF ..
make
;;
*)
usage
;;
esac