Main Content

Code Compilation Customization

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.

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.

Objects

expand all

RTW.BuildInfoProvide information for compiling and linking generated code

Functions

expand all

addCompileFlagsAdd compiler options to build information
addDefinesAdd preprocessor macro definitions to build information
addIncludeFilesAdd include files to build information
addIncludePathsAdd include paths to build information
addLinkFlagsAdd link options to build information
addLinkObjectsAdd link objects to build information
addNonBuildFilesAdd nonbuild-related files to build information
addSourceFilesAdd source files to build information
addSourcePathsAdd source paths to build information
addTMFTokensAdd template makefile (TMF) tokens to build information
findBuildArgFind a specific build argument in build information
findIncludeFilesFind and add include (header) files to build information
getBuildArgsGet build arguments from build information
getCompileFlagsGet compiler options from build information
getDefinesGet preprocessor macro definitions from build information
getFullFileListGet list of files from build information
getIncludeFilesGet include files from build information
getIncludePathsGet include paths from build information
getLinkFlagsGet link options from build information
getNonBuildFilesGet nonbuild-related files from build information
getSourceFilesGet source files from build information
getSourcePathsGet source paths from build information
setTargetProvidesMainDisable inclusion of code generator provided (generated or static) main.c source file during build
updateFilePathsAndExtensionsUpdate files in build information with missing paths and file extensions
updateFileSeparatorUpdate file separator character for file lists in build information
codebuildCompile and link generated code

Topics

Compiler

Library Names and Locations

Toolchain Approach

Template Makefile Approach

S-Function Build