User`s guide

2 Building an Application
2-10
You want to inspect the generated code. Is Real-Time Workshop generating
what you expect?
You need to integrate custom handwritten code.
You want to experiment with configuration option settings.
You specify code generation only by selecting the
Generate code only option
available on the
Real-Time Workshop pane of the Configuration
Parameters
dialog (thus changing the label of the Build button to Generate
code
). Real-Time Workshop responds to clicking this button by analyzing the
block diagram that represents your model, generating C code, and placing the
resulting files in a build directory within your current working directory.
After generating the code, inspect it. Is it what you expected? If not,
determine what model and configuration changes you need to make, rerun
the Model Advisor, and regenerate the code. When you are satisfied with the
generated code, build an executable program image, as explained in “Building
an Executable Program Image” on page 2-10.
For a more detailed discussion of the code generation process, see “Automatic
Program Building” on page 2-13 and “The Build Process” on page 2-15.For
details on the
Generate code only option, see “Generate Code Only” in the
Real-Time Workshop User’s Guide documentation.
Building an Executable Program Image
When you are satisfied with the code Real-Time Workshop generates for your
model, build an executable image. If it is currently selected, you need to clear
the
Generate code only option on the Real-Time Workshop pane of the
Configuration Parameters dialog. This changes the label of the Generate
code
button back to Build. One way of initiating a build is to click the Build
button. Real-Time Workshop responds by
1 Generating the C code as explained in “Generating Code” on page 2-9.
2 Creating a customized makefile based on a template makefile for your
target of choice and placing the makefile in the build directory.
3 Instructing your system’s make utility to use the generated makefile to
compile the generated source code, link object files and libraries, and
generate an executable program file called
model or model.exe. The
executable image resides in your working directory.