Merge pull request #6177 from iNavFlight/agh_fix_compilation_servo_sbus
[inav.git] / build.sh
blob59d9221b6e7caa3d35d08839c3ae1ec73b0d1c91
1 set -e
3 if [[ $# == 0 ]]; then
4 echo -e "\
5 Usage syntax: ./build.sh <TARGET>
7 Notes:
8 * You can specify multiple targets.
9 * If no targets are specified, *all* of them will be built.
10 * To clean a target prefix it with \"clean_\".
11 * To clean all targets just use \"clean\"."
12 exit 1
15 if [ -z "$(docker images -q inav-build)" ]; then
16 echo -e "*** Building image\n"
17 docker build -t inav-build .
18 echo -ne "\n"
21 if [ ! -d ./build ]; then
22 echo -e "*** Creating build directory\n"
23 mkdir ./build
26 echo -e "*** Building targets [$@]\n"
27 docker run --rm -it -v "$(pwd)":/src inav-build $@
29 if ls ./build/*.hex &> /dev/null; then
30 echo -e "\n*** Built targets in ./build:"
31 stat -c "%n (%.19y)" ./build/*.hex