2014-12-31 18:32:25 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# useful script to test all the different build types that we support.
|
|
|
|
# This helps when doing large merges
|
|
|
|
# Andrew Tridgell, November 2011
|
|
|
|
|
2015-11-24 18:25:53 -04:00
|
|
|
set -ex
|
2014-12-31 18:32:25 -04:00
|
|
|
|
2015-04-05 16:24:54 -03:00
|
|
|
. ~/.profile
|
|
|
|
|
2015-06-15 22:03:23 -03:00
|
|
|
# If TRAVIS_BUILD_TARGET is not set, default to all of them
|
|
|
|
if [ -z "$TRAVIS_BUILD_TARGET" ]; then
|
2015-12-14 14:15:26 -04:00
|
|
|
TRAVIS_BUILD_TARGET="sitl linux navio raspilot minlure bebop px4-v2 px4-v4"
|
2015-06-15 22:03:23 -03:00
|
|
|
fi
|
2015-06-11 19:56:15 -03:00
|
|
|
|
2015-06-11 22:52:39 -03:00
|
|
|
declare -A build_platforms
|
|
|
|
declare -A build_concurrency
|
|
|
|
declare -A build_extra_clean
|
2015-11-27 14:50:45 -04:00
|
|
|
declare -A waf_supported_boards
|
2015-06-11 22:52:39 -03:00
|
|
|
|
2015-12-14 14:15:26 -04:00
|
|
|
build_platforms=( ["ArduPlane"]="navio raspilot minlure bebop sitl linux px4-v2"
|
|
|
|
["ArduCopter"]="navio raspilot minlure bebop sitl linux px4-v2 px4-v4"
|
|
|
|
["APMrover2"]="navio raspilot minlure bebop sitl linux px4-v2"
|
|
|
|
["AntennaTracker"]="navio raspilot minlure bebop sitl linux px4-v2"
|
2015-06-11 22:52:39 -03:00
|
|
|
["Tools/Replay"]="linux")
|
|
|
|
|
2015-08-27 21:42:38 -03:00
|
|
|
build_concurrency=(["navio"]="-j2"
|
2015-09-23 23:02:23 -03:00
|
|
|
["raspilot"]="-j2"
|
2015-10-23 13:16:14 -03:00
|
|
|
["minlure"]="-j2"
|
2015-12-14 14:15:26 -04:00
|
|
|
["bebop"]="-j2"
|
2015-06-15 21:12:54 -03:00
|
|
|
["sitl"]="-j2"
|
2015-06-11 22:52:39 -03:00
|
|
|
["linux"]="-j2"
|
2015-11-27 04:23:29 -04:00
|
|
|
["px4-v2"]=""
|
|
|
|
["px4-v4"]="")
|
2015-06-11 22:52:39 -03:00
|
|
|
|
|
|
|
build_extra_clean=(["px4-v2"]="make px4-cleandep")
|
2014-12-31 18:32:25 -04:00
|
|
|
|
2015-12-07 14:33:25 -04:00
|
|
|
waf=modules/waf/waf-light
|
|
|
|
|
2015-11-27 14:50:45 -04:00
|
|
|
# get list of boards supported by the waf build
|
2015-12-07 14:33:25 -04:00
|
|
|
for board in $($waf list_boards | head -n1); do waf_supported_boards[$board]=1; done
|
2015-11-27 14:50:45 -04:00
|
|
|
|
2015-06-15 22:03:23 -03:00
|
|
|
echo "Targets: $TRAVIS_BUILD_TARGET"
|
|
|
|
for t in $TRAVIS_BUILD_TARGET; do
|
2015-11-27 14:50:45 -04:00
|
|
|
echo "Starting make based build for target ${t}..."
|
2015-06-15 22:03:23 -03:00
|
|
|
for v in ${!build_platforms[@]}; do
|
|
|
|
if [[ ${build_platforms[$v]} != *$t* ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
echo "Building $v for ${t}..."
|
2015-06-11 22:52:39 -03:00
|
|
|
|
2015-06-15 22:03:23 -03:00
|
|
|
pushd $v
|
2015-06-11 22:52:39 -03:00
|
|
|
make clean
|
2015-06-15 22:03:23 -03:00
|
|
|
if [ ${build_extra_clean[$t]+_} ]; then
|
|
|
|
${build_extra_clean[$t]}
|
2015-06-11 22:52:39 -03:00
|
|
|
fi
|
|
|
|
|
2015-06-15 22:03:23 -03:00
|
|
|
make $t ${build_concurrency[$t]}
|
|
|
|
popd
|
2015-06-11 22:52:39 -03:00
|
|
|
done
|
2015-11-27 14:50:45 -04:00
|
|
|
|
|
|
|
if [[ -n ${waf_supported_boards[$t]} ]]; then
|
|
|
|
echo "Starting waf build for board ${t}..."
|
2015-12-07 14:33:25 -04:00
|
|
|
$waf configure --board $t
|
|
|
|
$waf clean
|
|
|
|
$waf ${build_concurrency[$t]} build
|
2015-11-27 14:50:45 -04:00
|
|
|
fi
|
2014-12-31 18:32:25 -04:00
|
|
|
done
|