10.3.5. 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:

Table 10.1 shows the default file mappings for ARM stationery projects.

Table 10.1. File mappings

ExtensionFile TypeCompilerDescription
.cTextARM RealView CompilerC 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.
.acTextARM RealView CompilerC source coded file.
.tcTextARM RealView CompilerThumb C source file
.cc, .c++, .cpp, or .cpTextARM RealView CompilerC++ 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.
.acppTextARM RealView CompilerC++ source coded file
.tcppTextARM RealView CompilerThumb C++ source file
.hTextARM RealView CompilerC header file
.hppTextARM RealView CompilerC++ header file
.sTextARM RealView AssemblerAssembler source file
.incTextARM RealView AssemblerAssembler include file
.o ARM ELF ImporterObject source file
.a or .lib ARM ELF ImporterARM library file
.axf ARM ELF ImporterARM image
.sym ARM ELF ImporterA file containing symbol definitions
.tdv ARM ELF ImporterIntermediate build file for a sub-project
.txtTextNoneText file
.batTextNoneDOS batch command file for post linker
.scatTextNoneScatter-loading description file

Note

  • 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.

Adding or modifying a file mapping

To view and modify the file mappings for a build target:

  1. Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).

  2. Click File Mappings in the Target Settings Panels list to display the configuration panel (Figure 10.9).

    Figure 10.9. File Mappings configuration panel

    File Mappings configuration panel

    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.

  3. 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.

  4. Enter the filename extension, such as .c or .h, for the chosen file type.

  5. 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:

    Resource File

    This flag does not apply to the CodeWarrior for RVDS.

    Launchable

    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.

    Precompiled

    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.

    Note

    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.

    Ignored by Make

    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.

  6. 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.

  7. 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.

  8. Click either:

    • Add, to add a new file mapping

    • Change, to change the configuration for a selected file mapping.

  9. Click Apply to apply your changes without closing the Target Settings window.

Removing a file mapping

To remove a file mapping:

  1. Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).

  2. Click File Mappings in the Target Settings Panels list to display the configuration panel (see Figure 10.9).

  3. Click the entry you want to modify in the File Mappings list.

  4. Click Remove to remove the selected file mapping.

Copyright © 1999-2001, 2005-2007 ARM Limited. All rights reserved.ARM DUI 0065G
Non-Confidential