13.4.4. Modifying an APM project

If you are using the ARM project manager on a Windows system, you must change the project file when you copy an Angel template directory. If you are using UNIX, refer to Editing makefile build options.

The build directory is separate from the target source code directory. In the supplied examples it has the same name as the target code directory with a .b extension. The APM projects are located in a subdirectory of the build directory. For example, the PID project is located in c:ARM250\Angel\Source\pid.b\Apm

The simplest way to use the PID Angel port as a template is to copy the entire Angel directory structure to a working directory. If you want to change the names of the directories to reflect the name of your board, you must modify the APM project file so that it uses your directories, compiles and assembles your source, and links your object files. This is described in Editing the APM project directory structure.

In addition to setting up the project file for your new directory structure, you must set a number of build options. The options include:

If you are using APM and have purchased the Angel Ethernet Kit, separate project files are supplied to enable you to build Angel ROM Images with or without the Ethernet drivers. Endianness is defined by the selected endianness of the APM environment.

Copying the APM project

When you have selected the Angel port that you want to base your own port on, you must copy the required directories and files. The following instructions assume that you are basing your port on the Angel PID port. Follow these steps to copy the Angel template:

  1. Copy the entire Angel directory and all subdirectories to your working directory. It is recommended that you do not work in the installation Angel directory, by default c:ARM250\Angel, because this may cause problems if you reinstall the Software Development Toolkit.

  2. In your working copy of the Angel directory, select Edit variables for AngelPid.apj from the Project menu. The Edit Variable dialog is displayed (Figure 13.6).

    Figure 13.6. Edit variables

    Edit variables
  3. Change the $$ProjectName variable to the name of your port. The value given here is used by APM to name the build output binaries.

  4. Angel requires two files from the SDT installation C library directory:

    • c:ARM250\Cl\h_la_obj.s

    • c:ARM250\Cl\objmacs.s

    Copy these files to your working Angel source directory.

  5. This step is optional. You can rename the appropriate source and build directories for your own port. For example, you can rename working_directory\Angel\Sources\pid and working_directory\Angel\Sources\pid.b as appropriate for your board. You may need to do this if you have more than one project based on the PID port.

    If you rename the pid and pid.b directories, you must make additional changes to the project so that it will find the appropriate source files. Refer to Editing the APM project directory structure for detailed instructions.

    If you have not renamed the directories, you can perform a trial build.

Editing the APM project directory structure

If you renamed the pid and pid.b directories when you copied the Angel directory you must ensure that the new directory paths are used to compile, assemble, and link your sources. Follow these steps to configure the project template:

  1. Open the APM project file for your project.

  2. Select Edit Project Template… from the Project menu. The Project Template Editor dialog is displayed (Figure 13.7).

    Figure 13.7. Project template editor

    Project template editor
  3. Select Assemble from the list of build step patterns and click on the Edit… button. The Edit Build Step Pattern dialog is displayed (Figure 13.8).

    Figure 13.8. Edit Build Step Pattern

    Edit Build Step Pattern
  4. The Command Lines section of the dialog contains the command-line for the assembler. The last part of the command line is:


    {path|<path|-I><path>} <path><slash><file>.s

    Change this to:


    {path2|<path|-I><path>} <path><slash><file>.s

    by adding the number 2 to the first path.

  5. Click the Apply button and then click OK.

  6. Repeat steps 3 and 4 for the build step patterns Assemble for ROM and Compile.

  7. Select MakeLo from the list of build step patterns and click on the Edit… button. The Edit Build Step Pattern dialog is displayed (Figure 13.9).

    Figure 13.9. Edit makelo.c build step

    Edit makelo.c build step
  8. Change the Included Files and Command Lines sections of the dialog to reflect the new directory structure. For example, if you have copied the complete Angel directory structure and renamed the pid and pid.b directories, change pid to your new directory name.

  9. When you have finished editing the build steps, click Close to exit the Build Step dialog box.

  10. Select Project ? Tool Configuration ? <cc> = armcc ? Set. The Compiler Configuration dialog is displayed (Figure 13.10).

    Figure 13.10. Compiler Configuration

    Compiler Configuration
  11. Click on the Include Files tab and edit the list of include file directories to reflect the new directory structure. Click OK to apply the changes.

  12. Repeat steps 10 and 11 using the <asm> = tasm submenu to configure the assembler.

  13. Remove and re-add all target-specific source files to the project. These are the files that are located in the renamed pid directory, such as devices.c and makelo.c (see Figure 13.11). In general you will have to replace these files with your own code when porting Angel.

    Select a file and press the delete key to remove it. Select Add files from the Project menu to re-add the file to the Sources partition.

    In addition, you must replace makelo.c in the Host Sources partition.

    Figure 13.11. Replacing target-specific source files

    Replacing target-specific source files
  14. The directory header in the APM window can be edited using the Edit Details button. This is not required to build Angel.

Selecting build options

The build variables for the APM project are the same as those defined in the UNIX makefile. They are defined in either the project variables, or as preprocessor definitions in the compiler configuration dialog. Refer to Editing makefile build options for a description of the build options.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential