Leonardo Sandoval | c503d7e | 2020-08-10 15:47:11 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2019-2020, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | # $(call build-platform,platform,toolchain) |
| 8 | define build-platform |
| 9 | mkdir $(BASE_DIR)/$(tf_m)/cmake_build |
| 10 | cd $(BASE_DIR)/$(tf_m)/cmake_build && \ |
| 11 | cmake .. -DTFM_PLATFORM=$1 -DTFM_TOOLCHAIN_FILE=../$2 |
| 12 | |
| 13 | cd $(BASE_DIR)/$(tf_m)/cmake_build && \ |
| 14 | make install |
| 15 | endef |
| 16 | |
| 17 | BASE_DIR ?= . |
| 18 | |
| 19 | # TODO: include other platforms to increase coverity coverage |
| 20 | gnuarm_target_platforms := mps2/an521 |
| 21 | tf_m := trusted-firmware-m |
| 22 | |
| 23 | all: $(gnuarm_target_platforms) |
| 24 | |
| 25 | $(gnuarm_target_platforms): check msg |
| 26 | $(call build-platform,$@,toolchain_GNUARM.cmake) |
| 27 | |
| 28 | .phony: check |
| 29 | check: |
| 30 | ifndef BASE_DIR |
| 31 | echo "please provide a environment BASE_DIR" |
| 32 | exit 1 |
| 33 | endif |
| 34 | echo "base directory $(BASE_DIR)" |
| 35 | |
| 36 | .phony: msg |
| 37 | msg: |
| 38 | echo "building platform" |