| |||
| Home > Configuring a Build Target > Configuring general build target options > Configuring file mappings | |||
Use the File Mappings configuration panel to associate a filename
extension, such as .c, with a plug-in tool,
such as the ARM RealView Compiler. The file mappings you define in
this panel tell the CodeWarrior IDE which tool, if any, to use to
process files with defined extensions. The default file mappings
for the ARM version of the CodeWarrior IDE depend on the:
project stationery you use to create a project
currently selected build target.
Table 10.1 shows the default file mappings for ARM stationery projects.
Table 10.1. File mappings
| Extension | File Type | Compiler | Description |
|---|---|---|---|
.c | Text | ARM RealView Compiler | C source coded file. Compiled by the RealView Compiler in ARM state for projects using ARM project stationery or Thumb® state for projects using Thumb project stationery. |
.ac | Text | ARM RealView Compiler | C source coded file. |
.tc | Text | ARM RealView Compiler | Thumb C source file |
.cc, .c++, .cpp,
or .cp | Text | ARM RealView Compiler | C++ source coded file. Compiled by the RealView Compiler in ARM state for projects using ARM project stationery, or Thumb state for projects using Thumb project stationery. |
.acpp | Text | ARM RealView Compiler | C++ source coded file |
.tcpp | Text | ARM RealView Compiler | Thumb C++ source file |
.h | Text | ARM RealView Compiler | C header file |
.hpp | Text | ARM RealView Compiler | C++ header file |
.s | Text | ARM RealView Assembler | Assembler source file |
.inc | Text | ARM RealView Assembler | Assembler include file |
.o | ARM ELF Importer | Object source file | |
.a or .lib | ARM ELF Importer | ARM library file | |
.axf | ARM ELF Importer | ARM image | |
.sym | ARM ELF Importer | A file containing symbol definitions | |
.tdv | ARM ELF Importer | Intermediate build file for a sub-project | |
.txt | Text | None | Text file |
.bat | Text | None | DOS batch command file for post linker |
.scat | Text | None | Scatter-loading description file |
File mappings determine whether the CodeWarrior IDE recognizes files in the project. If you have trouble adding files to your project, or if the CodeWarrior IDE refuses a directory or file that is dragged and dropped on the project window, check the File Mappings configuration panel to ensure that the relevant file extensions are defined.
File mappings sets are associated with the currently selected linker. If you change the selected linker, the defined list of file mappings also changes. See Configuring target settings for more information.
If you add any new file extensions that specify the ARM ELF Importer as the compiler, these are also treated as object files to be included in the link stage.
To view and modify the file mappings for a build target:
Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).
Click File Mappings in the Target Settings Panels list to display the configuration panel (Figure 10.9).
The File Mappings list contains a File Type, associated Extension, and compiler choice for each filename extension in the list. This list tells the CodeWarrior IDE which tool, if any, to invoke for files with specified filename extensions.
Figure 10.9 shows the default filename extensions used by the CodeWarrior IDE for a project based on the ARM Executable Image project stationery. Projects based on Thumb stationery invoke the RealView Compiler in Thumb mode.
Click the entry you want to modify in the File Mappings list and enter the File Type for the file. Alternatively, click Choose… and select a file of the same type.
Enter the filename extension, such as .c or .h,
for the chosen file type.
Click the Flags drop-down menu to set flags that determine how the CodeWarrior IDE treats files of the chosen type. If a flag is set, the File Mappings configuration panel displays a dot in the appropriate flag column (Figure 10.9). The flags are:
This flag does not apply to the CodeWarrior for RVDS.
Select this flag to instruct the CodeWarrior IDE to open this type of file with the application that created it when you double-click it in a Project window Files view.
Select this flag to instruct the CodeWarrior IDE to compile this type of file before other files. This option is useful for file that are used to generate files used by other source files or compilers. For example, this option enables you to create a compiler that translates a file into a C source code file and then compiles the C file. YACC (Yet Another Compiler Compiler) files are treated as precompiled files because YACC generates C source code to be compiled by a C compiler.
You cannot develop CodeWarrior plug-ins using the CodeWarrior IDE for RVDS. However, you can use the standard Metrowerks CodeWarrior for Windows development environment to write your own plug-ins to work with the CodeWarrior IDE for RVDS.
Select this flag to instruct the CodeWarrior IDE to ignore files of this type when compiling or linking the project. This option is useful for documentation files that you want to include with your project.
Click the Compiler drop-down menu and select a compiler for the chosen file from the list of available tools. Select None if you want to be able to add files with the specified filename extension to your project, but you do not want to use a plug-in tool to process them.
Click the Edit Language drop-down menu to select the language you want to edit in. The CodeWarrior IDE applies the appropriate syntax coloring for the chosen language.
Click either:
Add, to add a new file mapping
Change, to change the configuration for a selected file mapping.
Click Apply to apply your changes without closing the Target Settings window.
To remove a file mapping:
Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).
Click File Mappings in the Target Settings Panels list to display the configuration panel (see Figure 10.9).
Click the entry you want to modify in the File Mappings list.
Click Remove to remove the selected file mapping.