Stateflow User's Guide Previous page   Next Page

How Does Stateflow Build into Targets?

This topic give you information on how Stateflow blocks contribute to the building of targets in the following steps:

  1. Stateflow parses the charts in the model to ensure that their logic is valid.
  2. If any errors are found, Stateflow displays the errors in the Build window and halts. See Parsing Stateflow Diagrams for more details.
  3. If the charts parse without error, Stateflow Coder generates C code from the charts.
  1. The code generator accepts various options that control the code generation process. You specify these options when you configure Stateflow for targets.

  1. Stateflow Coder generates a makefile to build the generated source code into an executable program.
  1. The generated makefile can optionally build custom code that you specify into the target. See Integrating Custom Code with Stateflow Targets for details.

  1. The specified C compiler for MATLAB and a make utility build the code into an application for the target.
  1. Building Simulink targets requires a C compiler that is supported by MATLAB. The Microsoft Windows version of Stateflow comes with a C compiler (lcc.exe) and a make utility (lccmake). Both tools are installed in the directory matlabroot\sys\lcc. If you do not configure MATLAB to use any other compiler, Stateflow uses lcc to build targets. For details on setting up your own C compiler, see Setting Up Your Own Target Compiler


Previous page  How Do You Build a Target? Adding a Stateflow Target Next page

© 1994-2005 The MathWorks, Inc.