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 | ################################################################################ |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 29 | |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 30 | PDL_VERSION = 121 |
Bohdan Kovalchuk | 7725652 | 2020-04-15 18:03:43 +0300 | [diff] [blame] | 31 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 32 | THIS_APP_PATH = $(PRJ_DIR)/libs |
| 33 | MBEDTLS_PATH = $(PRJ_DIR)/../../ext |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 34 | |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 35 | ifneq ($(FAMILY), XMC7000) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 36 | # Add watchdog folder to build |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 37 | SOURCES_WATCHDOG := $(wildcard $(THIS_APP_PATH)/watchdog/*.c) |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 38 | # Watchdog related includes |
| 39 | INCLUDE_DIRS_WATCHDOG := $(THIS_APP_PATH)/watchdog |
| 40 | endif |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 41 | |
| 42 | # PSOC6HAL source files |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 43 | SOURCES_HAL_MCUB := $(PLATFORM_SOURCES_HAL_MCUB) |
| 44 | |
| 45 | # PSOC6HAL include dirs |
| 46 | INCLUDE_DIRS_HAL_MCUB := $(PLATFORM_INCLUDE_DIRS_HAL_MCUB) |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 47 | |
| 48 | # MbedTLS source files |
| 49 | SOURCES_MBEDTLS := $(wildcard $(MBEDTLS_PATH)/mbedtls/library/*.c) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 50 | |
| 51 | # Collected source files for libraries |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 52 | SOURCES_LIBS += $(SOURCES_MBEDTLS) |
Roman Okhrimenko | 0c7aebc | 2020-09-02 13:37:51 +0300 | [diff] [blame] | 53 | SOURCES_LIBS += $(SOURCES_WATCHDOG) |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 54 | SOURCES_LIBS += $(SOURCES_FIH) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 55 | |
| 56 | # Collect source files for platform dependent libraries |
| 57 | SOURCES_LIBS += $(SOURCES_HAL_MCUB) |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 58 | |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 59 | # MbedTLS related include directories |
Dovhal Artem (CSUKR CSS ICW SW FW 1) | f7a3d1b | 2022-04-01 15:07:37 +0000 | [diff] [blame] | 60 | ifeq ($(USE_CRYPTO_HW), 1) |
Roman Okhrimenko | 883cb5b | 2024-03-28 17:22:33 +0200 | [diff] [blame] | 61 | ifeq ($(FAMILY), CYW20829) |
Dovhal Artem (CSUKR CSS ICW SW FW 1) | f7a3d1b | 2022-04-01 15:07:37 +0000 | [diff] [blame] | 62 | # Override mbedtls/compat-2.x.h for Cryptolite CBUS workaround |
| 63 | INCLUDE_DIRS_MBEDTLS += $(PRJ_DIR)/platforms/crypto/CYW20829 |
| 64 | endif |
| 65 | endif |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 66 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include |
| 67 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include/mbedtls |
| 68 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include/psa |
| 69 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/library |
| 70 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 71 | # Collected include directories for libraries |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 72 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_WATCHDOG)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 73 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_MBEDTLS)) |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 74 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_FIH)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 75 | |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 76 | # Collect platform dependent include dirs |
| 77 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_HAL_MCUB)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 78 | |
| 79 | ############################################################################### |
| 80 | # Print debug information about all settings used and/or set in this file |
| 81 | ifeq ($(VERBOSE), 1) |
| 82 | $(info #### libs.mk ####) |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 83 | $(info INCLUDE_DIRS_FIH <-> $(INCLUDE_DIRS_FIH)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 84 | $(info INCLUDE_DIRS_HAL_MCUB <-> $(INCLUDE_DIRS_HAL_MCUB)) |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 85 | $(info INCLUDE_DIRS_LIBS <-> $(INCLUDE_DIRS_LIBS)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 86 | $(info INCLUDE_DIRS_MBEDTLS <-> $(INCLUDE_DIRS_MBEDTLS)) |
| 87 | $(info INCLUDE_DIRS_WATCHDOG <-> $(INCLUDE_DIRS_WATCHDOG)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 88 | $(info MBEDTLS_PATH <-- $(MBEDTLS_PATH)) |
Dovhal Artem (CSUKR CSS ICW SW FW 1) | f7a3d1b | 2022-04-01 15:07:37 +0000 | [diff] [blame] | 89 | $(info PLATFORM <-- $(PLATFORM)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 90 | $(info PLATFORM_INCLUDE_DIRS_HAL_MCUB <-- $(PLATFORM_INCLUDE_DIRS_HAL_MCUB)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 91 | $(info PLATFORM_SOURCES_HAL_MCUB <-- $(PLATFORM_SOURCES_HAL_MCUB)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 92 | $(info PRJ_DIR <-- $(PRJ_DIR)) |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 93 | $(info SOURCES_FIH <-> $(SOURCES_FIH)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 94 | $(info SOURCES_HAL_MCUB <-> $(SOURCES_HAL_MCUB)) |
Roman Okhrimenko | dc0ca08 | 2023-06-21 20:49:51 +0300 | [diff] [blame] | 95 | $(info SOURCES_LIBS <-> $(SOURCES_LIBS)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 96 | $(info SOURCES_MBEDTLS <-> $(SOURCES_MBEDTLS)) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 97 | $(info SOURCES_WATCHDOG <-> $(SOURCES_WATCHDOG)) |
| 98 | $(info THIS_APP_PATH <-- $(THIS_APP_PATH)) |
Dovhal Artem (CSUKR CSS ICW SW FW 1) | f7a3d1b | 2022-04-01 15:07:37 +0000 | [diff] [blame] | 99 | $(info USE_CRYPTO_HW <-- $(USE_CRYPTO_HW)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 100 | endif |