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 | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame^] | 35 | # Add watchdog folder to build |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 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 |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame^] | 39 | SOURCES_RETARGET_IO_PDL := $(PLATFORM_SOURCES_RETARGET_IO_PDL) |
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 |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame^] | 42 | INCLUDE_RETARGET_IO_PDL := $(PLATFORM_INCLUDE_RETARGET_IO_PDL) |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 43 | |
| 44 | # PSOC6HAL source files |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame^] | 45 | SOURCES_HAL_MCUB := $(PLATFORM_SOURCES_HAL_MCUB) |
| 46 | |
| 47 | # PSOC6HAL include dirs |
| 48 | INCLUDE_DIRS_HAL_MCUB := $(PLATFORM_INCLUDE_DIRS_HAL_MCUB) |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 49 | |
| 50 | # MbedTLS source files |
| 51 | SOURCES_MBEDTLS := $(wildcard $(MBEDTLS_PATH)/mbedtls/library/*.c) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 52 | |
| 53 | # Collected source files for libraries |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 54 | SOURCES_LIBS += $(SOURCES_MBEDTLS) |
Roman Okhrimenko | 0c7aebc | 2020-09-02 13:37:51 +0300 | [diff] [blame] | 55 | SOURCES_LIBS += $(SOURCES_WATCHDOG) |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame^] | 56 | |
| 57 | # Collect source files for platform dependent libraries |
| 58 | SOURCES_LIBS += $(SOURCES_HAL_MCUB) |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 59 | SOURCES_LIBS += $(SOURCES_RETARGET_IO_PDL) |
Bohdan Kovalchuk | 7725652 | 2020-04-15 18:03:43 +0300 | [diff] [blame] | 60 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 61 | # Watchdog related includes |
| 62 | INCLUDE_DIRS_WATCHDOG := $(THIS_APP_PATH)/watchdog |
| 63 | |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame^] | 64 | # MbedTLS related include directories |
| 65 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include |
| 66 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include/mbedtls |
| 67 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include/psa |
| 68 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/library |
| 69 | |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 70 | # Collected include directories for libraries |
Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame] | 71 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_WATCHDOG)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 72 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_MBEDTLS)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 73 | |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame^] | 74 | # Collect platform dependent include dirs |
| 75 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_HAL_MCUB)) |
| 76 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_RETARGET_IO_PDL)) |
| 77 | |
| 78 | ############################################################################### |
| 79 | # Print debug information about all settings used and/or set in this file |
| 80 | ifeq ($(VERBOSE), 1) |
| 81 | $(info #### libs.mk ####) |
| 82 | $(info INCLUDE_DIRS_HAL_MCUB <-> $(INCLUDE_DIRS_HAL_MCUB)) |
| 83 | $(info INCLUDE_DIRS_LIBS --> $(INCLUDE_DIRS_LIBS)) |
| 84 | $(info INCLUDE_DIRS_MBEDTLS <-> $(INCLUDE_DIRS_MBEDTLS)) |
| 85 | $(info INCLUDE_DIRS_WATCHDOG <-> $(INCLUDE_DIRS_WATCHDOG)) |
| 86 | $(info INCLUDE_RETARGET_IO_PDL <-> $(INCLUDE_RETARGET_IO_PDL)) |
| 87 | $(info MBEDTLS_PATH <-- $(MBEDTLS_PATH)) |
| 88 | $(info PLATFORM_INCLUDE_DIRS_HAL_MCUB <-- $(PLATFORM_INCLUDE_DIRS_HAL_MCUB)) |
| 89 | $(info PLATFORM_INCLUDE_RETARGET_IO_PDL <-- $(PLATFORM_INCLUDE_RETARGET_IO_PDL)) |
| 90 | $(info PLATFORM_SOURCES_HAL_MCUB <-- $(PLATFORM_SOURCES_HAL_MCUB)) |
| 91 | $(info PLATFORM_SOURCES_RETARGET_IO_PDL <-- $(PLATFORM_SOURCES_RETARGET_IO_PDL)) |
| 92 | $(info PRJ_DIR <-- $(PRJ_DIR)) |
| 93 | $(info SOURCES_HAL_MCUB <-> $(SOURCES_HAL_MCUB)) |
| 94 | $(info SOURCES_LIBS --> $(SOURCES_LIBS)) |
| 95 | $(info SOURCES_MBEDTLS <-> $(SOURCES_MBEDTLS)) |
| 96 | $(info SOURCES_RETARGET_IO_PDL <-> $(SOURCES_RETARGET_IO_PDL)) |
| 97 | $(info SOURCES_WATCHDOG <-> $(SOURCES_WATCHDOG)) |
| 98 | $(info THIS_APP_PATH <-- $(THIS_APP_PATH)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 99 | endif |