Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #------------------------------------------------------------------------------- |
| 3 | # Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | #------------------------------------------------------------------------------- |
| 8 | |
| 9 | # |
| 10 | # Builds a single configuration on Trusted Firmware M. |
| 11 | # Relies on environment variables pre-populated. |
| 12 | # These variables can be obtained using configs.py. |
| 13 | # Expected to have trusted-firmware-m cloned to same level as this git tree |
| 14 | # |
| 15 | |
| 16 | set -ex |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 17 | |
| 18 | if [ -z "$CONFIG_NAME" ] ; then |
| 19 | echo "Set CONFIG_NAME to run a build." |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
Karl Zhang | 4a45dac | 2020-06-10 14:03:10 +0800 | [diff] [blame] | 23 | set +e |
| 24 | echo "output current build environment" |
| 25 | cat /etc/issue |
| 26 | uname -a |
| 27 | grep -c ^processor /proc/cpuinfo |
| 28 | armclang --version |
| 29 | arm-none-eabi-gcc --version |
| 30 | cmake --version |
| 31 | python --version |
| 32 | make --version |
| 33 | |
| 34 | set -ex |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 35 | build_commands=$(python3 tf-m-ci-scripts/configs.py -b -g all $CONFIG_NAME) |
| 36 | |
Karl Zhang | f6f467e | 2020-07-10 16:24:45 +0800 | [diff] [blame^] | 37 | if [ $CODE_COVERAGE_EN = "TRUE" ] && [[ $CONFIG_NAME =~ "GNUARM" ]] ; then |
| 38 | build_commands=${build_commands/-DCOMPILER=GNUARM/-DCOMPILER=GNUARM -DCODE_COVERAGE_EN=TRUE} |
| 39 | echo "Flag: Add compiler flag for build with code coverage supported." |
| 40 | echo $build_commands |
| 41 | fi |
| 42 | |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 43 | if [ -z "$build_commands" ] ; then |
| 44 | echo "No build commands found." |
| 45 | exit 1 |
| 46 | fi |
| 47 | |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 48 | mkdir trusted-firmware-m/build |
| 49 | cd trusted-firmware-m/build |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 50 | |
| 51 | eval "set -ex ; $build_commands" |