How can I build a Simulink model that includes a S-function built from multiple source files?

2 views (last 30 days)
I have an issue with building a Simulink model that includes my own S-functions. Inside one of the S-functions (namely, mySfun1.c), it calls the function 'solve', which is declared and defined in other C files (namely, auxFun1.c and auxFun2.c). I built a MEX-file from 'mySfun1.c' with the following statement.
mex mySfun1.c auxFun1.c auxFun2.c
Also, another MEX-file from the other S-function (namely, mySfun2.c), which doesn't refer to any other source files, was built through the statement below.
mex mySfun2.c
Then, I tried to build the whole Simulink model that includes the above two S-functions. Almost at the end of the building process (the process that compiles lots of C files), the following error occurred and the process stopped.
OPUS MAKE: Don't know how to make 'auxFun1.m03'.
My Simulink model is running under the multiple tasking mode, and I know that .m03-files are object files necessary for the multiple tasking mode and it seems that the .m03-files for my S-functions are automatically generated while building the model. Actaully, 'mySfun2.m03' was created without a problem.
But what I don't understand is why Matlab also tries to make the .m03-file for 'auxFun1.c', which is just one of the auxiliary files for 'mySfun1.c'. In my understanding, the MEX-file of 'mySfun1.c' already has all information about 'auxFun1.c' and 'auxFun2.c' through the 'mex' command.
Is there anything obvious that I am missing in the building procedure?
Thanks in advance.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!