blob: 9f1846cc6c84e13051d821f28d79bd824900fc68 [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#
31CUR_LIBS_PATH = $(CURDIR)/libs
32
33# Collect source files for PDL
34SOURCES_PDL := $(wildcard $(CUR_LIBS_PATH)/pdl/psoc6pdl/drivers/source/*.c)
35
36# Collect source files for Retarget-io
37SOURCES_RETARGET_IO := $(wildcard $(CUR_LIBS_PATH)/retarget-io/*.c)
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030038SOURCES_WATCHDOG := $(wildcard $(CUR_LIBS_PATH)/watchdog/*.c)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020039
40# Collect source files for HAL
41SOURCES_HAL := $(wildcard $(CUR_LIBS_PATH)/psoc6hal/COMPONENT_PSOC6HAL/source/*.c)
42SOURCES_HAL += $(wildcard $(CUR_LIBS_PATH)/psoc6hal/COMPONENT_PSOC6HAL/source/triggers/*.c)
43SOURCES_HAL += $(wildcard $(CUR_LIBS_PATH)/psoc6hal/COMPONENT_PSOC6HAL/source/pin_packages/*.c)
44
45# PDL related include directories
46INCLUDE_DIRS_PDL := $(CUR_LIBS_PATH)/pdl/psoc6pdl/drivers/include
47INCLUDE_DIRS_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/devices/include/ip
48INCLUDE_DIRS_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/devices/include
49INCLUDE_DIRS_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/cmsis/include
50
51# Retarget-io related include directories
52INCLUDE_DIRS_RETARGET_IO := $(CUR_LIBS_PATH)/retarget-io
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030053INCLUDE_DIRS_WATCHDOG := $(CUR_LIBS_PATH)/watchdog
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020054
55# core-libs related include directories
56INCLUDE_DIRS_CORE_LIB := $(CUR_LIBS_PATH)/core-lib/include
57
58# Collect dirrectories containing headers for PSOC6 HAL
59INCLUDE_DIRS_HAL := $(CUR_LIBS_PATH)/psoc6hal/include
60INCLUDE_DIRS_HAL += $(CUR_LIBS_PATH)/psoc6hal/COMPONENT_PSOC6HAL/include
61INCLUDE_DIRS_HAL += $(CUR_LIBS_PATH)/psoc6hal/COMPONENT_PSOC6HAL/include/pin_packages
62INCLUDE_DIRS_HAL += $(CUR_LIBS_PATH)/psoc6hal/COMPONENT_PSOC6HAL/include/triggers
63
64# Collected source files for libraries
65SOURCES_LIBS := $(SOURCES_PDL)
66SOURCES_LIBS += $(SOURCES_PLATFORM)
67SOURCES_LIBS += $(SOURCES_RETARGET_IO)
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030068SOURCES_LIBS += $(SOURCES_WATCHDOG)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020069SOURCES_LIBS += $(SOURCES_HAL)
70
71# Collected include directories for libraries
72INCLUDE_DIRS_LIBS := $(addprefix -I,$(INCLUDE_DIRS_PDL))
73INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_PLATFORM))
74INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_RETARGET_IO))
Roman Okhrimenko0c7aebc2020-09-02 13:37:51 +030075INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_WATCHDOG))
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020076INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_CORE_LIB))
77INCLUDE_DIRS_LIBS += $(addprefix -I,$(INCLUDE_DIRS_HAL))
78
79ASM_FILES_PDL :=
80ifeq ($(COMPILER), GCC_ARM)
81ASM_FILES_PDL += $(CUR_LIBS_PATH)/pdl/psoc6pdl/drivers/source/TOOLCHAIN_GCC_ARM/cy_syslib_gcc.S
82else
83$(error Only GCC ARM is supported at this moment)
84endif
85
86ASM_FILES_LIBS := $(ASM_FILES_PDL)
87ASM_FILES_LIBS += $(ASM_FILES_PLATFORM)
88
89# Add define for PDL version
90DEFINES_PDL += -DPDL_VERSION=$(PDL_VERSION)
91
92DEFINES_LIBS := $(DEFINES_PLATFORM)
93DEFINES_LIBS += $(DEFINES_PDL)