forked from Optiboot/optiboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-build.sh
executable file
·51 lines (38 loc) · 1.1 KB
/
travis-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
LOCAL_TOOLS_DIR=$HOME/avr-tools
if [ -z "$TRAVIS_BUILD_DIR" ]; then
echo "This script should be run by Travis-CI environment"
echo "If you want to simulate Travis build, please set TRAVIS_BUILD_DIR"
echo "environment variable to directory where your code lives"
exit 1
fi
if [ -z "$1" ]; then
echo "Arduino version required"
exit 1
fi
if [ -z "$2" ]; then
echo "Target required"
exit 1
fi
# Include functions to download stuff
. $TRAVIS_BUILD_DIR/scripts/travis-download.inc.sh
# Make directory for tools
mkdir -p $LOCAL_TOOLS_DIR
# get new make as Optiboot requires version >4.0
download_make4
# download specific tools version
if [ "$1" = "microchip" ]; then
download_avr_toolchain
# set search path
PATH=$LOCAL_TOOLS_DIR/usr/bin:$PATH:$LOCAL_TOOLS_DIR/avr8-gnu-toolchain-linux_x86_64/bin
avr-gcc --version
else
download_arduino $1
# set search path
PATH=$LOCAL_TOOLS_DIR/usr/bin:$PATH:$LOCAL_TOOLS_DIR/arduino-$1/hardware/tools/avr/bin
fi
cd $TRAVIS_BUILD_DIR/optiboot/bootloaders/optiboot
make --version
make clean
shift
make $@