Simplify Compilation Using Macros
mcc function, through its exhaustive
set of options, allows you to customize the behavior of a compiled component. If you want a
simplified approach to compilation, you can use a macro to quickly
accomplish basic compilation tasks. Macros let you group several options together to perform
a particular type of compilation.
This table shows the relationship between the macro approach to accomplish a standard compilation and the multioption alternative.
Working With Macros
-m option tells the compiler to produce a standalone application.
-m macro is equivalent to the series of options
-W main -T link:exe
This table shows the options that compose the
-m macro and the
information that they provide to the compiler.
Produce a wrapper file suitable for a standalone application.
Create an executable link as the output.
You can change the meaning of a macro by editing the corresponding
macro_option file in
example, to change the
-m macro, edit the file
macro_option_m in the
This changes the meaning of
-m for all users of this MATLAB® installation.
Specifying Default Macros
MCCSTARTUP functionality has been replaced by bundle
macro_default file that resides in
toolbox\compiler\bundles can be used to specify default options to
For example, adding
-mv to the
file causes the command:
mcc -mv foo.m
macro_defaultfile causes the command:
mcc -W 'lib:libfoo' -T link:lib foo.m
mcc -v -W 'lib:libfoo' -T link:lib foo.m