Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
4
Building applications—an overview
AVR® IAR C/C++ Compiler
Reference Guide
For more information about the Embedded C++ language and IAR Extended Embedded 
C++, see the chapter Using C++.
Building applications—an overview
A typical application is built from a number of source files and libraries. The source files 
can be written in C, C++, or assembler language, and can be compiled into object files 
by the AVR IAR C/C++ Compiler or the AVR IAR Assembler.
A library is a collection of object files. A typical example of a library is the compiler 
library containing the runtime environment and the C/C++ standard library. Libraries 
can also be built using the IAR XAR Library Builder, the IAR XLIB Librarian, or be 
provided by external suppliers.
The IAR XLINK Linker is used for building the final application. XLINK normally uses 
a linker command file, which describes the available resources of the target system.
Below, the process for building an application on the command line is described. For 
information about how to build an application using the IAR Embedded Workbench 
IDE, see the AVR® IAR Embedded Workbench™ IDE User Guide.
COMPILING
In the command line interface, the following line compiles the source file 
myfile.c
 
into the object file 
myfile.r90
 using the default settings:
iccavr myfile.c
In addition, you need to specify some critical options, see Basic settings for project 
configuration
, page 5.
LINKING
The IAR XLINK Linker is used for building the final application. Normally, XLINK 
requires the following information as input:
A number of object files and possibly certain libraries
The standard library containing the runtime environment and the standard language 
functions
A program start label
A linker command file that describes the memory layout of the target system
Information about the output format.
On the command line, the following line can be used for starting XLINK:
xlink myfile.r90 myfile2.r90 -s _ _program_start -f lnkm128s.xcl 
cl3s-ec.r90 -o aout.a90 -FIntel-extended