Name of the build macro
Type of value contained in the build macro (see below)
Value of the build macro.
You can view all build macros that are not user-defined in the System Macros table. You can choose to also display all macros defined for lower-precedence contexts in the System Macros table by checking the Show parent context macros checkbox.
You can view all user-defined macros in the User Macros table. A user-defined macro overrides a non user-defined macro of the same name for the given context. Overridden macros are displayed in bold in the System Macros table.
Build Macros can be used in all C/C++ Build configuration properties that
accept text. Build Macros are referenced in strings by enclosing them in braces, preceded by a dollar sign.
There are no special restrictions on a macro name, though it is encouraged that a macro name begin with
a letter and contain only letters, digits and underscore signs. Build macro names are case sensitive.
If the actual value of text property contains ${text
Build Macros can hold several types of values:
Build Macros are context-sensitive, that is the macro of a given name could have different values depending on where it is used. Several contexts are defined:
The currently selected file.
The currently selected option
The currently selected configuration (which includes a tool-chain).
The currently selected project.
The current workspace.
The CDT and Eclipse installations.
The process environment variables defined in the environment passed to Eclipse.
Users can define new macros for any project or configuration of a project. The value of a build macro will be searched for in the order specified above. If macro is not found for the currently selected file context, the currently selected option context will be used, if not found, the currently selected configuration context will be used, etc.
Macro resolution takes place when the build file is being generated.
All macros except the build process environment macros always get resolved in the makefile. See the ??“expand build environment macros� checkbox in the “Build Settings� tab of the “C/C++ Build�.The Managed Build System pre-defines many useful macros described in the following tables:
The set of file-context macros is MBS-predefined, neither a tool-integrator nor a user can define new file-context macros, but a tool-integrator can specify the values for the file-context macros using attributes of a builder element. The macro values specified in those attributes should not contain the explicit e.g. file name, but instead should provide the filename definition in terms of the builder automatic variables and text functions. This is needed to allow the makefile generator to generate pattern rules, e.g. in the case of Gnu make, the macro that represents the output file name will contain the “$(notdir $@)? value. The builder definition of the gnu tool-chain will contain attribute specifying the value for that macro. If a tool-integrator does not provide the values for the file-specific macros, MBS will automatically expand them to their actual value when generating the buildfile, e.g. for the foo.c file the macro that represents the input file name will contain “foo.c? in this case. In this case the makefile generator will not be able to use pattern rules for building files with options containing file-specific macros. (see the “Supplying the file-context macros values? section for more detail)
Macro |
Value Type |
Description |
${InputFileName} |
Text |
Represents the input file name. The input file has the following meaning: 1. If a tool does not accept building multiple files of the primary input type with one tool invocation, the input file is the file of the primary input type being built. 2. If a tool accepts building multiple files of the primary input type with one tool invocation the input file is undefined and the macros representing the input file contain information about one of the inputs of the primary input type being built. |
${InputFileExt} |
Text |
Represents the extension of the input file. |
${InputFileBaseName} |
Text |
Represents the base name of the input file. That is the file name with an extension stripped. |
${InputFileRelPath} |
Path(File) |
Represents the input file path relative to the builder current directory. |
${InputDirRelPath} |
Path(Dir) |
Represents the input file directory path relative to the builder current directory. |
${OutputFileName} |
Text |
Represents the output file name. The output file has the following meaning: 1. If a tool is not capable of producing multiple files of the primary output type with one tool invocation the output file is the file of the primary output type that is built with a given tool invocation. 2. If a tool is capable of producing multiple files of the primary output type with one tool invocation the output file is undefined and the macros representing the output file contain information about one of the files of the primary output type that are built with a given tool invocation. |
${OutputFileExt} |
Text |
Represents the output file extension. |
${OutputFileBaseName} |
Text |
Represents the output file base name. That is the output file name with an extension stripped. |
${OutputFileRelPath} |
Path(File) |
Represents the output file path relative to the current builder directory. |
${OutputDirRelPath} |
Path(Dir) |
Represents the output file directory path relative to the current builder directory. |
Macro |
Value Type |
Description |
${ConfigName} |
Text |
Represents the name of a given configuration. |
${ConfigDescription} |
Text |
Represents the description of a given configuration. |
${BuildArtifactFileName} |
Text |
Represents the name of the build artifact. |
${BuildArtifactFileExt} |
Text |
Represents the extension of the build artifact. |
${BuildArtifactFileBaseName} |
Text |
Represents the base name of the build artifact. |
${BuildArtifactFilePrefix} |
Text |
Represents the prefix of the build artifact. |
${TargetOsList} |
Text-List |
Represents the list of the target OS names. |
${TargetArchList} |
Text-List |
Represents the list of the target Arch names. |
${ProjName} |
Text |
Represents the name of a given project. |
${ProjDirPath} |
Path(Dir) |
Represents the absolute path of a given project. |
${WorkspaceDirPath} |
Path(Dir) |
Represents the workspace absolute path. |
${DirectoryDelimiter} |
Text |
Represents the directory delimiter used on the system. That is the “\? for Win32 systems and the “/? for Unix-like systems This could be useful, e.g. in the case a user needs the absolute path of an input file. The absolute path would be represented in the following way: ${CWD}${DirectoryDelimiter}${InputFileRelPath} |
${PathDelimiter} |
Text |
Represents the default path delimiter used on the system to separate paths in the path environment variables. That is the “;? for Win32 systems and the “:? for Unix-like systems This might be used in the environment variable definitions |
${EclipseVersion} |
Text |
Represents the current eclipse version. |
${CDTVersion} |
Text |
Represents the current CDT version. |
${MBSVersion} |
Text |
Represents the current MBS version. |
${HostOsName} |
Text |
Represents the operating system name on which eclipse is running. |
${HostArchName} |
Text |
Represents the architecture name on which eclipse is running. |
C++ Project Properties, Standard, Info
C++ Project Properties, Standard, Builders
C++ Project Properties, Standard, File Types
C++ Project Properties, Standard, Include Paths and Symbols
C++ Project Properties, Standard, Indexer
C++ Project Properties, Standard, Make Builder
C++ Project Properties, Standard, Error Parser
C++ Project Properties, Standard, Binary Parser
C++ Project Properties, Standard, Discovery Options
C++ Project Properties, Standard, Source
C++ Project Properties, Standard, Output
C++ Project Properties, Standard, Projects
C++ Project Properties, Standard, Libraries
C++ Project Properties, Standard, Path Containers
C++ Project Properties, Standard, Project References
C++ Project Properties, Managed, Info
C++ Project Properties, Managed, Builders
C++ Project Properties, Managed, C/C++ Build
C++ Project Properties, Managed, C/C++ Build, Tool Settings
C++ Project Properties, Managed, C/C++ Build, Build Settings
C++ Project Properties, Managed, C/C++ Build, Build Steps
C++ Project Properties, Managed, C/C++ Build, Error Parsers
C++ Project Properties, Managed, C/C++ Build, Binary Parser
C++ Project Properties, Managed, C/C++ Build, Environment
C++ Project Properties, Managed, C/C++ Documentation
C++ Project Properties, Managed, C/C++ File Types
C++ Project Properties, Managed, C/C++ Indexer
C++ Project Properties, Managed, Project References