MATLAB: Do I get an error when I try to generate code for the tornado target when the model contains a referenced model in Real-Time Workshop 7.0 (R2007b)

simulink coder

My model contains a model reference block and when I try to build for the tornado target I get the error message:
Error using ==> genMakefileAndBuild at 875
### Model Reference requires the makefile to support compilation. Consider updating makefile:'Mathworks_2007b/rtw/c/tornado/tornado.tmf' or selecting 'Generate code only'

Best Answer

The TLC file that we ship with MATLAB for the tornado target does not, by default, support model referencing. We do, however, provide an example template makefile for the tornado target that will allow you to use model referencing with the RTW Embedded Coder.
To get build successfully change the the system target file to 'ert.tlc' in the Configuration Parameters dialog window, then change the template makefile to 'ert_tornado.tmf' in the same window.
Note that you will need to do this for all models in the hierarchy.
There is a documentation section titled "Supporting Model Referencing" in the Real-Time Workshop Embedded coder docs that explains, in detail, how to create a custom target that supports model referencing.