Main Content

Custom Toolchain Registration

Register and use third-party software build toolchains to create executables and libraries

A toolchain refers to the set of build tools (build application, compiler, linker, archiver) that convert source code into a binary artifact, such as a static or dynamic library or an executable file. For example, in Linux, you invoke a toolchain for C files with gmake and set toolchain information in the makefile. For C/C++ code generation, the toolchain is formally defined in a MATLAB® object that you modify and load from a toolchain definition file (m-file). Write and use your own toolchain definition file when you perform intensive customizations to the build process.

The MATLAB Coder™ toolchain infrastructure is based around a class called coder.make.ToolchainInfo. In an object instantiation, the object properties store the formal toolchain information, such as paths to your build tools, syntaxes for the commands that call the build tools, and flags to append to the commands. Specific coder.make.ToolchainInfo methods enable access and modification of the toolchain object properties. The code generator uses the completed object definition to create and call the makefile for your toolchain.

In the code generation infrastructure, after creating the toolchain object from your toolchain definition file, you save it, and then register the object for code generation. Assign the object name to the Toolchain property of your code generation configuration object. See the featured examples for complete demonstrations.

Classes

coder.make.BuildConfigurationRepresent build configuration
coder.make.BuildItemRepresent build item
coder.make.BuildToolRepresent build tool
coder.make.ToolchainInfoRepresent custom toolchain

Topics

Custom Toolchain Registration Basics

Typical Workflow

Troubleshooting