Eclipse Macros

Eclipse provides various macros which can be accessed within the project settings or pre/post-build steps. One use-case is to use some of the macros to make the Eclipse projects portable.

File-specific macros

The set of file-context macros is predefined by the Managed Build System (MBS). Neither a tool-integrator nor a user can define new file-context macros.

${InputFileName}

Represents the input file name.

${InputFileExt}

Represents the extension of the input file.

${InputFileBaseName}

Represents the base name of the input file. That is the file name with an extension stripped.

${InputFileRelPath}

Represents the input file path relative to the builder current directory.

${InputDirRelPath}

Represents the input file directory path relative to the builder current directory.

${OutputFileName}

Represents the output file name.

${OutputFileExt}

Represents the output file extension.

${OutputFileBaseName}

Represents the output file base name. That is the output file name with an extension stripped.

${OutputFileRelPath}

Represents the output file path relative to the current builder directory.

${OutputDirRelPath}

Represents the output file directory path relative to the current builder directory.

Configuration-specific macros

${ConfigName}

Represents the name of a given configuration.

${ConfigDescription}

Represents the description of a given configuration.

${BuildArtifactFileName}

Represents the name of the build artifact.

${BuildArtifactFileExt}

Represents the extension of the build artifact.

${BuildArtifactFileBaseName}

Represents the base name of the build artifact.

${BuildArtifactFilePrefix}

Represents the prefix of the build artifact.

${TargetOsList}

Represents the list of the target OS names.

${TargetArchList}

Represents the list of the target Arch names.

Project-specific macros

${ProjName}

Represents the name of a given project.

${ProjDirPath}

Represents the absolute path of a given project.

${HtcActiveToolchain}

Represent the path to the active toolchain.

${HtcArchToolPref}

Represents the active toolchain architecture name as follows:

Architecture Macro value

ARM-LLVM

arm-llvm

ARM-GNU

arm-elf

AURIX/TriCore

tricore

AURIX/TriCore-LLVM

tricore-llvm

PowerPC

ppc-vle

MCS

mcs

SCR

scr

${HtcDynamicBuildToolPath}

Represent both resolved/unresolved path to the active toolchain. See How to set build toolchain path chapter for more details.

Workspace-specific macros

${WorkspaceDirPath}

Represents the workspace absolute path.

${DirectoryDelimiter}

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}

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 definition

CDT/Eclipse installation-specific macros

${EclipseVersion}

Represents the current Eclipse version.

${CDTVersion}

Represents the current CDT version.

${MBSVersion}

Represents the current MBS version.

${HostOsName}

Represents the operating system name on which eclipse is running.

${HostArchName}

Represents the architecture name on which eclipse is running.