Follow libACCESS origin
[opentx.git] / tools / build-companion-nightly.sh
blobac2004b168caf050de85e0aded7ce87e1446d0ec
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 -DNIGHTLY_BUILD_WARNING=YES -DGVARS=YES -DHELI=YES -DLUA=YES -DMULTIMODULE=YES -DTELEMETRY=FRSKY -DPPM_LIMITS_SYMETRICAL=YES -DVARIO=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=AR9X ${SRCDIR}
42 make -j${JOBS} libsimulator
43 rm CMakeCache.txt
45 cmake ${COMMON_OPTIONS} -DPCB=SKY9X ${SRCDIR}
46 make -j${JOBS} libsimulator
47 rm CMakeCache.txt
49 cmake ${COMMON_OPTIONS} -DPCB=9XRPRO ${SRCDIR}
50 make -j${JOBS} libsimulator
51 rm CMakeCache.txt
53 cmake ${COMMON_OPTIONS} -DPCB=X9LITE ${SRCDIR}
54 make -j${JOBS} libsimulator
55 rm CMakeCache.txt
57 cmake ${COMMON_OPTIONS} -DPCB=X9LITES ${SRCDIR}
58 make -j${JOBS} libsimulator
59 rm CMakeCache.txt
61 cmake ${COMMON_OPTIONS} -DPCB=X7 ${SRCDIR}
62 make -j${JOBS} libsimulator
63 rm CMakeCache.txt
65 cmake ${COMMON_OPTIONS} -DPCB=X7 -DPCBREV=T12 ${SRCDIR}
66 make -j${JOBS} libsimulator
67 rm CMakeCache.txt
69 cmake ${COMMON_OPTIONS} -DPCB=X9D ${SRCDIR}
70 make -j${JOBS} libsimulator
71 rm CMakeCache.txt
73 cmake ${COMMON_OPTIONS} -DPCB=X9D+ ${SRCDIR}
74 make -j${JOBS} libsimulator
75 rm CMakeCache.txt
77 cmake ${COMMON_OPTIONS} -DPCB=X9D+ -DPCBREV=2019 ${SRCDIR}
78 make -j${JOBS} libsimulator
79 rm CMakeCache.txt
81 cmake ${COMMON_OPTIONS} -DPCB=XLITE ${SRCDIR}
82 make -j${JOBS} libsimulator
83 rm CMakeCache.txt
85 cmake ${COMMON_OPTIONS} -DPCB=XLITES ${SRCDIR}
86 make -j${JOBS} libsimulator
87 rm CMakeCache.txt
89 cmake ${COMMON_OPTIONS} -DPCB=X9E ${SRCDIR}
90 make -j${JOBS} libsimulator
91 rm CMakeCache.txt
93 cmake ${COMMON_OPTIONS} -DPCB=X10 ${SRCDIR}
94 make -j${JOBS} libsimulator
95 rm CMakeCache.txt
97 cmake ${COMMON_OPTIONS} -DPCB=X10 -DPCBREV=T16 ${SRCDIR}
98 make -j${JOBS} libsimulator
99 rm CMakeCache.txt
101 cmake ${COMMON_OPTIONS} -DPCB=X10 -DPCBREV=EXPRESS ${SRCDIR}
102 make -j${JOBS} libsimulator
103 rm CMakeCache.txt
105 cmake ${COMMON_OPTIONS} -DPCB=X12S ${SRCDIR}
106 make -j${JOBS} libsimulator
108 make -j${JOBS} package
110 if [ "$(uname)" = "Darwin" ]; then
111 cp *.dmg ${OUTDIR}
112 else
113 cp *.deb ${OUTDIR}