Main Content

setCommandPattern

Class: coder.make.BuildTool
Namespace: coder.make

Set pattern of commands for build tools

Syntax

h.setCommandPattern(commandpattern);

Description

h.setCommandPattern(commandpattern); sets the command pattern of a specific coder.make.BuildTool object in coder.make.ToolchainInfo.BuildTools.

Input Arguments

expand all

Object handle for a coder.make.BuildTool object, specified as a variable.

Example: tool

Pattern of commands and options that a BuildTool can use to run a build tool, specified as a character vector.

Use |> and <| as the left and right delimiters of a command element. Use a space character between the <| and |> delimiters to require a space between two command elements. For example:

  • |>TOOL<| |>TOOL_OPTIONS<| requires a space between the two command elements.

  • |>OUTPUT_FLAG<||>OUTPUT<| requires no space between the two command elements.

Data Types: char

Examples

The intel_tc.m file from Add Custom Toolchains to MATLAB® Coder™ Build Process, uses the following lines to get and update one of the BuildTool objects, including the command pattern:

% ------------------------------
% C Compiler
% ------------------------------
 
tool = tc.getBuildTool('C Compiler');

tool.setName('Intel C Compiler');
tool.setCommand('icl');
tool.setPath('');

tool.setDirective('IncludeSearchPath','-I');
tool.setDirective('PreprocessorDefine','-D');
tool.setDirective('OutputFlag','-Fo');
tool.setDirective('Debug','-Zi');

tool.setFileExtension('Source','.c');
tool.setFileExtension('Header','.h');
tool.setFileExtension('Object','.obj');

tool.setCommandPattern('|>TOOL<| |>TOOL_OPTIONS<| |>OUTPUT_FLAG<||>OUTPUT<|');

Version History

Introduced in R2013a