Build Macros
A list of available Build Macros (variables) can be found by
- selecting the project
- opening its properties
- Select C/C++ Build
- Click on Build Variables
- ensure Show system variables is checked
A useful subset of the available Build Macros includes:
Macro
Meaning
${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.
${TargetChip}
Represents the name of the MCU, for example LPC1768.
${TargetProc}
Represents the name of the CPU, for example cortex-m3.
${TargetVendor}
Represents the name of the vendor, for example NXP.
${env_var:ENV_VAR}
Replaces the macro with the value of the environment variable ENV_VAR
Usage
These are typically used in Pre- and Post- Build steps. For example, a Post-Build step to copy the built file to a fixed location:
cp ${BuildArtifactFileName} c:\temp;Another example is to convert the executable file into a binary file:
arm-none-eabi-objcopy -O binary ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin ;
Links
More information can be found on Build Macros can be found at: http://publib.boulder.ibm.com/infocenter/rsahelp/v7r0m0/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_mprop_macros.htm
