Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 3 | # yotta-build.sh |
| 4 | # |
Bence Szépkúti | 44bfbe3 | 2020-08-19 16:54:51 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Bence Szépkúti | 4e9f712 | 2020-06-05 13:02:18 +0200 | [diff] [blame] | 6 | # 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úti | 09b4f19 | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 13 | # |
| 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úti | 4e9f712 | 2020-06-05 13:02:18 +0200 | [diff] [blame] | 26 | # ********** |
| 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 | # |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 47 | # Purpose |
| 48 | # |
| 49 | # To run test builds of the yotta module for all supported targets. |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 50 | |
| 51 | set -eu |
| 52 | |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 53 | check_tools() |
| 54 | { |
| 55 | for TOOL in "$@"; do |
| 56 | if ! `hash "$TOOL" >/dev/null 2>&1`; then |
| 57 | echo "$TOOL not found!" >&2 |
| 58 | exit 1 |
| 59 | fi |
| 60 | done |
| 61 | } |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 62 | |
| 63 | yotta_build() |
| 64 | { |
| 65 | TARGET=$1 |
Manuel Pégourié-Gonnard | d2655ac | 2016-01-08 15:02:05 +0100 | [diff] [blame] | 66 | |
| 67 | echo; echo "*** $TARGET (release) ***" |
Manuel Pégourié-Gonnard | 067523e | 2015-10-30 11:15:40 +0100 | [diff] [blame] | 68 | yt -t $TARGET build |
Manuel Pégourié-Gonnard | d2655ac | 2016-01-08 15:02:05 +0100 | [diff] [blame] | 69 | |
| 70 | echo; echo "*** $TARGET (debug) ***" |
| 71 | yt -t $TARGET build -d |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 72 | } |
| 73 | |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 74 | # Make sure the tools we need are available. |
| 75 | check_tools "arm-none-eabi-gcc" "armcc" "yotta" |
| 76 | |
| 77 | yotta/create-module.sh |
| 78 | cd yotta/module |
| 79 | yt update || true # needs network |
| 80 | |
Manuel Pégourié-Gonnard | 77d56bb | 2015-07-28 15:00:37 +0200 | [diff] [blame] | 81 | if uname -a | grep 'Linux.*x86' >/dev/null; then |
| 82 | yotta_build x86-linux-native |
| 83 | fi |
| 84 | if uname -a | grep 'Darwin.*x86' >/dev/null; then |
| 85 | yotta_build x86-osx-native |
| 86 | fi |
Andres AG | b2fdd04 | 2016-09-22 14:17:46 +0100 | [diff] [blame] | 87 | |
| 88 | # armcc build tests. |
| 89 | yotta_build frdm-k64f-armcc |
| 90 | #yotta_build nordic-nrf51822-16k-armcc |
| 91 | |
| 92 | # arm-none-eabi-gcc build tests. |
| 93 | yotta_build frdm-k64f-gcc |
| 94 | #yotta_build st-nucleo-f401re-gcc # dirent |
| 95 | #yotta_build stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4 |
| 96 | #yotta_build nordic-nrf51822-16k-gcc # fails in minar-platform |
| 97 | #yotta_build bbc-microbit-classic-gcc # fails in minar-platform |
| 98 | #yotta_build st-stm32f439zi-gcc # fails in mbed-hal-st-stm32f4 |
| 99 | #yotta_build st-stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4 |