Getting Started with EZ-BT WICED Modules
Document Number: 002-23400 Rev. **
117
Appendix F.
Makefile Customization
The WICED Studio SDK build system uses a hierarchical Makefile structure when building each project. The root
Makefile is found in the main SDK installation folder as
\WICED-Studio-SDK\Makefile
, and each project contains its
own specific
makefile.mk
file along with the source files in its dedicated directory. To customize the build process for a
specific project, always edit the project’s own makefile.mk content instead of modifying the top-level file.
The most common changes that you may need to make are as follows:
1. Adding new .c source files to be compiled and linked:
Splitting the source code into multiple files can greatly improve organization and maintainability as the project
grows. To add more files to the build process beyond the initial set that is created from the WICED Bluetooth
Designer tool, use the
APP_SRC
keyword:
You can include as many extra files as you need. Note that the very first file should use the direct assignment
operator (“=”), while all subsequent files should use the append operator (“+=”).
2. Adding extra include folders into the search path:
Some projects require the use of additional libraries that assume particular 'include'
folders are in the compiler’s
include search path. To avoid having to rewrite source files with explicit include paths throughout, use the
INCS
keyword along with the
$(DIR)
variable to denote the project’s root folder:
You can add as many extra include search folders as you need. Note that all additional folders should use the
append operator (“+=”) since the SDK’s top-level Makefile assigns some folders already. Using the direct
assignment operator (“=”) will wipe out these default folders and break the compile process.
3. Applying pre-built optional patches that are part of the WICED SDK:
Since the WICED Studio Bluetooth LE stack is part of the chipset ROM inside the module, updates and fixes to
low-level functionality require the use of precompiled patches, which are loaded and applied during the boot
process. These patches must be included especially during the compile process so that they are part of the final
firmware binary image. To specify patches for this purpose, use the
APP_PATCHES_AND_LIBS
keyword:
APP_SRC
= spp.c
A
= hello_sensor.c
A
= wiced_bt_cfg.c
INCS +
= $(DIR)/library1/include
INCS +
= $(DIR)/library2/include
INCS +
= $(DIR)/some/other/include
APP_PATCHES_AN=
FM25Q04_sflash.a