blob: ff8637b5ef35006cba43a7cc2d3278803d008ce0 [file] [log] [blame]
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +02001################################################################################
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################################################################################
29PDL_VERSION = 121
30#
Roman Okhrimenko4bc28102021-02-01 19:31:41 +020031CUR_LIBS_PATH = $(PRJ_DIR)/libs
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020032
33# Collect source files for Retarget-io
Roman Okhrimenko977b3752022-03-31 14:40:48 +030034ifneq ($(PLATFORM), CYW20829)
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000035ifeq ($(APP_CORE), CM0P)
36SOURCES_RETARGET_IO := $(wildcard $(THIS_APP_PATH)/retarget_io_pdl/*.c)
37endif
38ifneq ($(APP_CORE), CM0P)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020039SOURCES_RETARGET_IO := $(wildcard $(CUR_LIBS_PATH)/retarget-io/*.c)
Roman Okhrimenko977b3752022-03-31 14:40:48 +030040endif
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000041endif
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030042SOURCES_WATCHDOG := $(wildcard $(CUR_LIBS_PATH)/watchdog/*.c)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020043
44# Collect source files for HAL
Roman Okhrimenko977b3752022-03-31 14:40:48 +030045ifneq ($(PLATFORM), CYW20829)
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000046ifneq ($(APP_CORE), CM0P)
Roman Okhrimenko977b3752022-03-31 14:40:48 +030047SOURCES_HAL_BLINKY := $(wildcard $(CUR_LIBS_PATH)/mtb-hal-cat1/source/*.c)
48SOURCES_HAL_BLINKY += $(wildcard $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/source/triggers/*.c)
49SOURCES_HAL_BLINKY += $(wildcard $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/source/pin_packages/*.c)
50endif
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000051endif
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020052
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020053# Retarget-io related include directories
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000054ifeq ($(APP_CORE), CM0P)
55INCLUDE_DIRS_RETARGET_IO := $(THIS_APP_PATH)/retarget_io_pdl
56endif
57ifneq ($(APP_CORE), CM0P)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020058INCLUDE_DIRS_RETARGET_IO := $(CUR_LIBS_PATH)/retarget-io
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000059endif
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030060INCLUDE_DIRS_WATCHDOG := $(CUR_LIBS_PATH)/watchdog
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020061
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020062# Collect dirrectories containing headers for PSOC6 HAL
Roman Okhrimenko977b3752022-03-31 14:40:48 +030063ifneq ($(PLATFORM), CYW20829)
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000064ifneq ($(APP_CORE), CM0P)
Roman Okhrimenko977b3752022-03-31 14:40:48 +030065INCLUDE_DIRS_HAL_BLINKY := $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A
66INCLUDE_DIRS_HAL_BLINKY := $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/include
67INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/include
68INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/include_pvt
69INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/include/pin_packages
70INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/include/triggers
71endif
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000072endif
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020073
74# Collected source files for libraries
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030075SOURCES_LIBS += $(SOURCES_WATCHDOG)
Roman Okhrimenko977b3752022-03-31 14:40:48 +030076ifneq ($(PLATFORM), CYW20829)
77SOURCES_LIBS += $(SOURCES_RETARGET_IO)
78SOURCES_LIBS += $(SOURCES_HAL_BLINKY)
79endif
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020080
81# Collected include directories for libraries
Roman Okhrimenko977b3752022-03-31 14:40:48 +030082INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_WATCHDOG))
83ifneq ($(PLATFORM), CYW20829)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020084INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_RETARGET_IO))
Roman Okhrimenko977b3752022-03-31 14:40:48 +030085INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_HAL_BLINKY))
86endif
87
88###############################################################################
89# Print debug information about all settings used and/or set in this file
90ifeq ($(VERBOSE), 1)
91$(info #### libs.mk ####)
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +000092$(info APP_CORE <-- $(APP_CORE))
Roman Okhrimenko977b3752022-03-31 14:40:48 +030093$(info CUR_LIBS_PATH <-- $(CUR_LIBS_PATH))
94$(info INCLUDE_DIRS_HAL_BLINKY <-> $(INCLUDE_DIRS_HAL_BLINKY))
95$(info INCLUDE_DIRS_LIBS --> $(INCLUDE_DIRS_LIBS))
96$(info INCLUDE_DIRS_RETARGET_IO <-> $(INCLUDE_DIRS_RETARGET_IO))
97$(info INCLUDE_DIRS_WATCHDOG <-> $(INCLUDE_DIRS_WATCHDOG))
98$(info PLATFORM <-- $(PLATFORM))
99$(info PRJ_DIR <-- $(PRJ_DIR))
100$(info SOURCES_HAL_BLINKY <-> $(SOURCES_HAL_BLINKY))
101$(info SOURCES_LIBS --> $(SOURCES_LIBS))
102$(info SOURCES_RETARGET_IO <-> $(SOURCES_RETARGET_IO))
103$(info SOURCES_WATCHDOG <-> $(SOURCES_WATCHDOG))
Dovhal Artem (CSUKR CSS ICW SW FW 1)f7a3d1b2022-04-01 15:07:37 +0000104$(info THIS_APP_PATH <-- $(THIS_APP_PATH))
Roman Okhrimenko977b3752022-03-31 14:40:48 +0300105endif