-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_run.sh
More file actions
executable file
·49 lines (40 loc) · 859 Bytes
/
dev_run.sh
File metadata and controls
executable file
·49 lines (40 loc) · 859 Bytes
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
#!/bin/bash
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BUILD_DIR="$PROJECT_ROOT/build"
DEBUG=false
while getopts "dn:v" flag; do
case "${flag}" in
d)
DEBUG=true
;;
*)
echo "Invalid option: -${OPTARG}" >&2
exit 1
;;
esac
done
shift $((OPTIND-1))
echo "--- Building ---"
if [ "$DEBUG" = "true" ]; then
BUILD_SCOPE="debug"
make build debug
else
BUILD_SCOPE="release"
make build
fi
if [ $? -ne 0 ]; then
echo "❌ Build failed. Aborting run."
exit 1
fi
BINARY="$BUILD_DIR/$BUILD_SCOPE/MeshNetworking"
echo "--- Running ---"
if [ ! -f "$BINARY" ]; then
echo "❌ Binary not found at: $BINARY"
exit 1
fi
if [ "$DEBUG" = "true" ]; then
echo "Starting GDB..."
gdb --args "$BINARY" "$@"
else
"$BINARY" "$@"
fi