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 | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 31 | CUR_LIBS_PATH = $(CURDIR)/libs |
| 32 | MBEDTLS_PATH = $(CURDIR)/../../ext |
| 33 | |
| 34 | # Collect source files for PDL |
| 35 | SOURCES_PDL := $(wildcard $(CUR_LIBS_PATH)/pdl/psoc6pdl/drivers/source/*.c) |
Roman Okhrimenko | 0c7aebc | 2020-09-02 13:37:51 +0300 | [diff] [blame] | 36 | SOURCES_WATCHDOG := $(wildcard $(CUR_LIBS_PATH)/watchdog/*.c) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 37 | |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 38 | # PDL related include directories |
| 39 | INCLUDE_DIRS_PDL := $(CUR_LIBS_PATH)/pdl/psoc6pdl/drivers/include |
| 40 | INCLUDE_DIRS_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/devices/include/ip |
| 41 | INCLUDE_DIRS_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/devices/include |
| 42 | INCLUDE_DIRS_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/cmsis/include |
| 43 | |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 44 | # core-libs related include directories |
| 45 | INCLUDE_DIRS_CORE_LIB := $(CUR_LIBS_PATH)/core-lib/include |
Roman Okhrimenko | 0c7aebc | 2020-09-02 13:37:51 +0300 | [diff] [blame] | 46 | INCLUDE_DIRS_WATCHDOG := $(CUR_LIBS_PATH)/watchdog |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 47 | |
| 48 | # Collected source files for libraries |
| 49 | SOURCES_LIBS := $(SOURCES_PDL) |
Roman Okhrimenko | 0c7aebc | 2020-09-02 13:37:51 +0300 | [diff] [blame] | 50 | SOURCES_LIBS += $(SOURCES_WATCHDOG) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 51 | SOURCES_LIBS += $(SOURCES_PLATFORM) |
Bohdan Kovalchuk | 7725652 | 2020-04-15 18:03:43 +0300 | [diff] [blame] | 52 | |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 53 | # Collected include directories for libraries |
| 54 | INCLUDE_DIRS_LIBS := $(addprefix -I,$(INCLUDE_DIRS_PDL)) |
| 55 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_PLATFORM)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 56 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_CORE_LIB)) |
Roman Okhrimenko | 0c7aebc | 2020-09-02 13:37:51 +0300 | [diff] [blame] | 57 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_WATCHDOG)) |
Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 58 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_HAL)) |
| 59 | |
| 60 | ################################################################################ |
| 61 | # mbedTLS settings |
| 62 | ################################################################################ |
| 63 | # MbedTLS related include directories |
| 64 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include |
| 65 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/include/mbedtls |
| 66 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/crypto/include |
| 67 | INCLUDE_DIRS_MBEDTLS += $(MBEDTLS_PATH)/mbedtls/crypto/include/mbedtls |
| 68 | # |
| 69 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_MBEDTLS)) |
| 70 | # Collect source files for MbedTLS |
| 71 | SOURCES_MBEDTLS := $(wildcard $(MBEDTLS_PATH)/mbedtls/library/*.c) |
| 72 | SOURCES_MBEDTLS += $(wildcard $(MBEDTLS_PATH)/mbedtls/crypto/library/*.c) |
| 73 | # Collected source files for libraries |
| 74 | SOURCES_LIBS += $(SOURCES_MBEDTLS) |
| 75 | ## mbedTLS settings |
| 76 | |
| 77 | ################################################################################ |
| 78 | # mbedTLS acceleration settings |
| 79 | ################################################################################ |
| 80 | ifeq ($(USE_CRYPTO_HW), 1) |
| 81 | # cy-mbedtls-acceleration related include directories |
| 82 | INCLUDE_DIRS_MBEDTLS_MXCRYPTO := $(CUR_LIBS_PATH)/cy-mbedtls-acceleration/mbedtls_MXCRYPTO |
| 83 | # Collect source files for MbedTLS acceleration |
| 84 | SOURCES_MBEDTLS_MXCRYPTO := $(wildcard $(CUR_LIBS_PATH)/cy-mbedtls-acceleration/mbedtls_MXCRYPTO/*.c) |
| 85 | # |
| 86 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_MBEDTLS_MXCRYPTO)) |
| 87 | # Collected source files for libraries |
| 88 | SOURCES_LIBS += $(SOURCES_MBEDTLS_MXCRYPTO) |
| 89 | endif |
| 90 | ## mbedTLS acceleration settings |
| 91 | |
| 92 | ASM_FILES_PDL := |
| 93 | ifeq ($(COMPILER), GCC_ARM) |
| 94 | ASM_FILES_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/drivers/source/TOOLCHAIN_GCC_ARM/cy_syslib_gcc.S |
| 95 | else |
| 96 | $(error Only GCC ARM is supported at this moment) |
| 97 | endif |
| 98 | |
| 99 | ASM_FILES_LIBS := $(ASM_FILES_PDL) |
| 100 | ASM_FILES_LIBS += $(ASM_FILES_PLATFORM) |
| 101 | |
| 102 | # Add define for PDL version |
| 103 | DEFINES_PDL += -DPDL_VERSION=$(PDL_VERSION) |
| 104 | |
| 105 | DEFINES_LIBS := $(DEFINES_PLATFORM) |
| 106 | DEFINES_LIBS += $(DEFINES_PDL) |