Ardupilot2/Tools/scripts/build_all_travis.sh
Lucas De Marchi a435269839 Travis: make most targets run with -j2
As documented in Travis the VMs have 1.5 cores
(http://docs.travis-ci.com/user/speeding-up-the-build/#Parallelizing-your-build-on-one-VM).
So let's make it only -j2.

The exception is PX4 build that runs without any -j setting since NuttX
fails to build if we do that.
2015-06-17 09:26:04 +10:00

54 lines
1.3 KiB
Bash
Executable File

#!/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
. ~/.profile
travis_build_type_or_empty() {
if [ -z "$TRAVIS_BUILD_TYPE" ] || [ "$TRAVIS_BUILD_TYPE" = "$1" ]; then
return 0
fi
return 1
}
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"
["APMrover2"]="apm2 navio sitl linux px4-v2"
["AntennaTracker"]="apm2 navio sitl linux px4-v2"
["Tools/Replay"]="linux")
build_concurrency=(["apm2"]="-j2"
["navio"]="-j2"
["sitl"]="-j2"
["linux"]="-j2"
["px4-v2"]="")
build_extra_clean=(["px4-v2"]="make px4-cleandep")
for d in "${!build_platforms[@]}"; do
if ! travis_build_type_or_empty "$d"; then
continue
fi
pushd $d
for p in ${build_platforms["$d"]}; do
make clean
if [ ${build_extra_clean[$p]+_} ]; then
${build_extra_clean[$p]}
fi
make $p ${build_concurrency[$p]}
done
popd
done