User`s guide
Basic Real-Time Workshop Concepts
3-5
Template Makefiles
Real-Time Workshop uses template makefiles to build an executable from the
generated code.
The Real-Time Workshop build process creates a makefile from the template
makefile. Each line from the template makefile is copied into the makefile;
tokens encountered during this process are expanded into the makefile.
The name of the makefile created by the build process is
model.mk (where
model is the name of the Simulink model). The model.mk file is passed to a
make utility, which compiles and links an executable from a set of files.
By convention, a template makefile has an extension of .
tmf and a name
corresponding to your target and compiler. For example,
grt_vc.tmf is the
template makefile for building a generic real-time program under Visual
C/C++.
You specify system target files and template makefiles using the
Real-Time
Workshop
pane of the Configuration Parameters dialog, either by typing
their filenames or choosing them with the Target File Browser. “Tutorial 1:
Building a Generic Real-Time Program” on page 3-9 introduces these
interfaces. See “Target, Documentation, and Build Options” in the Real-Time
Workshop User’s Guide for additional documentation.
The Build Process
A high-level M-file command controls the Real-Time Workshop build process.
The default command, used with most targets, is
make_rtw. When you initiate
a build, Real-Time Workshop invokes
make_rtw. The make_rtw command, in
turn, invokes the Target Language Compiler and utilities such as
make. The
build process consists of the following stages:
1 First, make_rtw compiles the block diagram and generates a model
description file,
model.rtw.
2 Next, make_rtw invokes the Target Language Compiler to generate
target-specific code, processing
model.rtw as specified by the selected
system target file.
3 Next, make_rtw creates a makefile, model.mk, from the selected template
makefile.