11.07.2015 Views

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVRCompiler ArgumentsThe IDE controls <strong>the</strong> behaviors of <strong>the</strong> <strong>compiler</strong> by passing comm<strong>and</strong>-line argumentsto <strong>the</strong> <strong>compiler</strong> driver. Normally you do not need to know what <strong>the</strong>se comm<strong>and</strong>-linearguments do, but you can see <strong>the</strong>m in <strong>the</strong> Status Window when you per<strong>for</strong>m a build.This section is useful if you are using comm<strong>and</strong> line scripts to call <strong>the</strong> <strong>compiler</strong>directly.The best method to find <strong>the</strong> correct <strong>compiler</strong> flags is to use <strong>the</strong> IDE <strong>and</strong> invokeImageCraft->Create Makefile <strong>and</strong> <strong>the</strong>n ei<strong>the</strong>r use <strong>the</strong> generated makefile as isor extract <strong>the</strong> relevant <strong>compiler</strong> <strong>and</strong> linker flags within. Note that <strong>the</strong> CodeBlocks IDEdoes not use a makefile <strong>and</strong> uses an internal build system instead.You call <strong>the</strong> <strong>compiler</strong> driver with different arguments <strong>and</strong> <strong>the</strong> driver in turn invokesdifferent passes of <strong>the</strong> <strong>compiler</strong> tool chain with <strong>the</strong> appropriate arguments.The general <strong>for</strong>mat of a comm<strong>and</strong> is as follows:icc<strong>avr</strong> [ arguments ] ... [ ... ]where icc<strong>avr</strong> is <strong>the</strong> name of <strong>the</strong> <strong>compiler</strong> driver. As you can see, you can invoke <strong>the</strong>driver with multiple files <strong>and</strong> <strong>the</strong> driver will per<strong>for</strong>m <strong>the</strong> operations on all of <strong>the</strong> files. Bydefault, <strong>the</strong> driver <strong>the</strong>n links all <strong>the</strong> object files toge<strong>the</strong>r to create <strong>the</strong> output file.The driver automatically adds -I\include to <strong>the</strong> C preprocessorargument <strong>and</strong> -L\lib to <strong>the</strong> linker argument.For most of <strong>the</strong> common options, <strong>the</strong> driver knows which arguments are destined <strong>for</strong>which <strong>compiler</strong> passes. You can also specify which pass an argument applies to byusing a -W prefix. For example: -Wp is <strong>the</strong> preprocessor. For example, -Wp-e -Wf is <strong>the</strong> <strong>compiler</strong> proper. For example, -Wf-Matmega -Wa is <strong>the</strong> assembler. -Wl (letter el) is <strong>the</strong> linker.Driver Arguments -cCompile <strong>the</strong> file to <strong>the</strong> object file level only (does not invoke <strong>the</strong> linker). -o Name <strong>the</strong> output file. By default, <strong>the</strong> output file name is <strong>the</strong> same as <strong>the</strong> input filename, or <strong>the</strong> same as <strong>the</strong> first input file if you supply a list of files.155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!