blob: fc254e32a159b092fe86ccbef545d88df49ed216 [file] [log] [blame]
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +02001#!/bin/sh
2
Andres AGb2fdd042016-09-22 14:17:46 +01003# yotta-build.sh
4#
Andres AGb2fdd042016-09-22 14:17:46 +01005# Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
Bence Szépkúti09b4f192020-05-26 01:54:15 +02006# SPDX-License-Identifier: Apache-2.0
7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19#
20# This file is part of Mbed TLS (https://tls.mbed.org)
Andres AGb2fdd042016-09-22 14:17:46 +010021#
22# Purpose
23#
24# To run test builds of the yotta module for all supported targets.
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020025
26set -eu
27
Andres AGb2fdd042016-09-22 14:17:46 +010028check_tools()
29{
30 for TOOL in "$@"; do
31 if ! `hash "$TOOL" >/dev/null 2>&1`; then
32 echo "$TOOL not found!" >&2
33 exit 1
34 fi
35 done
36}
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020037
38yotta_build()
39{
40 TARGET=$1
Manuel Pégourié-Gonnardd2655ac2016-01-08 15:02:05 +010041
42 echo; echo "*** $TARGET (release) ***"
Manuel Pégourié-Gonnard067523e2015-10-30 11:15:40 +010043 yt -t $TARGET build
Manuel Pégourié-Gonnardd2655ac2016-01-08 15:02:05 +010044
45 echo; echo "*** $TARGET (debug) ***"
46 yt -t $TARGET build -d
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020047}
48
Andres AGb2fdd042016-09-22 14:17:46 +010049# Make sure the tools we need are available.
50check_tools "arm-none-eabi-gcc" "armcc" "yotta"
51
52yotta/create-module.sh
53cd yotta/module
54yt update || true # needs network
55
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020056if uname -a | grep 'Linux.*x86' >/dev/null; then
57 yotta_build x86-linux-native
58fi
59if uname -a | grep 'Darwin.*x86' >/dev/null; then
60 yotta_build x86-osx-native
61fi
Andres AGb2fdd042016-09-22 14:17:46 +010062
63# armcc build tests.
64yotta_build frdm-k64f-armcc
65#yotta_build nordic-nrf51822-16k-armcc
66
67# arm-none-eabi-gcc build tests.
68yotta_build frdm-k64f-gcc
69#yotta_build st-nucleo-f401re-gcc # dirent
70#yotta_build stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
71#yotta_build nordic-nrf51822-16k-gcc # fails in minar-platform
72#yotta_build bbc-microbit-classic-gcc # fails in minar-platform
73#yotta_build st-stm32f439zi-gcc # fails in mbed-hal-st-stm32f4
74#yotta_build st-stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4