Makefile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. # Basic Configuration
  27. ################################################################################
  28. # Target board/hardware
  29. TARGET=CY8CKIT-062-BLE
  30. # Name of application (used to derive name of final linked file).
  31. APPNAME=mtb-example-psoc6-empty-app
  32. # Name of toolchain to use. Options include:
  33. #
  34. # GCC_ARM -- GCC 7.2.1, provided with ModusToolbox IDE
  35. # ARM -- ARM Compiler (must be installed separately)
  36. # IAR -- IAR Compiler (must be installed separately)
  37. #
  38. # See also: CY_COMPILER_PATH below
  39. TOOLCHAIN=GCC_ARM
  40. # Default build configuration. Options include:
  41. #
  42. # Debug -- build with minimal optimizations, focus on debugging.
  43. # Release -- build with full optimizations
  44. CONFIG=Debug
  45. # If set to "true" or "1", display full command-lines when building.
  46. VERBOSE=
  47. # RT-Thread root directory
  48. RTT_ROOT_DIR=../../../
  49. ################################################################################
  50. # Advanced Configuration
  51. ################################################################################
  52. # Enable optional code that is ordinarily disabled by default.
  53. #
  54. # Available components depend on the specific targeted hardware and firmware
  55. # in use. In general, if you have
  56. #
  57. # COMPONENTS=foo bar
  58. #
  59. # ... then code in directories named COMPONENT_foo and COMPONENT_bar will be
  60. # added to the build
  61. #
  62. COMPONENTS=
  63. # Like COMPONENTS, but disable optional code that was enabled by default.
  64. DISABLE_COMPONENTS=
  65. # By default the build system automatically looks in the Makefile's directory
  66. # tree for source code and builds it. The SOURCES variable can be used to
  67. # manually add source code to the build process from a location not searched
  68. # by default, or otherwise not found by the build system.
  69. SOURCES=$(wildcard $(RTT_ROOT_DIR)/libcpu/arm/cortex-m4/*.c) \
  70. $(wildcard $(RTT_ROOT_DIR)/libcpu/arm/common/*.c) \
  71. $(wildcard $(RTT_ROOT_DIR)/src/*.c) \
  72. $(wildcard $(RTT_ROOT_DIR)/components/drivers/src/*.c) \
  73. $(wildcard $(RTT_ROOT_DIR)/components/drivers/serial/*.c) \
  74. $(wildcard $(RTT_ROOT_DIR)/components/finsh/*.c)
  75. ifeq ($(TOOLCHAIN),GCC_ARM)
  76. SOURCES+=$(RTT_ROOT_DIR)/libcpu/arm/cortex-m4/context_gcc.S
  77. else ifeq ($(TOOLCHAIN),ARM)
  78. SOURCES+=$(RTT_ROOT_DIR)/libcpu/arm/cortex-m4/context_rvds.S
  79. else
  80. SOURCES+=$(RTT_ROOT_DIR)/libcpu/arm/cortex-m4/context_iar.S
  81. endif
  82. # Like SOURCES, but for include directories. Value should be paths to
  83. # directories (without a leading -I).
  84. INCLUDES=$(RTT_ROOT_DIR)/include/ \
  85. $(RTT_ROOT_DIR)/components/finsh/ \
  86. $(RTT_ROOT_DIR)/components/drivers/include/
  87. # Add additional defines to the build process (without a leading -D).
  88. DEFINES=HAVE_SIGVAL HAVE_SIGEVENT HAVE_SIGINFO RT_USING_NEWLIBC
  89. # Select softfp or hardfp floating point. Default is softfp.
  90. VFP_SELECT=hardfp
  91. # Additional / custom C compiler flags.
  92. #
  93. # NOTE: Includes and defines should use the INCLUDES and DEFINES variable
  94. # above.
  95. CFLAGS=
  96. # Additional / custom C++ compiler flags.
  97. #
  98. # NOTE: Includes and defines should use the INCLUDES and DEFINES variable
  99. # above.
  100. CXXFLAGS=
  101. # Additional / custom assembler flags.
  102. #
  103. # NOTE: Includes and defines should use the INCLUDES and DEFINES variable
  104. # above.
  105. ASFLAGS=-mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wa,-mimplicit-it=always
  106. # Additional / custom linker flags.
  107. LDFLAGS=
  108. # Additional / custom libraries to link in to the application.
  109. LDLIBS=
  110. # Path to the linker script to use (if empty, use the default linker script).
  111. LINKER_SCRIPT=
  112. # Custom pre-build commands to run.
  113. PREBUILD=
  114. # Custom post-build commands to run.
  115. POSTBUILD=
  116. ################################################################################
  117. # Paths
  118. ################################################################################
  119. # Relative path to the project directory (default is the Makefile's directory).
  120. #
  121. # This controls where automatic source code discovery looks for code.
  122. CY_APP_PATH=
  123. # Relative path to the "base" library. It provides the core makefile build
  124. # infrastructure.
  125. CY_BASELIB_PATH=libs/psoc6make
  126. # Absolute path to the compiler's "bin" directory.
  127. #
  128. # The default depends on the selected TOOLCHAIN (GCC_ARM uses the ModusToolbox
  129. # IDE provided compiler by default).
  130. CY_COMPILER_PATH=
  131. # Locate ModusToolbox IDE helper tools folders in default installation
  132. # locations for Windows, Linux, and macOS.
  133. CY_WIN_HOME=$(subst \,/,$(USERPROFILE))
  134. CY_TOOLS_PATHS ?= $(wildcard \
  135. $(CY_WIN_HOME)/ModusToolbox/tools_* \
  136. $(HOME)/ModusToolbox/tools_* \
  137. /Applications/ModusToolbox/tools_*)
  138. # If you install ModusToolbox IDE in a custom location, add the path to its
  139. # "tools_X.Y" folder (where X and Y are the version number of the tools
  140. # folder).
  141. CY_TOOLS_PATHS+=
  142. # Default to the newest installed tools folder, or the users override (if it's
  143. # found).
  144. CY_TOOLS_DIR=$(lastword $(sort $(wildcard $(CY_TOOLS_PATHS))))
  145. ifeq ($(CY_TOOLS_DIR),)
  146. $(error Unable to find any of the available CY_TOOLS_PATHS -- $(CY_TOOLS_PATHS))
  147. endif
  148. $(info Tools Directory: $(CY_TOOLS_DIR))
  149. include $(CY_TOOLS_DIR)/make/start.mk