blob: 08fc130411f723627fc706a2b4e1bfb2b32a5537 [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)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020035SOURCES_RETARGET_IO := $(wildcard $(CUR_LIBS_PATH)/retarget-io/*.c)
Roman Okhrimenko977b3752022-03-31 14:40:48 +030036endif
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030037SOURCES_WATCHDOG := $(wildcard $(CUR_LIBS_PATH)/watchdog/*.c)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020038
39# Collect source files for HAL
Roman Okhrimenko977b3752022-03-31 14:40:48 +030040ifneq ($(PLATFORM), CYW20829)
41SOURCES_HAL_BLINKY := $(wildcard $(CUR_LIBS_PATH)/mtb-hal-cat1/source/*.c)
42SOURCES_HAL_BLINKY += $(wildcard $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/source/triggers/*.c)
43SOURCES_HAL_BLINKY += $(wildcard $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/source/pin_packages/*.c)
44endif
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020045
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020046# Retarget-io related include directories
47INCLUDE_DIRS_RETARGET_IO := $(CUR_LIBS_PATH)/retarget-io
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030048INCLUDE_DIRS_WATCHDOG := $(CUR_LIBS_PATH)/watchdog
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020049
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020050# Collect dirrectories containing headers for PSOC6 HAL
Roman Okhrimenko977b3752022-03-31 14:40:48 +030051ifneq ($(PLATFORM), CYW20829)
52INCLUDE_DIRS_HAL_BLINKY := $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A
53INCLUDE_DIRS_HAL_BLINKY := $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/include
54INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/include
55INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/include_pvt
56INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/include/pin_packages
57INCLUDE_DIRS_HAL_BLINKY += $(CUR_LIBS_PATH)/mtb-hal-cat1/COMPONENT_CAT1A/include/triggers
58endif
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020059
60# Collected source files for libraries
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030061SOURCES_LIBS += $(SOURCES_WATCHDOG)
Roman Okhrimenko977b3752022-03-31 14:40:48 +030062ifneq ($(PLATFORM), CYW20829)
63SOURCES_LIBS += $(SOURCES_RETARGET_IO)
64SOURCES_LIBS += $(SOURCES_HAL_BLINKY)
65endif
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020066
67# Collected include directories for libraries
Roman Okhrimenko977b3752022-03-31 14:40:48 +030068INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_WATCHDOG))
69ifneq ($(PLATFORM), CYW20829)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020070INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_RETARGET_IO))
Roman Okhrimenko977b3752022-03-31 14:40:48 +030071INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_HAL_BLINKY))
72endif
73
74###############################################################################
75# Print debug information about all settings used and/or set in this file
76ifeq ($(VERBOSE), 1)
77$(info #### libs.mk ####)
78$(info CUR_LIBS_PATH <-- $(CUR_LIBS_PATH))
79$(info INCLUDE_DIRS_HAL_BLINKY <-> $(INCLUDE_DIRS_HAL_BLINKY))
80$(info INCLUDE_DIRS_LIBS --> $(INCLUDE_DIRS_LIBS))
81$(info INCLUDE_DIRS_RETARGET_IO <-> $(INCLUDE_DIRS_RETARGET_IO))
82$(info INCLUDE_DIRS_WATCHDOG <-> $(INCLUDE_DIRS_WATCHDOG))
83$(info PLATFORM <-- $(PLATFORM))
84$(info PRJ_DIR <-- $(PRJ_DIR))
85$(info SOURCES_HAL_BLINKY <-> $(SOURCES_HAL_BLINKY))
86$(info SOURCES_LIBS --> $(SOURCES_LIBS))
87$(info SOURCES_RETARGET_IO <-> $(SOURCES_RETARGET_IO))
88$(info SOURCES_WATCHDOG <-> $(SOURCES_WATCHDOG))
89endif