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
|
|
|
|
|
|
|
|
. config.mk
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
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
|
|
|
|
TRAVIS_BUILD_TARGET="sitl linux apm2 navio px4-v2"
|
|
|
|
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
|
|
|
|
|
|
|
|
build_platforms=( ["ArduPlane"]="apm2 navio sitl linux px4-v2"
|
|
|
|
["ArduCopter"]="navio sitl linux px4-v2"
|
2015-06-11 22:53:39 -03:00
|
|
|
["APMrover2"]="apm2 navio sitl linux px4-v2"
|
|
|
|
["AntennaTracker"]="apm2 navio sitl linux px4-v2"
|
2015-06-11 22:52:39 -03:00
|
|
|
["Tools/Replay"]="linux")
|
|
|
|
|
2015-06-15 21:12:54 -03:00
|
|
|
build_concurrency=(["apm2"]="-j2"
|
2015-06-11 22:52:39 -03:00
|
|
|
["navio"]="-j2"
|
2015-06-15 21:12:54 -03:00
|
|
|
["sitl"]="-j2"
|
2015-06-11 22:52:39 -03:00
|
|
|
["linux"]="-j2"
|
|
|
|
["px4-v2"]="")
|
|
|
|
|
|
|
|
build_extra_clean=(["px4-v2"]="make px4-cleandep")
|
2014-12-31 18:32:25 -04:00
|
|
|
|
2015-06-15 22:03:23 -03:00
|
|
|
echo "Targets: $TRAVIS_BUILD_TARGET"
|
|
|
|
for t in $TRAVIS_BUILD_TARGET; do
|
|
|
|
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
|
2014-12-31 18:32:25 -04:00
|
|
|
done
|