mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 07:13:56 -04:00
Tools: build_examples.sh implemented in terms of build_examples.py
This commit is contained in:
parent
b6289af522
commit
eb0e3c993d
@ -1,46 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# useful script to test the build of all example code
|
|
||||||
# This helps when doing large merges
|
|
||||||
# Andrew Tridgell, November 2012
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
cat >&2 <<EOF
|
||||||
|
This script is deprecated in favour of running waf with 'examples' as the main command
|
||||||
|
|
||||||
|
cd \$ARDUPILOT_HOME
|
||||||
|
./modules/waf/waf-light configure --board=linux
|
||||||
|
./modules/waf/waf-light examples
|
||||||
|
|
||||||
|
Sleeping for a few seconds to let you digest that.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sleep 4
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
targets="navio"
|
PY="$(dirname $0)/build_examples.py"
|
||||||
|
|
||||||
[ $# -gt 0 ] && {
|
$PY $*
|
||||||
targets="$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
export PATH=/usr/lib/ccache:$PATH
|
|
||||||
|
|
||||||
TESTS=$(find libraries -name 'Makefile' | xargs -i dirname '{}')
|
|
||||||
|
|
||||||
export BUILDROOT="/tmp/examples.build"
|
|
||||||
rm -rf $BUILDROOT
|
|
||||||
|
|
||||||
for b in $TESTS; do
|
|
||||||
echo "TESTING $b"
|
|
||||||
pushd $b
|
|
||||||
if [ -r nobuild.txt ]; then
|
|
||||||
echo "Skipping build of $b"
|
|
||||||
else
|
|
||||||
for t in $targets; do
|
|
||||||
make -j4 $t
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Building some examples for px4-v2"
|
|
||||||
test -d ../PX4Firmware && {
|
|
||||||
for d in libraries/AP_GPS/examples/GPS_AUTO_test libraries/AP_InertialSensor/examples/INS_generic libraries/AP_Compass/examples/AP_Compass_test libraries/AP_Baro/examples/BARO_generic libraries/AP_AHRS/examples/AHRS_Test; do
|
|
||||||
echo "Building $d for px4-v2"
|
|
||||||
pushd $d
|
|
||||||
make px4-v2
|
|
||||||
popd
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "All examples built OK"
|
|
||||||
exit 0
|
|
||||||
|
Loading…
Reference in New Issue
Block a user