Main Content
setFileExtension
Class: coder.make.BuildTool
Namespace: coder.make
Set file extension for named file type in FileExtensions
Syntax
h.setFileExtension(name,value)
Description
sets the extension value of the named file type in h
.setFileExtension(name
,value
)coder.make.BuildTool.FileExtensions
.
Input Arguments
Examples
Get a Default Build Tool and Set Its Properties
The following example code shows setFileExtension
in a portion of the
intel_tc.m
file from the Add Custom Toolchains to MATLAB® Coder™ Build Process tutorial.
% ------------------------------ % 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<|');
Use the setFileExtension Interactively
tc = coder.make.ToolchainInfo; tool = tc.getBuildTool('C Compiler'); blditm = coder.make.BuildItem('CD','.cd')
bldtm = Macro : CD Value : .cd
tool.addFileExtension('SourceX',blditm) value = tool.getFileExtension('SourceX')
value = .cd
tool.setFileExtension('SourceX','.ef') value = tool.getFileExtension('SourceX')
value = .ef
Version History
Introduced in R2013a