#\r
\r
LUFA_BUILD_MODULES += BUILD\r
-LUFA_BUILD_TARGETS += size checksource all elf hex clean\r
+LUFA_BUILD_TARGETS += size checksource all elf hex lss gcc_version clean\r
LUFA_BUILD_MANDATORY_VARS += TARGET ARCH MCU SRC F_USB LUFA_PATH\r
LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS\r
\r
# all - Build application and list size\r
# elf - Build application ELF debug object file\r
# hex - Build application HEX object files\r
+# lss - Build application LSS assembly listing file\r
+# gcc_version - Print version of GCC used\r
# clean - Remove output files\r
#\r
# MANDATORY PARAMETERS:\r
ASM_FLAGS ?=\r
CC_FLAGS ?=\r
\r
+# Determine the utility prefix to use for the selected architecture\r
+ifeq ($(ARCH), AVR8)\r
+ CROSS = avr-\r
+else ifeq ($(ARCH), XMEGA)\r
+ CROSS = avr-\r
+else ifeq ($(ARCH), UC3)\r
+ CROSS = avr32-\r
+else\r
+ $(error Unsupported architecture.)\r
+endif\r
+\r
# Output Messages\r
MSG_BUILD_BEGIN = Begin compilation of project \"$(TARGET)\"...\r
MSG_BUILD_END = Finished building project \"$(TARGET)\".\r
# Create a list of flags to pass to the compiler\r
ifeq ($(ARCH), AVR8)\r
CC_FLAGS += -mmcu=$(MCU) -gdwarf-2 -fshort-enums -fno-inline-small-functions -fpack-struct\r
- CROSS = avr-\r
else ifeq ($(ARCH), XMEGA)\r
CC_FLAGS += -mmcu=$(MCU) -gdwarf-2 -fshort-enums -fno-inline-small-functions -fpack-struct\r
- CROSS = avr-\r
else ifeq ($(ARCH), UC3)\r
CC_FLAGS += -mpart=$(MCU) -g3 -masm-addr-pseudos\r
- CROSS = avr32-\r
-else\r
- $(error Unsupported architecture.)\r
endif\r
CC_FLAGS += -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections\r
CC_FLAGS += -I. -I$(patsubst %/,%,$(LUFA_PATH))/..\r
# Create a list of flags to pass to the linker\r
LD_FLAGS += -lm -Wl,-Map=$(TARGET).map,--cref -Wl,--gc-sections \r
ifeq ($(ARCH), UC3)\r
- LD_FLAGS += --rodata-writable -Wl,--direct-data \r
+ LD_FLAGS += --rodata-writable --direct-data \r
else\r
LD_FLAGS += -Wl,--relax\r
endif\r
begin:\r
@echo ""\r
@echo $(MSG_BUILD_BEGIN)\r
+ @echo ""\r
\r
end:\r
+ @echo ""\r
@echo $(MSG_BUILD_END)\r
@echo ""\r
\r
+gcc_version:\r
+ @$(CROSS)gcc --version\r
+\r
checksource:\r
@for f in $(SRC) $(CPPSRC) $(ASRC); do \\r
if [ -f $$f ]; then \\r
$(CROSS)size $(SIZE_MCU_FLAG) $(SIZE_FORMAT_FLAG) $(TARGET).elf ; 2>/dev/null; \\r
fi\r
\r
-.PHONY: begin elf hex lss size end\r
-all: begin elf hex lss size end\r
+.PHONY: begin gcc_version elf hex lss size end\r
+all: begin gcc_version elf hex lss size end\r
\r
elf: $(TARGET).elf\r
hex: $(TARGET).hex $(TARGET).eep\r