Bitmaps with a too big filename were displayed in the selection popup (#4646)
[opentx.git] / tools / build-companion.sh
blob998d073b3d4e61fa3b81278825462784707daa1f
1 #!/bin/bash
3 # Stops on first error, echo on
4 set -e
5 set -x
7 JOBS=2
9 while [ $# -gt 0 ]
11 case "$1" in
12 --jobs=*)
13 JOBS="${1#*=}";;
14 -j*)
15 JOBS="${1#*j}";;
16 -*)
17 echo >&2 "usage: $0 [-j<jobs>|--jobs=<jobs>] SRCDIR OUTDIR VERSION_SUFFIX"
18 exit 1;;
20 break;; # terminate while loop
21 esac
22 shift
23 done
25 SRCDIR=$1
26 OUTDIR=$2
28 COMMON_OPTIONS="-DALLOW_NIGHTLY_BUILDS=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=YES -DGAUGES=YES -DAUTOSWITCH=YES -DAUTOSOURCE=YES -DAUDIO=YES -DGPS=YES -DPPM_CENTER_ADJUSTABLE=YES -DFLIGHT_MODES=YES -DOVERRIDE_CHANNEL_FUNCTION=YES -DFRSKY_STICKS=YES"
29 if [ "$(uname)" = "Darwin" ]; then
30 COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_PREFIX_PATH=~/Qt/5.7/clang_64/ -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'"
33 if [ "$3" != "" ]; then
34 COMMON_OPTIONS="${COMMON_OPTIONS} -DVERSION_SUFFIX=$3"
37 rm -rf build
38 mkdir build
39 cd build
41 cmake ${COMMON_OPTIONS} -DPCB=9X ${SRCDIR}
42 make -j${JOBS} libsimulator
44 cmake ${COMMON_OPTIONS} -DPCB=GRUVIN9X ${SRCDIR}
45 make -j${JOBS} libsimulator
47 cmake ${COMMON_OPTIONS} -DPCB=MEGA2560 ${SRCDIR}
48 make -j${JOBS} libsimulator
50 cmake ${COMMON_OPTIONS} -DPCB=SKY9X ${SRCDIR}
51 make -j${JOBS} libsimulator
53 cmake ${COMMON_OPTIONS} -DPCB=9XRPRO ${SRCDIR}
54 make -j${JOBS} libsimulator
56 cmake ${COMMON_OPTIONS} -DPCB=X7 ${SRCDIR}
57 make -j${JOBS} libsimulator
59 cmake ${COMMON_OPTIONS} -DPCB=X9D ${SRCDIR}
60 make -j${JOBS} libsimulator
62 cmake ${COMMON_OPTIONS} -DPCB=X9D+ ${SRCDIR}
63 make -j${JOBS} libsimulator
65 cmake ${COMMON_OPTIONS} -DPCB=X9E ${SRCDIR}
66 make -j${JOBS} libsimulator
68 cmake ${COMMON_OPTIONS} -DPCB=X10 ${SRCDIR}
69 make -j${JOBS} libsimulator
71 cmake ${COMMON_OPTIONS} -DPCB=X12S ${SRCDIR}
72 make -j${JOBS} libsimulator
74 make -j${JOBS} package
76 if [ "$(uname)" = "Darwin" ]; then
77 cp *.dmg ${OUTDIR}
78 else
79 cp *.deb ${OUTDIR}