blob: 7df6adac203cdc96067a369d9ccbc04be6a7f8b9 [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úti4e9f7122020-06-05 13:02:18 +02006# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
7#
8# This file is provided under the Apache License 2.0, or the
9# GNU General Public License v2.0 or later.
10#
11# **********
12# Apache License 2.0:
Bence Szépkúti09b4f192020-05-26 01:54:15 +020013#
14# Licensed under the Apache License, Version 2.0 (the "License"); you may
15# not use this file except in compliance with the License.
16# You may obtain a copy of the License at
17#
18# http://www.apache.org/licenses/LICENSE-2.0
19#
20# Unless required by applicable law or agreed to in writing, software
21# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23# See the License for the specific language governing permissions and
24# limitations under the License.
25#
Bence Szépkúti4e9f7122020-06-05 13:02:18 +020026# **********
27#
28# **********
29# GNU General Public License v2.0 or later:
30#
31# This program is free software; you can redistribute it and/or modify
32# it under the terms of the GNU General Public License as published by
33# the Free Software Foundation; either version 2 of the License, or
34# (at your option) any later version.
35#
36# This program is distributed in the hope that it will be useful,
37# but WITHOUT ANY WARRANTY; without even the implied warranty of
38# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39# GNU General Public License for more details.
40#
41# You should have received a copy of the GNU General Public License along
42# with this program; if not, write to the Free Software Foundation, Inc.,
43# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
44#
45# **********
46#
Bence Szépkúti09b4f192020-05-26 01:54:15 +020047# This file is part of Mbed TLS (https://tls.mbed.org)
Andres AGb2fdd042016-09-22 14:17:46 +010048#
49# Purpose
50#
51# To run test builds of the yotta module for all supported targets.
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020052
53set -eu
54
Andres AGb2fdd042016-09-22 14:17:46 +010055check_tools()
56{
57 for TOOL in "$@"; do
58 if ! `hash "$TOOL" >/dev/null 2>&1`; then
59 echo "$TOOL not found!" >&2
60 exit 1
61 fi
62 done
63}
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020064
65yotta_build()
66{
67 TARGET=$1
Manuel Pégourié-Gonnardd2655ac2016-01-08 15:02:05 +010068
69 echo; echo "*** $TARGET (release) ***"
Manuel Pégourié-Gonnard067523e2015-10-30 11:15:40 +010070 yt -t $TARGET build
Manuel Pégourié-Gonnardd2655ac2016-01-08 15:02:05 +010071
72 echo; echo "*** $TARGET (debug) ***"
73 yt -t $TARGET build -d
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020074}
75
Andres AGb2fdd042016-09-22 14:17:46 +010076# Make sure the tools we need are available.
77check_tools "arm-none-eabi-gcc" "armcc" "yotta"
78
79yotta/create-module.sh
80cd yotta/module
81yt update || true # needs network
82
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +020083if uname -a | grep 'Linux.*x86' >/dev/null; then
84 yotta_build x86-linux-native
85fi
86if uname -a | grep 'Darwin.*x86' >/dev/null; then
87 yotta_build x86-osx-native
88fi
Andres AGb2fdd042016-09-22 14:17:46 +010089
90# armcc build tests.
91yotta_build frdm-k64f-armcc
92#yotta_build nordic-nrf51822-16k-armcc
93
94# arm-none-eabi-gcc build tests.
95yotta_build frdm-k64f-gcc
96#yotta_build st-nucleo-f401re-gcc # dirent
97#yotta_build stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
98#yotta_build nordic-nrf51822-16k-gcc # fails in minar-platform
99#yotta_build bbc-microbit-classic-gcc # fails in minar-platform
100#yotta_build st-stm32f439zi-gcc # fails in mbed-hal-st-stm32f4
101#yotta_build st-stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4