Stateflow    

How Stateflow Builds Targets

Stateflow builds a target for its diagrams as follows:

  1. Stateflow parses the charts that represent the Stateflow machine to ensure that the machine's logic is valid.
  2. If any errors are found, Stateflow displays the errors in the MATLAB Command Window (see Parsing Stateflow Diagrams) and halts.
  3. If the charts parse without error, Stateflow next invokes a code generator to convert the charts in the Stateflow machine into C source code.
  1. The code generator accepts various options that control the code generation process. You can specify these options via the Stateflow user interface (see Adding a Target to a Stateflow Machine).

  1. The code generator 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 Diagrams).

  1. Stateflow builds the target using a C compiler and make utility that you specify (see Setting Up the Target Compiler for more information).

  Building a Target Setting Up the Target Compiler