2.2.3. Build

Either a build or a force build processes the source files of a selected variant through the defined build steps to create the project output. A build executes a build step only if some input to it is newer than its outputs. A force build executes all build steps.

The actions performed in the various build steps and the type of project output are determined by the project template. The project template also partially determines the build order to ensure, for example, that compilation takes place before linking.

When you have added the necessary files to a project, you can build that project. As your project is being built, the progress indicator at the bottom of the project window is updated and any diagnostic information generated is displayed in the build log.

The simplest way to turn source files into project output is to build the entire project. You can also process a single source file, force build an entire project, or select multiple variants to be built.

Building a project

After you have added the example source files to your project you can build it. Click the Build button or select Build project-name from the Project menu. When you start the build, the button in the status area changes to Stop Build, and a build status indicator appears next to the button. Messages from the build tools are displayed in the build log. The build log is opened by APM if it is not already open. Figure 2.4 shows the APM desktop when the build is complete.

Figure 2.4. Built project with error in source

Built project with error in source

You can see from the messages in the build log that the build was not successful. The

red X next to hello.c in the Project view indicates that there is an error in the hello.c source file. The section headed Correcting problems explains how APM can help you to resolve problems in building your project.

Building from a single source file

You can perform a build step from a single source file if the file is associated with a project and has been opened as a part of a project. If the file can be processed (compiled or assembled, for example), the appropriate menu item in the Project menu is enabled and labeled with the name of the build step pattern that is used to perform the build step. If the project template does not define a build step for the selected file type, the Build menu item and the Build button are disabled.

APM performs the actions associated with the build step and displays the results in the build log pane.

Force building a project

Select Force Build to build all of the output files in your project for the selected variant, regardless of whether they have been changed since the last build. If you first select APM... from the Tools menu and check-mark the Build also builds sub-projects option, Force Build also builds any associated sub-projects (see APM preferences).

Force build a project in either of the following ways:

  • select Force Build projectname.apj variant from the Project menu

  • click the Force Build button.


If you move your project to a new location, you must rebuild it using Force Build.

Building variants

When you build a project only the selected variant is built. To build all variants of your project, select Build Variants from the Project menu.

Build steps

A build step is a step in the build process that contributes to the project output. Usually, a build step generates one file or a group of related files.

The actions performed in a build step are defined by a build step pattern within the project template. The build step pattern also defines what type of source file each build step acts upon. Typical build steps include:

  • compiling or assembling source files

  • linking object files and libraries

  • building sub-projects.

Build step patterns

A build step pattern:

  • associates a tool or tools, such as armcc or armlink, with a build step within a project template

  • defines the inputs and outputs associated with a build step

  • associates the file types conventionally used and generated by a tool with the partitions used to organize the project

  • defines the command-line options to be used by the tools when the build step is executed during the building of the project.

Stopping a build

You can stop a build at the end of its current step by clicking the Stop build toolbar button or by clicking the Stop Build variant button in the status area at the bottom of the Project Window.

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