User`s guide

4 Stand-Alone Applications
4-32
The -m option flag causes the MATLAB Compiler to generate C source code
suitable for stand-alone applications. For example, the MATLAB Compiler
generates C source code files
main.c, main_main.c,andmrank.c. main_main.c
contains a C function named main; main.c and mrank.c contain a C functions
named
mlfMain and mlfMrank.(The-c option flag inhibits invocation of
mbuild.)
To build an executable application, you can use
mbuild to compile and link
thesefiles. Or, you can automate the entirebuildprocess (invoke the MATLAB
Compiler twice, use
mbuild to compile the files withyour ANSI C compiler, and
link the code) by using the command
mcc -m main mrank
This figure illustrat es the process of build ing a stand-alone C application from
twoM-files.Thecommandstocompileandlinkdependontheoperatingsystem
being used. Se e “Building Stand-Alone C/C++ Applications” on page 4-5 for
details.