MATLAB: What source file names should be included in the “sources” field when creating the rtwmakecfg.m function file to include custom source file information for the S-functions in the Real-Time Workshop build process

simulink coder

The documentation for "creating rtwmakecfg.m MATLAB file function" suggests that the sources field of the makeinfo structure should contain additional source file names, but does not clarify whether we need to include the names of the S-function source files.

Best Answer

This enhancement has been incorporated in Release 2008a (R2008a).
In the rtwmakecfg.m M_file function, you should not include the S-function source file names in the "sources" field of the makeinfo structure. You need to include only the additional source file names that are required by your S-functions.
However the "sourcepath" field must include the location of the S-function source files. Further, the rtwmakecfg.m file should reside where the mex file (s-function.mexext) resides.