6 Usage syntax: ./build.sh <TARGET>
9 * You can specify multiple targets.
10 ./build.sh <TARGET_1> <TARGET_2> <TARGET_N>
11 * To get a list of all targets use \"help\". Hint: pipe the output through a pager.
12 ./build.sh help | less
13 * To build all targets use \"all\"
15 * To clean a target prefix it with \"clean_\".
16 ./build.sh clean_MATEKF405SE
17 * To clean all targets just use \"clean\".
22 if [ -z "$(docker images -q inav-build)" ]; then
23 echo -e "*** Building image\n"
24 docker build
-t inav-build
--build-arg USER_ID
="$(id -u)" --build-arg GROUP_ID
="$(id -g)" .
28 if [ ! -d .
/build
]; then
29 echo -e "*** Creating build directory\n"
30 mkdir .
/build
&& chmod 777 .
/build
33 if [ ! -d .
/downloads
]; then
34 echo -e "*** Creating downloads directory\n"
35 mkdir .
/downloads
&& chmod 777 .
/downloads
38 if [ ! -d .
/tools
]; then
39 echo -e "*** Creating tools directory\n"
40 mkdir .
/tools
&& chmod 777 .
/tools
43 echo -e "*** Building targets [$@]\n"
44 docker run
--rm -it -v "$(pwd)":/src inav-build $@
46 if [ -z "$(ls ./build/*.hex &> /dev/null)" ]; then
47 echo -e "\n*** Built targets in ./build:"
48 stat
-c "%n (%.19y)" .
/build
/*.hex