We're generating code from Simulink using our own custom target which is based on the ERT target. Often, we like to create a ZIP of our generated code (and all necessary files for compilation) that can be provided to another team who might not have MATLAB (or the same version) installed on their system.
In our target, we create our own "main" source file and function to wrap the functions (e.g., init, output, etc.) in the generated <model_name>.c source file. However, when we use the packaging routines, we've found that it always seems to include the rt_main.c or ert_main.c (depending upon which version of MATLAB is used) source files from the MATLAB_ROOT directory. This file isn't needed nor used in the compilation as we have our own. We have already turned off the option to generate example main function (setting the Configuration Parameters > Code Generation > Templates > Generated an example main program parameter value to 'off').
I've looked in the buildInfo, and found that the rt_main.c or ert_main.c source files are listed automatically. Is there a way to disable these from being included?
Best Answer