User`s guide

5 Controlling Code Generation
5-26
-B csharedlib:libtimefun
with
-t -W lib:libtimefun -T link:lib -h libmmfile.mlib
giving the new statement
mcc -t -W lib:libtimefun -T link:lib -h libmmfile.mlib weekday data tic calendar toc
The -t option tells the Compiler to generate C code from each of the listed
M-files. The
-T link:lib option tells the Compiler to compile and link a shared
library. The
-h option tells the Compiler to include any other M-functions
called from those listed on the
mcc command line, i.e., helper functions.
Note You can use the -B option with a replacement expression as is at the
DOS or UNIX prompt. To use
-B with a replacement expression at the
MATLAB prompt, you must enclose the expression that follows the
-B in
single quotes when there is more than one parameter passed. For example,
>>mcc -B csharedlib:libtimefun weekday data tic calendar toc
can be used as is at the MATLAB prompt because libtimefun is the only
parameter being passed. If the example had two or more parameters, then the
quotes would be necessary as in
>>mcc -B 'cexcel:component,class,1.0' weekday data tic calendar toc
mlib Files
Shared libraries, like libraries, let you compile a common set of functions once
and then compile other M-functions that depend on them without compiling
them again.You accomplish this using
mlib files, which are automatically
generated when you generate the shared library.
Creating an mlib File. When you create a library wrapper file, you also get a .mlib
file with the same base name. For example,
mcc -W lib:libtimefun -L C -t -T link:lib -h weekday date tic calendar toc
creates