Template Makefiles and Make Options - MATLAB & Simulink (original) (raw)

Main Content

The code generator includes a set of built-in template makefiles that build programs for specific system target files.

Types of Template Makefiles

There are two types of template makefiles:

For details on the structure of template makefiles, see Customize Template Makefiles. This section describes compiler-specific template makefiles and common options you can use with each.

Specify Template Makefile Options

You can specify template makefile options through the Make command configuration parameter. Append the options aftermake_rtw (or other make command), as in the following example:

make_rtw OPTS="-DMYDEFINE=1"

The syntax for make command options differs slightly for different compilers.

Note

To control compiler optimizations for a makefile build, use the configuration parameter, which provides:

If you specify compiler options for your makefile build usingOPT_OPTS, MEX_OPTS (exceptMEX_OPTS="-v"), or MEX_OPT_FILE, the value of Compiler optimization level is ignored and a warning is issued about the ignored parameter.

Template Makefiles for UNIX Platforms

The template makefiles for UNIX® platforms are for the Free Software Foundation's GNU® Make. These makefiles conform to the guidelines specified in the IEEE®1 Std 1003.2-1992 (POSIX) standard:

You can supply options to makefiles through the Make command configuration parameter. Options specified in Make command are passed to the command-line invocation of the make utility, which adds them to the overall flags passed to the compiler. The following options can be used to modify the behavior of the build:

These options are also documented in the comments at the head of the respective template makefiles.

Template Makefiles for the Microsoft Visual C++ Compiler

To build an executable file using the Visual C++ compiler, use one of the_`target`__vcx64.tmf template makefiles:

You can supply options to makefiles through the Make command configuration parameter. Options specified in Make command are passed to the command-line invocation of the make utility, which adds them to the overall flags passed to the compiler. The following options can be used to modify the behavior of the build:

These options are also documented in the comments at the head of the respective template makefiles.

See Also

Topics

External Websites


1 IEEE is a registered trademark of The Institute of Electrical and Electronics Engineers, Inc.