Code Compilation Customization - MATLAB & Simulink (original) (raw)
Main Content
Customize compilation stage of build process
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.
Using the Target Framework:
- Create custom CMake toolchain definitions.
- Define and register custom makefile-based toolchains.
You can also register and use a custom makefile-based toolchain by using aToolchainInfo
object.
For the template makefile approach, customize a shipped template makefile.
For the CMake, ToolchainInfo
, and template makefile approaches:
- Create and run a post-code-generation command.
- Create and apply hook methods at specific points of the build process.
- Configure compilation of S-function code.
Namespaces
target | Manage target hardware and build tool information |
---|
Classes
Functions
setTargetProvidesMain | Disable inclusion of code generator provided (generated or static)main.c source file during build |
---|
target.connection.open | Create a connection between MATLAB development computer and remote build computer (Since R2024a) |
---|---|
target.connection.show | Show connection between MATLAB development computer and remote build computer (Since R2024a) |
target.connection.close | Close connection between MATLAB development computer and remote build computer (Since R2024a) |
codebuild | Compile and link generated code (Since R2020b) |
---|
Topics
Compiler
- 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.
Advanced Techniques
- 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_`STF`__make_rtw_hook.m
hook file. - Customize Build Process with sl_customization.m
Modify the build process with the build process hook mechanism in a customsl_customization.m
hook file. - Use makecfg to Customize Generated Makefiles for S-Functions
Configure makefile generation for the S-function build process.