| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
To control compiler optimizations for your Real-Time Workshop makefile build at Simulink GUI level, use the Compiler optimization level parameter. The Compiler optimization level parameter provides
Target-independent values Optimizations on (faster runs) and Optimizations off (faster builds), which allow you to easily toggle compiler optimizations on and off during code development
The value Custom for entering custom compiler optimization flags at Simulink GUI level, rather than editing compiler flags into template makefiles (TMFs) or supplying compiler flags to Real-Time Workshop make commands
The default setting is Optimizations off (faster builds). Selecting the value Custom enables the Custom compiler optimization flags field, in which you can enter custom compiler optimization flags (for example, -O2).
Note If you specify compiler options for your Real-Time Workshop makefile build using OPT_OPTS, MEX_OPTS (except MEX_OPTS="-v"), or MEX_OPT_FILE, the value of Compiler optimization level is ignored and a warning is issued about the ignored parameter. |
For more information about the Compiler optimization level parameter and its values, see Compiler optimization level and Custom compiler optimization flags in the Real-Time Workshop reference.
You can enter Target Language Compiler (TLC) command line options in the TLC options edit field, for example
-aVarName=1 to declare a TLC variable and/or assign a value to it
-IC:\Work to specify an include path
-v to obtain verbose output from TLC processing (for example, when debugging)
Specifying TLC options does not add any flags to the Make command field, as do some of the targets available in the System Target File Browser.
For additional information, see Setting Target Language Compiler Options for details, as well as the Target Language Compiler documentation.
The Generate makefile option specifies whether the Real-Time Workshop build process is to generate a makefile for a model. By default, the Real-Time Workshop build process generates a makefile. You can suppress the generation of a makefile, for example in support of custom build processing that is not based on makefiles, by clearing Generate makefile . When you clear this option,
The Make command and Template makefile options are unavailable.
You must set up any post code generation build processing, using a user-defined command, as explained in Customizing Post Code Generation Build Processing.
A high-level M-file command, invoked when a build is initiated, controls the Real-Time Workshop build process. Each target has an associated make command. The Make command field displays this command.
Almost all targets use the default command, make_rtw. Third-party targets might supply another make command. See the vendor's documentation.
In addition to the name of the make command, you can supply arguments in the Make command field. These arguments include compiler-specific options, include paths, and other parameters. When the build process invokes the make utility, these arguments are passed along in the make command line.
Template Makefiles and Make Options lists the Make command arguments you can use with each supported compiler.
The Template makefile field has these functions:
If you have selected a target configuration using the System Target File Browser, this field displays the name of an M-file that selects an appropriate template makefile for your development environment. For example, in Real-Time Workshop Pane: General, the Template makefile field displays grt_default_tmf, indicating that the build process invokes grt_default_tmf.m.
Template Makefiles and Make Options gives a detailed description of the logic by which the Real-Time Workshop build process selects a template makefile.
Alternatively, you can explicitly enter the name of a specific template makefile (including the extension) or an M-file that returns a template make file in this field. You must do this if you are using a target configuration that does not appear in the System Target File Browser. For example, this is necessary if you have written your own template makefile for a custom target environment or you.
If you specify your own template makefile, be sure to include the filename extension. If you omit the extension, the Real-Time Workshop build process attempts to find and execute a file with the extension .m (that is, an M-file). The template make file (or an M-file that returns a template make file) must be on the MATLAB path. To determine whether the file is on the MATLAB path, enter the following command in the MATLAB Command Window:
which tmf_filename
![]() | Choosing and Configuring a Compiler | Initiating the Build Process | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |