Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # \file libs.mk |
| 3 | # \version 1.0 |
| 4 | # |
| 5 | # \brief |
| 6 | # Makefile to describe libraries needed for Cypress MCUBoot based applications. |
| 7 | # |
| 8 | ################################################################################ |
| 9 | # \copyright |
| 10 | # Copyright 2018-2019 Cypress Semiconductor Corporation |
| 11 | # SPDX-License-Identifier: Apache-2.0 |
| 12 | # |
| 13 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 14 | # you may not use this file except in compliance with the License. |
| 15 | # You may obtain a copy of the License at |
| 16 | # |
| 17 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 18 | # |
| 19 | # Unless required by applicable law or agreed to in writing, software |
| 20 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 21 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 22 | # See the License for the specific language governing permissions and |
| 23 | # limitations under the License. |
| 24 | ################################################################################ |
| 25 | |
| 26 | ################################################################################ |
| 27 | # PDL library |
| 28 | ################################################################################ |
| 29 | PDL_VERSION = 121 |
Bohdan Kovalchuk | 7725652 | 2020-04-15 18:03:43 +0300 | [diff] [blame] | 30 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 31 | THIS_APP_PATH = $(PRJ_DIR)/libs |
| 32 | MBEDTLS_PATH = $(PRJ_DIR)/../../ext |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 33 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 34 | # Add platform folder to build |
| 35 | SOURCES_PLATFORM += $(wildcard $(PRJ_DIR)/platforms/*.c) |
| 36 | SOURCES_WATCHDOG := $(wildcard $(THIS_APP_PATH)/watchdog/*.c) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 37 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 38 | # Add retartget IO implementation using pdl |
| 39 | SOURCES_RETARGET_IO_PDL += $(wildcard $(THIS_APP_PATH)/retarget_io_pdl/*.c) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 40 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 41 | # Collect dirrectories containing headers for PLATFORM |
| 42 | INCLUDE_RETARGET_IO_PDL += $(THIS_APP_PATH)/retarget_io_pdl |
| 43 | |
| 44 | # PSOC6HAL source files |
| 45 | SOURCES_HAL += $(THIS_APP_PATH)/psoc6hal/COMPONENT_PSOC6HAL/source/cyhal_crypto_common.c |
| 46 | SOURCES_HAL += $(THIS_APP_PATH)/psoc6hal/COMPONENT_PSOC6HAL/source/cyhal_hwmgr.c |
| 47 | |
| 48 | # MbedTLS source files |
| 49 | SOURCES_MBEDTLS := $(wildcard $(MBEDTLS_PATH)/mbedtls/library/*.c) |
| 50 | SOURCES_MBEDTLS += $(wildcard $(MBEDTLS_PATH)/mbedtls/crypto/library/*.c) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 51 | |
| 52 | # Collected source files for libraries |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 53 | SOURCES_LIBS += $(SOURCES_HAL) |
| 54 | SOURCES_LIBS += $(SOURCES_MBEDTLS) |
Roman Okhrimenko | 0c7aebc | 2020-09-02 13:37:51 +0300 | [diff] [blame] | 55 | SOURCES_LIBS += $(SOURCES_WATCHDOG) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 56 | SOURCES_LIBS += $(SOURCES_PLATFORM) |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 57 | SOURCES_LIBS += $(SOURCES_RETARGET_IO_PDL) |
Bohdan Kovalchuk | 7725652 | 2020-04-15 18:03:43 +0300 | [diff] [blame] | 58 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 59 | # Include platforms folder |
| 60 | INCLUDE_DIRS_PLATFORM := $(PRJ_DIR)/platforms |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 61 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 62 | # needed for Crypto HW Acceleration and headers inclusion, do not use for peripherals |
| 63 | # peripherals should be accessed |
| 64 | INCLUDE_DIRS_HAL := $(THIS_APP_PATH)/psoc6hal/COMPONENT_PSOC6HAL/include |
| 65 | INCLUDE_DIRS_HAL += $(THIS_APP_PATH)/psoc6hal/include |
| 66 | INCLUDE_DIRS_HAL += $(THIS_APP_PATH)/psoc6hal/COMPONENT_PSOC6HAL/include/pin_packages |
| 67 | |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 68 | # MbedTLS related include directories |
| 69 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include |
| 70 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include/mbedtls |
| 71 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/crypto/include |
| 72 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/crypto/include/mbedtls |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 73 | |
| 74 | # Watchdog related includes |
| 75 | INCLUDE_DIRS_WATCHDOG := $(THIS_APP_PATH)/watchdog |
| 76 | |
| 77 | # Collected include directories for libraries |
| 78 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_HAL)) |
| 79 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_WATCHDOG)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 80 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_MBEDTLS)) |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 81 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_RETARGET_IO_PDL)) |
| 82 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_PLATFORM)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 83 | |
| 84 | ################################################################################ |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 85 | # mbedTLS hardware acceleration settings |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 86 | ################################################################################ |
| 87 | ifeq ($(USE_CRYPTO_HW), 1) |
| 88 | # cy-mbedtls-acceleration related include directories |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 89 | INCLUDE_DIRS_MBEDTLS_MXCRYPTO := $(THIS_APP_PATH)/cy-mbedtls-acceleration/mbedtls_MXCRYPTO |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 90 | # Collect source files for MbedTLS acceleration |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 91 | SOURCES_MBEDTLS_MXCRYPTO := $(wildcard $(THIS_APP_PATH)/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/*.c) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 92 | # |
| 93 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_MBEDTLS_MXCRYPTO)) |
| 94 | # Collected source files for libraries |
| 95 | SOURCES_LIBS += $(SOURCES_MBEDTLS_MXCRYPTO) |
| 96 | endif |