IAR參數變量
您可以為路徑和參數使用參數變量,例如,當您在選項對話框中指定include路徑時,或者當需要基於當前上下文的類似宏的擴展時,例如在工具的參數中。您可以使用廣泛的預定義參數變量以及創建自己的參數變量,請參見配置自定義參數變量對話框。這些是預定義的參數變量:
變量 | 描述 |
---|---|
$COMPILER_ARGS$ | 除了在編譯使用編譯器時使用的文件名之外,所有編譯 |
$CONFIG_NAME$ | 當前構建配置的名稱,例如Debug或者Release. |
$CUR_DIR$ | 當前目錄 |
$CUR_LINE$ | 當前行 |
$DATE$ | 今天的日期 |
$EW_DIR$ | IAR Embedded Workbench的目錄, 例如:c:\program files\iar systems\embedded workbench 6.n |
$EXE_DIR$ | 可執行文件輸出目錄 |
$FILE_BNAME$ | 活動文件名(不帶文件擴展類型) |
$FILE_BPATH$ | 活動文件路徑+文件名(不帶文件擴展類型) |
$FILE_DIR$ | 活動文件路徑(不帶文件名) |
$FILE_FNAME$ | 活動文件名(帶擴展類型) |
$FILE_PATH$ | 活動文件路徑 (在編輯器、項目或消息窗口中) |
$LIST_DIR$ | List輸出目錄 |
$OBJ_DIR$ | Obj輸出目錄 |
$PROJ_DIR$ | 工程目錄 |
$PROJ_FNAME$ | 項目文件名 |
$PROJ_PATH$ | 項目文件的完整路徑 |
$TARGET_DIR$ | 主輸出文件的目錄 |
$TARGET_BNAME$ | 主輸出文件名(不帶文件擴展類型) |
$TARGET_BPATH$ | 主輸出文件路徑+文件名(不帶文件擴展類型) |
$TARGET_FNAME$ | 主輸出文件名(帶擴展類型) |
$TARGET_PATH$ | 主輸出文件的完整路徑 |
$TOOLKIT_DIR$ | 活動產品目錄,例如:c:\program files\iar systems\embedded workbench 7.n\arm |
$USER_NAME$ | 您的主機登錄名 |
$_ENVVAR_$ | Windows環境變量ENVVAR. $_和_$內的任何名稱將擴展到該系統環境變量。 |
$MY_CUSTOM_VAR$ | 您自己的參數變量,參見配置自定義參數變量對話框。$和$中的任何名稱都將擴展到您定義的值。 |
參數變量還可以在IDE選項對話框中的一些頁面上使用,參見工具菜單。
您可以對路徑和參數使用參數變量,例如在“選項”對話框中指定包含路徑時,或者需要依賴於當前上下文的宏類擴展,例如在工具的參數中。您可以使用各種預定義的參數變量以及創建自己的參數,請參閱配置自定義參數變量對話框。這些是預定義的參數變量:
Variable | Description |
---|---|
$COMPILER_ARGS$ |
All compiler options except for the filename that is used when compiling using the compiler. Note that this argument variable is restricted to the Arguments text box in the External Analyzer dialog box.所有編譯器選項,除了使用編譯器編譯時使用的文件名。請注意,此參數變量僅限於“外部分析器”對話框中的“參數”文本框。 |
$CONFIG_NAME$ |
The name of the current build configuration, for example Debug or Release.所有編譯器選項,除了使用編譯器編譯時使用的文件名。請注意,此參數變量僅限於“外部分析器”對話框中的“參數”文本框。 |
$CUR_DIR$ |
Current directory.當前目錄 |
$CUR_LINE$ |
Current line當前行 |
$DATE$ |
Today’s date今天的日期 |
$EW_DIR$ |
Top directory of IAR Embedded Workbench, for example c:\Program Files\IAR Systems\Embedded Workbench N.n IAR Embedded Workbench的頂級目錄,例如c:\ Program Files \ IAR Systems \ Embedded Workbench N.n |
$EXE_DIR$ |
Directory for executable output可執行輸出目錄 |
$FILE_BNAME$ |
Filename without extension無擴展名的文件名 |
$FILE_BPATH$ |
Full path without extension全路徑無延伸 |
$FILE_DIR$ |
Directory of active file, no filename靈活文件目錄,無文件名 |
$FILE_FNAME$ |
Filename of active file without path沒有路徑的活動文件的文件名 |
$FILE_PATH$ |
Full path of active file (in Editor, Project, or Message window)活動文件的完整路徑(在編輯器,項目或消息窗口中) |
$LIST_DIR$ |
Directory for list output列表輸出目錄 |
$OBJ_DIR$ |
Directory for object output目標輸出目錄 |
$PROJ_DIR$ |
Project directory項目目錄 |
$PROJ_FNAME$ |
Project filename without path沒有路徑的項目文件名 |
$PROJ_PATH$ |
Full path of project file項目文件的完整路徑 |
$TARGET_DIR$ |
Directory of primary output file主輸出文件目錄 |
$TARGET_BNAME$ |
Filename without path of primary output file and without extension文件名無路徑的主輸出文件,無擴展名 |
$TARGET_BPATH$ |
Full path of primary output file without extension主要輸出文件的完整路徑,無需擴展 |
$TARGET_FNAME$ |
Filename without path of primary output file沒有主輸出文件路徑的文件名 |
$TARGET_PATH$ |
Full path of primary output file主輸出文件的完整路徑 |
$TOOLKIT_DIR$ |
Directory of the active product, for example c:\Program Files\IAR Systems\Embedded Workbench N.n\arm活動產品的目錄,例如c:\ Program Files \ IAR Systems \ Embedded Workbench N.n \ arm |
$USER_NAME$ |
Your host login name您的主機登錄名 |
$WS_DIR$ |
The active workspace directory (only available in the IDE, not when using iarbuild.exe or cspybat.exe)活動工作區目錄(僅在IDE中可用,而不是使用iarbuild.exe或cspybat.exe時) |
$_ENVVAR_$ |
The Windows environment variable ENVVAR. Any name within $_ and _$ will be expanded to that system environment variable.Windows環境變量ENVVAR。 $ _ 和_ $ 中的任何名稱都將擴展到該系統環境變量。 |
$MY_CUSTOM_VAR$ |
Your own argument variable, see Configure Custom Argument Variables dialog box. Any name within $ and $ will be expanded to the value you have defined.您自己的參數變量,請參閱配置自定義參數變量對話框。 和和中的任何名稱將被擴展為您定義的值。 |
在IAR中的help中輸入argument variables時會找到這樣的一個列表:
Variable
|
Description
|
$CONFIG_NAME$
|
The name of the current build configuration, for example Debug or Release.
|
$CUR_DIR$
|
Current directory //當前目錄
|
$CUR_LINE$
|
Current line //當前行
|
$DATE$
|
Today’s date
|
$EW_DIR$
|
Top directory of IAR Embedded Workbench, for example
c:\program files\iar systems\embedded workbench 6.n //EW的安裝目錄
|
$EXE_DIR$
|
Directory for executable output //可執行文件的輸出目錄
|
$FILE_BNAME$
|
Filename without extension //無擴展名文件
|
$FILE_BPATH$
|
Full path without extension //無擴展名全部路徑
|
$FILE_DIR$
|
Directory of active file, no filename //當前活動文件目錄,不包含文件名
|
$FILE_FNAME$
|
Filename of active file without path //當前活動文件,不包含路徑
|
$FILE_PATH$
|
Full path of active file (in Editor, Project, or Message window) //當前活動文件的完整路徑
|
$LIST_DIR$
|
Directory for list output //列表文件的輸出路徑
|
$OBJ_DIR$
|
Directory for object output //目標文件輸出路徑
|
$PROJ_DIR$
|
Project directory //工程目錄
|
$PROJ_FNAME$
|
Project filename without path //工程名稱 不包含路徑
|
$PROJ_PATH$
|
Full path of project file //工程文件的完整路徑
|
$TARGET_DIR$
|
Directory of primary output file //主輸出文件路徑
|
$TARGET_BNAME$
|
Filename without path of primary output file and without extension //無主輸出文件目錄,無擴展名的文件名
|
$TARGET_BPATH$
|
Full path of primary output file without extension //無擴展名的主輸出文件的完整路徑
|
$TARGET_FNAME$
|
Filename without path of primary output file //無路徑的主輸出文件名
|
$TARGET_PATH$
|
Full path of primary output file //主輸出文件的完整路徑
|
$TOOLKIT_DIR$
|
Directory of the active product, for example
c:\program files\iar systems\embedded workbench 6.n\arm //已激活的開發環境的目錄
|
$USER_NAME$
|
Your host login name
|
$_ENVVAR_$
|
The environment variable
ENVVAR. Any name within $_ and _$ will be expanded to that system environment variable.
|
You can use argument variables for paths and arguments, for example when you specify
include paths in the Options dialog box. These are the available argument variables:
$COMPILER_ARGS$ All compiler options except for the filename that is used when compiling using the compiler. Note that this argument variable is restricted to the Arguments text box in the External Analyzer dialog box. $CONFIG_NAME$ The name of the current build configuration, for example Debug or Release. $CUR_DIR$ Current directory $CUR_LINE$ Current line $DATE$ Today’s date $EW_DIR$ Top directory of IAR Embedded Workbench, for example c:\program files\iar systems\embedded workbench 6.n $EXE_DIR$ Directory for executable output $FILE_BNAME$ Filename without extension $FILE_BPATH$ Full path without extension $FILE_DIR$ Directory of active file, no filename $FILE_FNAME$ Filename of active file without path $FILE_PATH$ Full path of active file (in Editor, Project, or Message window) $LIST_DIR$ Directory for list output $OBJ_DIR$ Directory for object output $PROJ_DIR$ Project directory $PROJ_FNAME$ Project filename without path $PROJ_PATH$ Full path of project file $TARGET_DIR$ Directory of primary output file $TARGET_BNAME$ Filename without path of primary output file and without extension $TARGET_BPATH$ Full path of primary output file without extension $TARGET_FNAME$ Filename without path of primary output file $TARGET_PATH$ Full path of primary output file $TOOLKIT_DIR$ Directory of the active product, for example c:\program files\iar systems\embedded workbench 6.n\arm $USER_NAME$ Your host login name $_ENVVAR_$ The environment variable ENVVAR. Any name within
$COMPILER_ARGS$
All compiler options except for the filename that is used when compiling using the compiler.
Note that this argument variable is restricted to the Arguments text box in the External Analyzer dialog box.
$CONFIG_NAME$
The name of the current build configuration, for example Debug or Release.
$CUR_DIR$
Current directory
$CUR_LINE$
Current line
$DATE$
Today’s date
$EW_DIR$
Top directory of IAR Embedded Workbench, for example c:\Program Files\IAR Systems\Embedded Workbench N.n
$PROJ_DIR$
Project directory
$EXE_DIR$
Directory for executable output
$LIST_DIR$
Directory for list output
$OBJ_DIR$
Directory for object output
$FILE_BNAME$
Filename without extension
$FILE_BPATH$
Full path without extension
$FILE_DIR$
Directory of active file, no filename
$FILE_FNAME$
Filename of active file without path
$FILE_PATH$
Full path of active file (in editor, project, or message window)
$PROJ_FNAME$
Project filename without path
$PROJ_PATH$
Full path of project file
$TARGET_DIR$
Directory of primary output file
$TARGET_BNAME$
Filename without path of primary output file and without extension
$TARGET_BPATH$
Full path of primary output file without extension
$TARGET_FNAME$
Filename without path of primary output file
$TARGET_PATH$
Full path of primary output file
$TOOLKIT_DIR$
Directory of the active product, for example c:\Program Files\IAR Systems\Embedded Workbench N.n\arm
$USER_NAME$
Your host login name
$WS_DIR$
The active workspace directory (only available in the IDE, not when using iarbuild.exe or cspybat.exe)
$_ENVVAR_$
The Windows environment variable ENVVAR. Any name within $_ and _$ will be expanded to that system environment variable.
$MY_CUSTOM_VAR$
Your own argument variable, see Configure Custom Argument Variables dialog box, page 87.
Any name within $ and $ will be expanded to the value you have defined.
The Configure Custom Argument Variables dialog box is available from the Tools menu.
Use this dialog box to define and edit your own custom argument variables.
Typically, this can be useful if you install a third-party product and want to specify its include directory by using argument variables.
Custom argument variables can also be used for simplifying references to files that you want to be part of your project.
Custom argument variables have one of two different scopes:
● Workspace-local variables, which are associated with a specific workspace
and can only be seen by the workspace that was loaded when the variables were created.
● Global variables, which are available for use in all workspaces
You can organize your variables in named groups