13.4.3. Modifying the UNIX makefile

If you are using a command-line UNIX system, you must edit the appropriate makefile when you copy an Angel template directory. If you are using APM, refer to Editing the APM project directory structure.

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. For example, the build directory for the PID Angel port is angel/source/pid.b

You must modify the makefile so that it uses your directories, compiles and assembles your source, and links your object files. This is described in Setting up the makefile, below.

In addition to setting up the makefile for your new directory structure, you must set a number of build options, either on the command-line or in the makefile, to provide support for your hardware. The options include:

This is described in Setting command-line build options and Editing makefile build options.

Setting up the makefile

The following instructions assume that you have:

  • copied the complete angel directory to your working directory

  • copied the pid and pid.b template directory pair to a directory pair that is named appropriately for your board.

At this stage, the directory structure for your board-specific files is similar to:


~/working_directory/angel/source/your_board and~/working_directory/angel/source/your_board.b

Follow these steps to edit the makefile:

  1. Open the appropriate makefile for your platform in a texteditor. For example, if you are working under Solaris, open your_board.b/gccsunos/Makefile.

  2. Change all occurrences of the original directory name to the new directory name. For example, if your port is based on the pid/pid.b directory pair, change all occurrences of the pid directory to your_board.

    Be careful with search and replace utilities because there are files named pid in the target directories.

  3. Set up the make parameters required. See Editing makefile build options below.

Setting command-line build options

The PID makefile supports three command-line build options:

ENDIAN=BIG

This option builds a big-endian version of Angel. The objects and images are stored in a sub-directory named big_rel. By default, the makefile builds a little-endian Angel.

ETHERNET_SUPPORTED=1

This option enables ethernet support for the PID board. It includes the ethernet drivers and the Fusion IP stack in the Angel build to enable communications through the PC Card Ethernet Adapter. The default is 0 (no Ethernet support).

FUSION_BUILD=1

This option rebuilds the Fusion stack sources, if they are available.

The Fusion stack binaries are supplied by ARM, under a license from Pacific Softworks, with the Ethernet Upgrade Kit (No. KPI 0015A) for the PID board. The fusion sources are available from ARM after you have agreed a full source license with Pacific Softworks.

By default, the makefile does not rebuild Fusion stack sources.

DEBUG=1

This option builds a debug version of Angel.

Editing makefile build options

The following PID build options are not available as command-line options. You must edit the value of these options in the makefile. The most important options are ROADDR and RWADDR. You must edit these to reflect the operational memory of your system.

The most important makefile options are:

THUMB_SUPPORT

When set to 1 this builds Angel with support for debugging Thumb code. If this is not set, the debugger does not support Thumb state debugging. If Thumb code is encountered it generally causes an undefined instruction trap.

ASSERT_ENABLED

This option controls debug assertions. When set to 1 extra consistency checks are made throughout Angel. If any checks fail, the fatal error trap is taken. This normally resets Angel.

Setting this to 0 is not recommended unless the Angel code is known to be fully functional and the small reduction in image size is important. The default is 1.

MINIMAL_ANGEL

This option is used by the minimal Angel makefiles to build a minimal Angel library.

This option should always be set to 0. Use the separate makefile and build areas to build minimal Angel libraries. For example, the minimal Angel makefiles for the PID board are located in /angel/source/pid.min.

Refer to Minimal Angel for more information on building minimal Angel.

FIRST

This option defines the object file that is linked at the beginning of the ROM image. Valid values are:

FIRST = 'startrom.o(ROMStartup)'

The system can remap its memory map. ROM is unmapped from 0 after reset. The first line of the startup code is placed at the start of the ROM image. The startup code copies the ARM exception vector table to RAM at 0 after remap. This is the default.

FIRST = 'except.o(__Vectors)'

ROM is permanently mapped at 0. The ARM exception vector table is placed at the beginning of the ROM image.

ROADDR

This defines the address of the Angel code at run time:

  • If ROADDR is set to a ROM address, Angel executes from ROM.

  • If ROADDR is set to a RAM address, Angel copies itself to RAM and executes from there.

You can use this option to move Angel to RAM when ROM is much slower than RAM. For example, the makefile for the PID Angel port specifies an ROADDR in SRAM.

ROADDR is the address on which the compiler bases its calculations for all the pc-relative instructions, such as branch instructions.

Refer to Configuring where Angel runs for more information on ROADDR.

RWADDR

This defines where Angel should store its read/write data. This is the address of the data used by Angel at run time. You should avoid setting this to 8000 if possible, because this is the default application area.

Refer to Configuring where Angel runs for more information on RWADDR.

DEBUG

If set to 1, this option enables debugging code within Angel.

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