User`s guide

2 Getting Started with the Real-Time Workshop
2-10
the Real-Time Workshop page. Finally, if the host on which you are running
matches the
HOST macro specified in the template makefile, make is invoked to
create a program from the generated code. See Chapter 3, “Code Generation
and the Build Process,” for more information on the build process.
Template Makefiles
The Real-Time Workshop uses template makefiles to build an executable from
the generated code. By convention, a template makefile has an extension of
.tmf and a name corresponding to your target. For example grt_unix.tmf is
the generic real-time template makefile for UNIX.
A makefile is created from the template makefile by copying each line from the
template makefile, expanding tokens into the makefile. See “Template
Makefiles” on page 3-23 for more information about template makefiles and
expandable tokens. The name of the makefile created is
model.mk.The
model.mk file is then passed to a make utility, which is a utility that builds an
executable from a set of files. The
make utility performs date checking on the
dependencies between the object and C files and rebuilds the object files if
needed.
Template Makefile Configuration
You can configure the build process by modifying the template makefile. You
can do this by copying it to your local working directory and editing it.
Alternatively, you can configure the template makefile’s operation, by
specifying build options to the
make_rtw command.
For example, in the Real-Time Workshop page of the Simulation
Parameters dialog box, you can turn debugging symbols on for the
grt_unix.tmf by specifying the build command as:
make_rtw OPT_OPTS=g
The comment section of the template makefiles distributed by The MathWorks
includes some helpful hints about common build options.
Specifying Model Parameters
You modify the model parameters that control aspects of the simulation, such
as start and stop time, by altering the fields of the Simulation Parameters
dialog box. The simulation parameters are used directly for code generation