Code Compilation Customization
If you install supported build tools, you can configure a build process that produces executable code after code generation. You can customize the compilation stage of the build process.
For the toolchain approach, register and use a custom toolchain.
For the template makefile approach:
Customize a shipped template makefile.
Create and run a post-code-generation command.
Create and apply hook methods at specific points of the build process.
Customize generated makefiles for S-functions.
Add Flags, Defines, Files, and Paths to Build Information Objects
|Add compiler options to build information|
|Add preprocessor macro definitions to build information|
|Add include files to build information|
|Add include paths to build information|
|Add link options to build information|
|Add link objects to build information|
|Add nonbuild-related files to build information|
|Add source files to build information|
|Add source paths to build information|
|Add template makefile (TMF) tokens to build information|
Find Arguments and Files in Build Information Objects
Get Flags, Defines, Files, and Paths from Build Information Objects
|Get build arguments from build information|
|Get compiler options from build information|
|Get preprocessor macro definitions from build information|
|Get list of files from build information|
|Get include files from build information|
|Get include paths from build information|
|Get link options from build information|
|Get nonbuild-related files from build information|
|Get source files from build information|
|Get source paths from build information|
Set Output Options for Build Information Objects
Update File Paths, Extensions, and Separators in Build Information Objects
Build Generated Code
- Select and Configure C or C++ Compiler
Consider programming language compliance for generated code and select a compiler for the build process.
- Control Compiler Optimizations
Control compiler optimizations for your makefile at the Simulink UI level.
- Troubleshoot Compiler Issues
Identify and fix issues that prevent compiler operation in the build process.
- Control Build Process Compiling and Linking
Select whether build process ends after code generation and (for template makefile approach) select template makefile options.
Library Names and Locations
- Control Library Location and Naming During Build
Choose the location for precompiled, non-precompiled, and model reference libraries and select the file extension that the build process applies to libraries.
Template Makefile Approach
- Template Makefiles and Make Options
Template makefiles that are built into the code generator.
- Customize Template Makefiles
Develop a custom template makefile to control the build process.
- Customize Post-Code-Generation Build Processing
Modify the build process with a post-code-generation command and (optionally) use build information objects to augment this process.
- Customize Build Process with STF_make_rtw_hook File
Modify the build process with the build process hook mechanism in a custom
- Replace STF_rtw_info_hook Supplied Target Data
For custom targets created prior to MATLAB® Release 14, update use of custom
hook for specifying target-specific characteristics.
- Customize Build Process with sl_customization.m
Modify the build process with the build process hook mechanism in a custom sl_customization.m hook file.
- Use makecfg to Customize Generated Makefiles for S-Functions
Configure makefile generation for the S-function build process.