Datasheet

Creating an Application
3-14 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0064D
3.3 Building from the command line
This section describes how to build an application from the command line. From the
command line, you can access:
the compilers (see Using the compilers from the command line)
the CodeWarrior IDE (see Using the CodeWarrior IDE from the command line on
page 3-20)
the debugger (see Invoking AXD from the command line on page 3-20)
the assembler (see Using the assembler from the command line on page 3-16)
the linker (see Setting linker options from the command line on page 3-17).
3.3.1 Using the compilers from the command line
There are four compiler variants as shown in Table 3-1:
Building an example
Sample C source code for a simple application is in
install_directory\Examples\embedded\embed\main.c
.
To build the example from the command line:
1. Compile the C file
main.c
with either:
armcc -g -O1 -c main.c
(for ARM)
tcc -g -O1 -c main.c
(for Thumb)
where:
-g
Tells the compiler to add debug tables.
-O1
Tells the compiler to select the best possible optimization while
maintaining an adequate debug view.
-c
Tells the compiler to compile only (not to link).
Table 3-1 Compiler variants
Compiler name Compiler variant
Source
language
Compiler output
armcc C C 32-bit ARM code
tcc C C 16-bit Thumb code
armcpp C++ C or C++ 32-bit ARM code
tcpp C++ C or C++ 16-bit Thumb code