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-11 19:56:15 -03:00
|
|
|
travis_build_type_or_empty() {
|
|
|
|
if [ -z "$TRAVIS_BUILD_TYPE" ] || [ "$TRAVIS_BUILD_TYPE" = "$1" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
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")
|
|
|
|
|
|
|
|
build_concurrency=(["apm2"]="-j4"
|
|
|
|
["navio"]="-j2"
|
|
|
|
["sitl"]="-j4"
|
|
|
|
["linux"]="-j2"
|
|
|
|
["px4-v2"]="")
|
|
|
|
|
|
|
|
build_extra_clean=(["px4-v2"]="make px4-cleandep")
|
2014-12-31 18:32:25 -04:00
|
|
|
|
2015-06-11 22:52:39 -03:00
|
|
|
for d in "${!build_platforms[@]}"; do
|
2015-06-11 19:56:15 -03:00
|
|
|
if ! travis_build_type_or_empty "$d"; then
|
|
|
|
continue
|
|
|
|
fi
|
2015-06-11 22:52:39 -03:00
|
|
|
|
2014-12-31 18:32:25 -04:00
|
|
|
pushd $d
|
2015-06-11 22:52:39 -03:00
|
|
|
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
|
2014-12-31 18:32:25 -04:00
|
|
|
popd
|
|
|
|
done
|