Roman Okhrimenko | 4bc2810 | 2021-02-01 19:31:41 +0200 | [diff] [blame^] | 1 | ################################################################################ |
| 2 | # \file common_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-2021 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 | include host.mk |
| 27 | |
| 28 | ################################################################################ |
| 29 | # PDL library |
| 30 | ################################################################################ |
| 31 | PSOC6_LIBS_PATH = $(PRJ_DIR)/libs |
| 32 | |
| 33 | ifeq ($(CORE),CM0P) |
| 34 | CORE_SIFFX=m0plus |
| 35 | else |
| 36 | CORE_SIFFX=m4 |
| 37 | endif |
| 38 | |
| 39 | # Collect source files for PDL |
| 40 | SOURCES_PDL := $(wildcard $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/drivers/source/*.c) |
| 41 | SOURCES_PDL += $(wildcard $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/devices/COMPONENT_CAT1A/source/*.c) |
| 42 | |
| 43 | # PDL startup related files |
| 44 | SOURCES_PDL_STARTUP := $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/devices/COMPONENT_CAT1A/templates/COMPONENT_MTB/COMPONENT_$(CORE)/system_psoc6_c$(CORE_SIFFX).c |
| 45 | |
| 46 | # PDL related include directories |
| 47 | INCLUDE_DIRS_PDL := $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/drivers/include |
| 48 | INCLUDE_DIRS_PDL += $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/devices/COMPONENT_CAT1A/include/ip |
| 49 | INCLUDE_DIRS_PDL += $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/devices/COMPONENT_CAT1A/include |
| 50 | INCLUDE_DIRS_PDL += $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/cmsis/include |
| 51 | |
| 52 | # PDL startup related files |
| 53 | INCLUDE_DIRS_PDL_STARTUP := $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/devices/COMPONENT_CAT1A/templates/COMPONENT_MTB |
| 54 | |
| 55 | # core-libs related include directories |
| 56 | INCLUDE_DIRS_CORE_LIB := $(PSOC6_LIBS_PATH)/core-lib/include |
| 57 | |
| 58 | STARTUP_FILE := $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/devices/COMPONENT_CAT1A/templates/COMPONENT_MTB/COMPONENT_$(CORE)/TOOLCHAIN_$(COMPILER)/startup_psoc6_$(PLATFORM_SUFFIX)_c$(CORE_SIFFX) |
| 59 | |
| 60 | ifeq ($(COMPILER), GCC_ARM) |
| 61 | ASM_FILES_STARTUP := $(STARTUP_FILE).S |
| 62 | else |
| 63 | $(error Only GCC ARM is supported at this moment) |
| 64 | endif |
| 65 | |
| 66 | |
| 67 | # Collected source files for libraries |
| 68 | SOURCES_LIBS := $(SOURCES_PDL) |
| 69 | SOURCES_LIBS += $(SOURCES_PDL_STARTUP) |
| 70 | |
| 71 | # Collected include directories for libraries |
| 72 | INCLUDE_DIRS_LIBS := $(addprefix -I,$(INCLUDE_DIRS_PDL)) |
| 73 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_PDL_STARTUP)) |
| 74 | INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_CORE_LIB)) |
| 75 | |
| 76 | ASM_FILES_PDL := |
| 77 | ifeq ($(COMPILER), GCC_ARM) |
| 78 | ASM_FILES_PDL += $(PSOC6_LIBS_PATH)/mtb-pdl-cat1/drivers/source/TOOLCHAIN_GCC_ARM/cy_syslib_gcc.S |
| 79 | else |
| 80 | $(error Only GCC ARM is supported at this moment) |
| 81 | endif |
| 82 | |
| 83 | ASM_FILES_LIBS := $(ASM_FILES_PDL) |
| 84 | |
| 85 | # Add define for PDL version |
| 86 | DEFINES_PDL += -DPDL_VERSION=$(PDL_VERSION) |
| 87 | |
| 88 | DEFINES_LIBS := $(DEFINES_PLATFORM) |
| 89 | DEFINES_LIBS += $(DEFINES_PDL) |