Leonardo Sandoval | c503d7e | 2020-08-10 15:47:11 -0500 | [diff] [blame] | 1 | # |
Xinyu Zhang | 7c038b0 | 2021-04-20 10:27:49 +0800 | [diff] [blame] | 2 | # Copyright (c) 2019-2021, Arm Limited. All rights reserved. |
Leonardo Sandoval | c503d7e | 2020-08-10 15:47:11 -0500 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | # $(call build-platform,platform,toolchain) |
| 8 | define build-platform |
Leonardo Sandoval | 46b3209 | 2020-12-03 12:26:17 -0600 | [diff] [blame] | 9 | cd $(BASE_DIR)/$(tf_m) && \ |
| 10 | cmake -S . -B cmake_build_$1 -DTFM_PLATFORM=$1 -DTFM_TOOLCHAIN_FILE=$2 && \ |
| 11 | cmake --build cmake_build_$1 -- install |
Leonardo Sandoval | c503d7e | 2020-08-10 15:47:11 -0500 | [diff] [blame] | 12 | endef |
| 13 | |
| 14 | BASE_DIR ?= . |
| 15 | |
Leonardo Sandoval | 46b3209 | 2020-12-03 12:26:17 -0600 | [diff] [blame] | 16 | target_platforms := cypress/psoc64 \ |
Summer Qin | 3c2b572 | 2021-05-26 10:43:45 +0800 | [diff] [blame] | 17 | arm/mps2/an519 arm/mps2/an521 \ |
| 18 | arm/mps3/an524 \ |
Arthur She | 19c0e1a | 2021-06-02 11:06:19 -0700 | [diff] [blame] | 19 | arm/musca_b1/sse_200 arm/musca_s1 \ |
| 20 | stm/stm32l562e_dk |
Leonardo Sandoval | 46b3209 | 2020-12-03 12:26:17 -0600 | [diff] [blame] | 21 | |
Leonardo Sandoval | c503d7e | 2020-08-10 15:47:11 -0500 | [diff] [blame] | 22 | tf_m := trusted-firmware-m |
| 23 | |
Leonardo Sandoval | 46b3209 | 2020-12-03 12:26:17 -0600 | [diff] [blame] | 24 | all: $(target_platforms) |
Leonardo Sandoval | c503d7e | 2020-08-10 15:47:11 -0500 | [diff] [blame] | 25 | |
Leonardo Sandoval | 46b3209 | 2020-12-03 12:26:17 -0600 | [diff] [blame] | 26 | $(target_platforms): check msg |
Leonardo Sandoval | c503d7e | 2020-08-10 15:47:11 -0500 | [diff] [blame] | 27 | $(call build-platform,$@,toolchain_GNUARM.cmake) |
| 28 | |
| 29 | .phony: check |
| 30 | check: |
| 31 | ifndef BASE_DIR |
| 32 | echo "please provide a environment BASE_DIR" |
| 33 | exit 1 |
| 34 | endif |
| 35 | echo "base directory $(BASE_DIR)" |
| 36 | |
| 37 | .phony: msg |
| 38 | msg: |
| 39 | echo "building platform" |