MATLAB Compiler    
mbuild

Compile and link source files that call functions in the MATLAB C/C++ Math Library or MATLAB C/C++ Graphics Library into a stand-alone executable or shared library

Syntax

Description

mbuild is a script that supports various options that allow you to customize the building and linking of your code. Table 7-1, mbuild Options, lists the mbuild options. If no platform is listed, the option is available on both UNIX and Microsoft Windows.

Table 7-1: mbuild Options  
Option
Description
-<arch>
(UNIX) Assume local host has architecture <arch>. Possible values for <arch> include sol2, hpux, hp700, alpha, ibm_rs, sgi, and glnx86.
@<response_file>
(Windows) Replace @<response_file> on the mbuild command line with the contents of the text file, response_file.
-c
Compile only. Do not link. Creates an object file but not an executable.
-D<name>
Define a symbol name to the C/C++ preprocessor. Equivalent to a #define <name> directive in the source.
-D<name>#<value>
Define a symbol name and value to the  C/C++ preprocessor. Equivalent to a #define <name> <value> directive in the source.
-D<name>=<value>
(UNIX) Define a symbol name and value to the C preprocessor. Equivalent to a #define <name> <value> directive in the source.
-f <<optionsfile>>
Specify location and name of options file to use. Overrides the mbuild default options file search mechanism.
-g
Create a debuggable executable. If this option is specified, mbuild appends the value of options file variables ending in DEBUGFLAGS with their corresponding base variable. This option also disables the mbuild default behavior of optimizing built object code.
-h[elp]
Help; prints a description of mbuild and the list of options.
-I<pathname>
Add <pathname> to the list of directories to search for #include files.
-inline
Inline matrix accessor functions (mx*). The generated executable may not be compatible with future versions of the MATLAB C/C++ Math Library or MATLAB C/C++ Graphics Library.
-l<name>
(UNIX) Link with object library lib<name>.
-L<directory>
(UNIX) Add <directory> to the list of directories containing object-library routines.
-lang <language>
Specify compiler language. <language> can be c or cpp. By default, mbuild determines which compiler (C or C++) to use by inspection of the source file's extension. This option overrides that mechanism. This option is necessary when you use an unsupported file extension, or when you pass in all .o files and libraries.
-n
No execute mode. Print out any commands that mbuild would execute, but do not actually execute any of them.
-nohg
Do not link against the MATLAB C/C++ Graphics Library (Handle Graphics).
-O
Optimize the object code by including the optimization flags listed in the options file. If this option is specified, mbuild appends the value of options file variables ending in OPTIMFLAGS with their corresponding base variable. Note that optimizations are enabled by default, are disabled by the -g option, but are reenabled by -O.
-outdir <dirname>
Place any generated object, resource, or executable files in the directory <dirname>. Do not combine this option with -output if the -output option gives a full pathname.
-output <resultname>
Create an executable named <resultname>. An appropriate executable extension is automatically appended. Overrides the mbuild default executable naming mechanism.
-regsvr
(Windows) Use the regsvr32 program to register the resulting shared library at the end of compilation. The Compiler uses this option whenever it produces a COM wrapper file.
-setup
Interactively specify the compiler options file to use as default for future invocations of mbuild by placing it in <UserProfile>\Application Data\MathWorks\MATLAB\R13 (Windows) or $HOME/.matlab/R13 (UNIX). When this option is specified, no other command line input is accepted.
-U<name>
Remove any initial definition of the C preprocessor symbol <name>. (Inverse of the -D option.)
-v
Verbose; Print the values for important internal variables after the options file is processed and all command line arguments are considered. Prints each compile step and final link step fully evaluated to see which options and files were used. Very useful for debugging.
<name>=<value>
(UNIX) Override an options file variable for variable <name>. If <value> contains spaces, enclose it in single quotes, e.g., CFLAGS='opt1 opt2'. The definition, <def>, can reference other variables defined in the options file. To reference a variable in the options file, prepend the variable name with a $, e.g., CFLAGS='$CFLAGS opt2'.
<name>#<value>
Override an options file variable for variable <name>. If <def> contains spaces, enclose it in single quotes, e.g., CFLAGS='opt1 opt2'. The definition, <def>, can reference other variables defined in the options file. To reference a variable in the options file, prepend the variable name with a $, e.g., CFLAGS='$CFLAGS opt2'.


  mbvector mcc