|
| 1 | +################################################################################ |
| 2 | +# \file Makefile |
| 3 | +# \version 1.0 |
| 4 | +# |
| 5 | +# \brief |
| 6 | +# Top-level application make file. |
| 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 | +# Choose between "aws_demos" and "aws_tests" |
| 27 | +CY_AFR_BUILD=aws_demos |
| 28 | + |
| 29 | +# Root location of AFR directory |
| 30 | +CY_AFR_ROOT=../../../../../.. |
| 31 | + |
| 32 | +# Build artifact location |
| 33 | +CY_BUILD_RELATIVE_LOCATION=$(CY_AFR_ROOT)/build/cy |
| 34 | +CY_BUILD_LOCATION=$(abspath $(CY_BUILD_RELATIVE_LOCATION)) |
| 35 | + |
| 36 | +# Memfault |
| 37 | +MEMFAULT_SDK_ROOT := ../../.. |
| 38 | +MEMFAULT_PORT_ROOT := $(MEMFAULT_SDK_ROOT)/examples/cypress/CY8CKIT-064S0S2-4343W/src |
| 39 | + |
| 40 | +MEMFAULT_COMPONENTS := core util panics metrics |
| 41 | +include $(MEMFAULT_SDK_ROOT)/makefiles/MemfaultWorker.mk |
| 42 | + |
| 43 | +################################################################################ |
| 44 | +# Basic Configuration |
| 45 | +################################################################################ |
| 46 | + |
| 47 | +# Target board/hardware |
| 48 | +TARGET=CY8CKIT_064S0S2_4343W |
| 49 | + |
| 50 | +# Name of application (used to derive name of final linked file). |
| 51 | +APPNAME=$(CY_AFR_BUILD) |
| 52 | + |
| 53 | +# Name of toolchain to use. Options include: |
| 54 | +# |
| 55 | +# GCC_ARM -- GCC 7.2.1, provided with ModusToolbox IDE |
| 56 | +# ARM -- ARM Compiler (must be installed separately) |
| 57 | +# IAR -- IAR Compiler (must be installed separately) |
| 58 | +# |
| 59 | +# See also: CY_COMPILER_PATH below |
| 60 | +TOOLCHAIN=GCC_ARM |
| 61 | + |
| 62 | +# Default build configuration. Options include: |
| 63 | +# |
| 64 | +# Debug -- build with minimal optimizations, focus on debugging. |
| 65 | +# Release -- build with full optimizations |
| 66 | +CONFIG=Debug |
| 67 | + |
| 68 | +# If set to "true" or "1", display full command-lines when building. |
| 69 | +VERBOSE= |
| 70 | + |
| 71 | + |
| 72 | +################################################################################ |
| 73 | +# Feature Configuration |
| 74 | +################################################################################ |
| 75 | +# Enable or disable BLE module |
| 76 | +BLE_SUPPORTED=1 |
| 77 | + |
| 78 | +# Set to 1 to add OTA defines, sources, and libraries (must be used with MCUBoot) |
| 79 | +# NOTE: Extra code must be called from your app to initialize AFR OTA Agent |
| 80 | +OTA_SUPPORT=0 |
| 81 | + |
| 82 | +# This platform always uses EXTERNAL_FLASH |
| 83 | +OTA_USE_EXTERNAL_FLASH:=1 |
| 84 | + |
| 85 | +# Define CY_TEST_APP_VERSION_IN_TAR here to test application version |
| 86 | +# in TAR archive at start of OTA image download. |
| 87 | +# NOTE: This requires that the version numbers here and in the header file match. |
| 88 | +# NOTE: This will create compile warnings such as |
| 89 | +# 'warning: "APP_VERSION_MAJOR" redefined' |
| 90 | +# |
| 91 | +# CY_TEST_APP_VERSION_IN_TAR=1 |
| 92 | +# |
| 93 | +# APP_VERSION_MAJOR:=1 |
| 94 | +# APP_VERSION_MINOR:=0 |
| 95 | +# APP_VERSION_BUILD:=0 |
| 96 | + |
| 97 | +# CY_TFM_PSA_SUPPORTED feature cannot be disabled on this platform. |
| 98 | +CY_TFM_PSA_SUPPORTED=1 |
| 99 | + |
| 100 | +# Using new Bootloader with SWAP / STATUS |
| 101 | +CY_MCUBOOT_SWAP_USING_STATUS=1 |
| 102 | + |
| 103 | +################################################################################ |
| 104 | +# Advanced Configuration |
| 105 | +################################################################################ |
| 106 | + |
| 107 | +# Enable optional code that is ordinarily disabled by default. |
| 108 | +# |
| 109 | +# Available components depend on the specific targeted hardware and firmware |
| 110 | +# in use. In general, if you have |
| 111 | +# |
| 112 | +# COMPONENTS=foo bar |
| 113 | +# |
| 114 | +# ... then code in directories named COMPONENT_foo and COMPONENT_bar will be |
| 115 | +# added to the build |
| 116 | +# |
| 117 | +COMPONENTS= |
| 118 | + |
| 119 | +# Like COMPONENTS, but disable optional code that was enabled by default. |
| 120 | +DISABLE_COMPONENTS= |
| 121 | + |
| 122 | +# By default the build system automatically looks in the Makefile's directory |
| 123 | +# tree for source code and builds it. The SOURCES variable can be used to |
| 124 | +# manually add source code to the build process from a location not searched |
| 125 | +# by default, or otherwise not found by the build system. |
| 126 | +SOURCES = \ |
| 127 | + $(MEMFAULT_COMPONENTS_SRCS) \ |
| 128 | + $(MEMFAULT_SDK_ROOT)/ports/freertos/src/memfault_metrics_freertos.c \ |
| 129 | + $(MEMFAULT_SDK_ROOT)/ports/freertos/src/memfault_core_freertos.c \ |
| 130 | + $(MEMFAULT_SDK_ROOT)/ports/freertos/src/memfault_freertos_ram_regions.c |
| 131 | + |
| 132 | +# Like SOURCES, but for include directories. Value should be paths to |
| 133 | +# directories (without a leading -I). |
| 134 | +# TODO remove this once whd is update to new version |
| 135 | +INCLUDES = \ |
| 136 | + $(CY_AFR_ROOT)/vendors/cypress/MTB/libraries/wifi-host-driver/WiFi_Host_Driver/resources/nvram/TARGET_CY8CKIT_064B0S2_4343W \ |
| 137 | + $(MEMFAULT_COMPONENTS_INC_FOLDERS) \ |
| 138 | + $(MEMFAULT_SDK_ROOT)/ports/include \ |
| 139 | + $(MEMFAULT_PORT_ROOT) |
| 140 | + |
| 141 | +# Add additional defines to the build process (without a leading -D). |
| 142 | +DEFINES= |
| 143 | + |
| 144 | +# Select softfp or hardfp floating point. Default is softfp. |
| 145 | +VFP_SELECT= |
| 146 | + |
| 147 | +# Additional / custom C compiler flags. |
| 148 | +# |
| 149 | +# NOTE: Includes and defines should use the INCLUDES and DEFINES variable |
| 150 | +# above. |
| 151 | +CFLAGS= |
| 152 | + |
| 153 | +# Additional / custom C++ compiler flags. |
| 154 | +# |
| 155 | +# NOTE: Includes and defines should use the INCLUDES and DEFINES variable |
| 156 | +# above. |
| 157 | +CXXFLAGS= |
| 158 | + |
| 159 | +# Additional / custom assembler flags. |
| 160 | +# |
| 161 | +# NOTE: Includes and defines should use the INCLUDES and DEFINES variable |
| 162 | +# above. |
| 163 | +ASFLAGS= |
| 164 | + |
| 165 | +# Additional / custom linker flags. |
| 166 | +LDFLAGS=-Wl,--build-id |
| 167 | + |
| 168 | +# Additional / custom libraries to link in to the application. |
| 169 | +LDLIBS= |
| 170 | + |
| 171 | +# Path to the linker script to use (if empty, use the default linker script). |
| 172 | +export LINKER_SCRIPT=cyb06xxa_cm4_dual.ld |
| 173 | + |
| 174 | +# Custom pre-build commands to run. |
| 175 | +PREBUILD= |
| 176 | + |
| 177 | +# Custom post-build commands to run. |
| 178 | +POSTBUILD= |
| 179 | + |
| 180 | + |
| 181 | +################################################################################ |
| 182 | +# Paths |
| 183 | +################################################################################ |
| 184 | + |
| 185 | +# Relative path to the project directory (default is the Makefile's directory). |
| 186 | +# |
| 187 | +# This controls where automatic source code discovery looks for code. |
| 188 | +CY_APP_PATH= |
| 189 | + |
| 190 | +# Relative path to the "base" library. It provides the core makefile build |
| 191 | +# infrastructure. |
| 192 | +CY_BASELIB_PATH=$(CY_AFR_ROOT)/vendors/cypress/MTB/psoc6/psoc6make |
| 193 | + |
| 194 | +# Absolute path to the compiler's "bin" directory. |
| 195 | +# |
| 196 | +# The default depends on the selected TOOLCHAIN (GCC_ARM uses the ModusToolbox |
| 197 | +# IDE provided compiler by default). |
| 198 | +CY_COMPILER_PATH= |
| 199 | + |
| 200 | +# Include aFR configuration make file |
| 201 | +include $(CY_AFR_ROOT)/projects/cypress/make_support/afr.mk |
| 202 | + |
| 203 | + |
| 204 | +################################################################################ |
| 205 | +# Tools path |
| 206 | +################################################################################ |
| 207 | + |
| 208 | +# Locate ModusToolbox IDE helper tools folders in default installation |
| 209 | +# locations for Windows, Linux, and macOS. |
| 210 | +CY_WIN_HOME=$(subst \,/,$(USERPROFILE)) |
| 211 | +CY_TOOLS_PATHS ?= $(wildcard \ |
| 212 | + $(CY_WIN_HOME)/ModusToolbox/tools_* \ |
| 213 | + $(HOME)/ModusToolbox/tools_* \ |
| 214 | + /Applications/ModusToolbox/tools_*) |
| 215 | + |
| 216 | +# If you install ModusToolbox IDE in a custom location, add the path to its |
| 217 | +# "tools_X.Y" folder (where X and Y are the version number of the tools |
| 218 | +# folder). |
| 219 | +CY_TOOLS_PATHS+= |
| 220 | + |
| 221 | +# Default to the newest installed tools folder, or the users override (if it's |
| 222 | +# found). |
| 223 | +CY_TOOLS_DIR=$(lastword $(sort $(wildcard $(CY_TOOLS_PATHS)))) |
| 224 | + |
| 225 | +ifeq ($(CY_TOOLS_DIR),) |
| 226 | +$(error Unable to find any of the available CY_TOOLS_PATHS -- $(CY_TOOLS_PATHS)) |
| 227 | +endif |
| 228 | + |
| 229 | +$(info Tools Directory: $(CY_TOOLS_DIR)) |
| 230 | +include $(CY_TOOLS_DIR)/make/start.mk |
0 commit comments