#!/usr/bin/env bash
export PATH="/usr/local/bin:/usr/bin:/bin"
export PATH
set -x
cd /cygdrive/c/work
(
date
git submodule update --init --recursive -f
export CXX=i686-pc-cygwin-g++.exe
export CC=i686-pc-cygwin-gcc
./waf configure --board sitl
python3 waf -j4 copter plane rover heli sub
cp /cygdrive/c/work/build/sitl/bin/ardurover.exe /cygdrive/c/work/sitl/Rover.elf
cp /cygdrive/c/work/build/sitl/bin/arduplane.exe /cygdrive/c/work/sitl/ArduPlane.elf
cp /cygdrive/c/work/build/sitl/bin/arducopter.exe /cygdrive/c/work/sitl/ArduCopter.elf
cp /cygdrive/c/work/build/sitl/bin/arducopter-heli.exe /cygdrive/c/work/sitl/ArduHeli.elf
cp /cygdrive/c/work/build/sitl/bin/ardusub.exe /cygdrive/c/work/sitl/ArduSub.elf
cp /usr/i686-pc-cygwin/sys-root/usr/bin/*.dll /cygdrive/c/work/sitl/
cd /cygdrive/c/work/sitl/
git log -1 > git.txt
ls
) | tee /cygdrive/c/work/sitl/build.txt 2>&1