1#!/bin/sh
2
3# yotta-build.sh
4#
5# This file is part of mbed TLS (https://tls.mbed.org)
6#
7# Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
8#
9# Purpose
10#
11# To run test builds of the yotta module for all supported targets.
12
13set -eu
14
15check_tools()
16{
17    for TOOL in "$@"; do
18        if ! `hash "$TOOL" >/dev/null 2>&1`; then
19            echo "$TOOL not found!" >&2
20            exit 1
21        fi
22    done
23}
24
25yotta_build()
26{
27    TARGET=$1
28
29    echo; echo "*** $TARGET (release) ***"
30    yt -t $TARGET build
31
32    echo; echo "*** $TARGET (debug) ***"
33    yt -t $TARGET build -d
34}
35
36# Make sure the tools we need are available.
37check_tools "arm-none-eabi-gcc" "armcc" "yotta"
38
39yotta/create-module.sh
40cd yotta/module
41yt update || true # needs network
42
43if uname -a | grep 'Linux.*x86' >/dev/null; then
44    yotta_build x86-linux-native
45fi
46if uname -a | grep 'Darwin.*x86' >/dev/null; then
47    yotta_build x86-osx-native
48fi
49
50# armcc build tests.
51yotta_build frdm-k64f-armcc
52#yotta_build nordic-nrf51822-16k-armcc
53
54# arm-none-eabi-gcc build tests.
55yotta_build frdm-k64f-gcc
56#yotta_build st-nucleo-f401re-gcc # dirent
57#yotta_build stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
58#yotta_build nordic-nrf51822-16k-gcc # fails in minar-platform
59#yotta_build bbc-microbit-classic-gcc # fails in minar-platform
60#yotta_build st-stm32f439zi-gcc # fails in mbed-hal-st-stm32f4
61#yotta_build st-stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
62