| LUFA Library 140302 |

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
The BUILD build module

The BUILD LUFA build system module, providing targets for the compilation, assembling and linking of an application from source code into binary files suitable for programming into a target device, using the GCC compiler.

To use this module in your application makefile, add the following code:

include $(LUFA_PATH)/Build/lufa_build.mk

# Requirements

This module requires the the architecture appropriate binaries of the GCC compiler are available in your system's PATH variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages.

# Targets

`size` | Display size of the compiled application FLASH and SRAM segments.
`symbol-sizes` | Display a size-sorted list of symbols from the compiled application, in decimal bytes.
`lib` | Build and archive all source files into a library A binary file.
`all` | Build and link the application into ELF debug and HEX binary files.
`elf` | Build and link the application into an ELF debug file.
`bin` | Build and link the application and produce a BIN binary file.
`hex` | Build and link the application and produce HEX and EEP binary files.
`lss` | Build and link the application and produce a LSS source code/assembly code mixed listing file.
`clean` | Remove all intermediary files and binary output files.
`mostlyclean` | Remove all intermediary files but preserve any binary output files.
`<filename>.s` | Create an assembly listing of a given input C/C++ source file.

# Mandatory Parameters

`TARGET` | Name of the application output file prefix (e.g. `TestApplication`).
`ARCH` | Architecture of the target processor (see Device and Hardware Support).
`MCU` | Name of the Atmel processor model (e.g. `at90usb1287`).
`SRC` | List of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.
`F_USB` | Speed in Hz of the input clock frequency to the target's USB controller.
`LUFA_PATH` | Path to the LUFA library core, either relative or absolute (e.g. `../LUFA-000000/LUFA/`).

# Optional Parameters

`BOARD` | LUFA board hardware drivers to use (see Device and Hardware Support).
`OPTIMIZATION` | Optimization level to use when compiling source files (see GCC manual).
`C_STANDARD` | Version of the C standard to apply when compiling C++ source files (see GCC manual).
`CPP_STANDARD` | Version of the C++ standard to apply when compiling C++ source files (see GCC manual).
`DEBUG_FORMAT` | Format of the debug information to embed in the generated object files (see GCC manual).
`DEBUG_LEVEL` | Level of the debugging information to embed in the generated object files (see GCC manual).
`F_CPU` | Speed of the processor CPU clock, in Hz.
`C_FLAGS` | Flags to pass to the C compiler only, after the automatically generated flags.
`CPP_FLAGS` | Flags to pass to the C++ compiler only, after the automatically generated flags.
`ASM_FLAGS` | Flags to pass to the assembler only, after the automatically generated flags.
`CC_FLAGS` | Common flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.
`LD_FLAGS` | Flags to pass to the linker, after the automatically generated flags.
`LINKER_RELAXATIONS` | Enables or disables linker relaxations when linking the application binary. This can reduce the total size of the application by replacing full `CALL` instructions with smaller `RCALL` instructions where possible. Note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you receive a link error `relocation truncated to fit: R_AVR_13_PCREL`, disable this setting.
`OBJDIR` | Directory to place the generated object and dependency files. If set to "." the same folder as the source file will be used. Note When this option is enabled, all source filenames must be unique.
`OBJECT_FILES` | List of additional object files that should be linked into the resulting binary.

# Module Provided Variables

None

# Module Provided Macros

None