build for multiple configurations

This commit is contained in:
Samuel Sadok
2018-03-17 22:11:58 -07:00
parent 1087c0a824
commit fcdbde2640
3 changed files with 37 additions and 6 deletions
+12 -5
View File
@@ -29,9 +29,16 @@ install:
- if [ ! -e $TUP_DIR/bin/tup ]; then wget $TUP_URL -O $TUP_ARCHIVE; dpkg-deb -R $TUP_ARCHIVE $TUP_DIR; fi
- export PATH=$PATH:$TUP_DIR/usr/bin
env:
# Build default configuration for each board
- "CONFIG_BOARD_VERSION=v3.2 DEPLOY=v3.2"
- "CONFIG_BOARD_VERSION=v3.3 DEPLOY=v3.3"
- "CONFIG_BOARD_VERSION=v3.4-24V DEPLOY=v3.4-24V"
- "CONFIG_BOARD_VERSION=v3.4-48V DEPLOY=v3.4-48V"
# Various protocol combinations
- "CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=native-stream CONFIG_UART_PROTOCOL=native"
- "CONFIG_BOARD_VERSION=v3.4-24V CONFIG_USB_PROTOCOL=none CONFIG_UART_PROTOCOL=none"
script:
- cd Firmware
- mkdir -p build
- echo "CONFIG_BOARD_VERSION=v3.4-24V" > tup.config # TODO: build more configuration combinations
- tup generate ./build.sh
- bash -xe ./build.sh
- ./tools/build.sh
+2 -1
View File
@@ -1,6 +1,7 @@
#build folder
build/
deploy/
.dep/
#markdown preview output
@@ -19,4 +20,4 @@ Odrive.xml
STM32CubeMX
#gdb log
openocd.log
openocd.log
Executable
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# Builds the firmware with the configuration specified by
# environment variables named CONFIG_...
# If DEPLOY is set, the deliverables are copied to Firmware/deploy/*
# with the suffix $DEPLOY
set -euo pipefail
THIS_DIR="$(dirname "$0")"
cd "$THIS_DIR/../Firmware"
# Write all environment variables that start with "CONFIG_" to tup.config
mkdir -p build
rm build/*
env | grep ^CONFIG > tup.config
tup generate ./tup_build.sh
bash -xe ./tup_build.sh
# Deploy
if ! [ -z ${DEPLOY+x} ]; then
mkdir -p deploy
cp build/ODriveFirmware.elf deploy/ODriveFirmware-"$DEPLOY".elf
cp build/ODriveFirmware.hex deploy/ODriveFirmware-"$DEPLOY".hex
fi