diff --git a/Tools/scripts/build_all.sh b/Tools/scripts/build_all.sh
index 4bc72fe1ee50fe225cf3b7708c44ce83a7daed7b..638f88050d5ed362eaf70dd6f5e93a2de558c99f 100755
--- a/Tools/scripts/build_all.sh
+++ b/Tools/scripts/build_all.sh
@@ -43,4 +43,9 @@ for d in $examples; do
     popd
 done
 
+. config.mk
+test -n "$PX4_ROOT" && test -d "$PX4_ROOT" && {
+    ./Tools/scripts/build_all_px4.sh
+}
+
 exit 0
diff --git a/Tools/scripts/build_all_px4.sh b/Tools/scripts/build_all_px4.sh
new file mode 100755
index 0000000000000000000000000000000000000000..545cfbb15009db481db46345366d13b81629b842
--- /dev/null
+++ b/Tools/scripts/build_all_px4.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# build all targets for PX4
+# This helps when doing large merges
+# Andrew Tridgell, February 2013
+
+set -e
+set -x
+
+. config.mk
+
+echo "Testing ArduPlane build"
+pushd ArduPlane
+make px4-clean
+make px4
+popd
+
+echo "Testing ArduCopter build"
+pushd ArduCopter
+make px4-clean
+make px4
+popd
+
+echo "Testing APMrover2 build"
+pushd APMrover2
+make px4-clean
+make px4
+popd
+
+echo "Testing PX4IO build"
+pushd "$PX4_ROOT"
+make clean
+make configure_px4io
+make
+make clean
+make configure_px4fmu
+popd
+
+
+exit 0