#
# Note that the bootloader size and start address given in AVRStudio is in words and not
# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
-FLASH_SIZE_KB = 128
-BOOT_SECTION_SIZE_KB = 8
+FLASH_SIZE_KB := 128
+BOOT_SECTION_SIZE_KB := 8
# Formulas used to calculate the starting address of the Bootloader section, and the User Application
# API jump table (for more information on the latter, see the bootloader documentation). These formulas
# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead.
-BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
-BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
+BOOT_START := 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
+BOOT_API_TABLESTART := 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
MCU = at90usb1287
ARCH = AVR8
#
# Note that the bootloader size and start address given in AVRStudio is in words and not
# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
-FLASH_SIZE_KB = 128
-BOOT_SECTION_SIZE_KB = 8
+FLASH_SIZE_KB := 128
+BOOT_SECTION_SIZE_KB := 8
# Formulas used to calculate the starting address of the Bootloader section, and the User Application
# API jump table (for more information on the latter, see the bootloader documentation). These formulas
# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead.
-BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
-BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
+BOOT_START := 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
+BOOT_API_TABLESTART := 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
MCU = at90usb1287
ARCH = AVR8
#
# Note that the bootloader size and start address given in AVRStudio is in words and not
# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
-FLASH_SIZE_KB = 128
-BOOT_SECTION_SIZE_KB = 8
+FLASH_SIZE_KB := 128
+BOOT_SECTION_SIZE_KB := 8
# Formulas used to calculate the starting address of the Bootloader section, and the User Application
# API jump table (for more information on the latter, see the bootloader documentation). These formulas
# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead.
-BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
-BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
+BOOT_START := 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
+BOOT_API_TABLESTART := 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
MCU = at90usb1287
ARCH = AVR8
AVRDUDE_FLAGS ?= \r
\r
# Output Messages\r
-MSG_AVRDUDE_CMD = ' [AVRDUDE] :'\r
+MSG_AVRDUDE_CMD := ' [AVRDUDE] :'\r
\r
AVRDUDE_FLASH_FLAGS = -U flash:w:$< $(AVRDUDE_FLAGS)\r
AVRDUDE_EEP_FLAGS = -U eeprom:w:$< $(AVRDUDE_FLAGS)\r
\r
# Determine the utility prefix to use for the selected architecture\r
ifeq ($(ARCH), AVR8)\r
- CROSS = avr-\r
+ CROSS := avr-\r
else ifeq ($(ARCH), XMEGA)\r
- CROSS = avr-\r
+ CROSS := avr-\r
else ifeq ($(ARCH), UC3)\r
- CROSS = avr32-\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
-MSG_COMPILE_CMD = ' [CC] :'\r
-MSG_REMOVE_CMD = ' [RM] :'\r
-MSG_LINKER_CMD = ' [LNK] :'\r
-MSG_SIZE_CMD = ' [SIZE] :'\r
-MSG_OBJCPY_CMD = ' [OBJCPY] :'\r
-MSG_OBJDMP_CMD = ' [OBJDMP] :'\r
+MSG_BUILD_BEGIN := Begin compilation of project \"$(TARGET)\"...\r
+MSG_BUILD_END := Finished building project \"$(TARGET)\".\r
+MSG_COMPILE_CMD := ' [CC] :'\r
+MSG_REMOVE_CMD := ' [RM] :'\r
+MSG_LINKER_CMD := ' [LNK] :'\r
+MSG_SIZE_CMD := ' [SIZE] :'\r
+MSG_OBJCPY_CMD := ' [OBJCPY] :'\r
+MSG_OBJDMP_CMD := ' [OBJDMP] :'\r
\r
# Convert input source file list to differentiate them by type\r
C_SOURCE = $(filter %.c, $(SRC))\r
endif\r
\r
# Determine flags to pass to the size utility based on its reported features\r
-SIZE_MCU_FLAG = $(shell $(CROSS)size --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )\r
-SIZE_FORMAT_FLAG = $(shell $(CROSS)size --help | grep -- --format=.*avr > /dev/null && echo --format=avr )\r
+SIZE_MCU_FLAG := $(shell $(CROSS)size --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )\r
+SIZE_FORMAT_FLAG := $(shell $(CROSS)size --help | grep -- --format=.*avr > /dev/null && echo --format=avr )\r
\r
\r
begin:\r
#\r
\r
LUFA_BUILD_MODULES += CORE\r
-LUFA_BUILD_TARGETS += info help list_targets list_modules list_mandatory list_optional \r
+LUFA_BUILD_TARGETS += help list_targets list_modules list_mandatory list_optional \r
LUFA_BUILD_MANDATORY_VARS += \r
LUFA_BUILD_OPTIONAL_VARS += \r
\r
# -----------------------------------------------------------------------------\r
# TARGETS:\r
#\r
-# info - Build system information\r
# help - Build system help\r
# list_targets - List all build targets\r
# list_modules - List all build modules\r
#\r
# -----------------------------------------------------------------------------\r
\r
-info:\r
+# Build sorted and filtered lists of the included build module data\r
+SORTED_LUFA_BUILD_MODULES = $(sort $(LUFA_BUILD_MODULES))\r
+SORTED_LUFA_BUILD_TARGETS = $(sort $(LUFA_BUILD_TARGETS))\r
+SORTED_LUFA_MANDATORY_VARS = $(sort $(LUFA_BUILD_MANDATORY_VARS))\r
+SORTED_LUFA_OPTIONAL_VARS = $(filter-out $(SORTED_LUFA_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS)))\r
+\r
+help:\r
@echo "==================================================================="\r
- @echo " LUFA Build System 2.0 "\r
- @echo " (C) Dean Camera { dean @ fourwalledcubicle . com } "\r
+ @echo " LUFA Build System 2.0 "\r
+ @echo " (C) Dean Camera, 2012 { dean @ fourwalledcubicle . com } "\r
@echo "==================================================================="\r
-\r
-.PHONY: info\r
-help: info\r
@echo "DESCRIPTION: "\r
@echo " This build system is a set of makefile modules for (GNU) Make, to "\r
@echo " provide a simple system for building LUFA powered applications. "\r
@echo "==================================================================="\r
@echo " Currently used modules in this application: "\r
@echo " "\r
- @echo " [" $(sort $(LUFA_BUILD_MODULES)) "]"\r
+ @echo " [" $(SORTED_LUFA_BUILD_MODULES) "]"\r
@echo " "\r
@echo " "\r
@echo " Currently available build targets in this application: "\r
@echo " "\r
- @echo " [" $(sort $(LUFA_BUILD_TARGETS)) "]"\r
+ @echo " [" $(SORTED_LUFA_BUILD_TARGETS) "]"\r
@echo " "\r
@echo " "\r
@echo " Mandatory variables required by the selected build Modules: "\r
@echo " "\r
- @echo " [" $(sort $(LUFA_BUILD_MANDATORY_VARS)) "]"\r
+ @echo " [" $(SORTED_LUFA_MANDATORY_VARS) "]"\r
@echo " "\r
@echo " "\r
@echo " Optional variables required by the selected build Modules: "\r
@echo " "\r
- @echo " [" $(filter-out $(LUFA_BUILD_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS))) "]"\r
+ @echo " [" $(SORTED_LUFA_OPTIONAL_VARS) "]"\r
@echo " "\r
@echo "==================================================================="\r
@echo " The LUFA BuildSystem 2.0 - Powered By Unicorns (tm) "\r
@echo "==================================================================="\r
\r
-list_targets:\r
- @echo Currently Available Build Targets: $(sort $(LUFA_BUILD_TARGETS))\r
- \r
list_modules:\r
- @echo Currently Build Modules: $(sort $(LUFA_BUILD_MODULES))\r
+ @echo Currently Build Modules: $(SORTED_LUFA_BUILD_MODULES)\r
+\r
+list_targets:\r
+ @echo Currently Available Build Targets: $(SORTED_LUFA_BUILD_TARGETS) \r
\r
list_mandatory:\r
- @echo Mandatory Variables for Included Modules: $(sort $(LUFA_BUILD_MANDATORY_VARS))\r
+ @echo Mandatory Variables for Included Modules: $(SORTED_LUFA_MANDATORY_VARS)\r
\r
list_optional:\r
- @echo Optional Variables for Included Modules: $(filter-out $(LUFA_BUILD_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS)))\r
+ @echo Optional Variables for Included Modules: $(SORTED_LUFA_OPTIONAL_VARS)\r
TARGET ?= $(error Makefile TARGET value not set.)\r
\r
# Output Messages\r
-MSG_COPY_CMD = ' [CP] :'\r
-MSG_REMOVE_CMD = ' [RM] :'\r
-MSG_DFU_CMD = ' [DFU] :'\r
+MSG_COPY_CMD := ' [CP] :'\r
+MSG_REMOVE_CMD := ' [RM] :'\r
+MSG_DFU_CMD := ' [DFU] :'\r
\r
flip: $(TARGET).hex\r
@echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\"\r
DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES HTML_STYLESHEET=$(patsubst %/,%,$(LUFA_PATH))/DoxygenPages/Style/Style.css\r
\r
# Output Messages\r
-MSG_DOXYGEN_CMD = ' [DOXYGEN] :'\r
+MSG_DOXYGEN_CMD := ' [DOXYGEN] :'\r
\r
# Determine Doxygen invocation command\r
BASE_DOXYGEN_CMD = ( cat Doxygen.conf $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -\r
# Makefile for the LUFA library itself.
# ---------------------------------------
-LUFA_VERSION_NUM = $(shell grep LUFA_VERSION_STRING Version.h | cut -d'"' -f2)
-EXCLUDE_FROM_EXPORT = Documentation DoxygenPages CodeTemplates Build *.conf *.tar *.o *.lss *.lst *.hex *.elf *.bin
+LUFA_VERSION_NUM := $(shell grep LUFA_VERSION_STRING Version.h | cut -d'"' -f2)
+EXCLUDE_FROM_EXPORT := Documentation DoxygenPages CodeTemplates Build *.conf *.tar *.o *.lss *.lst *.hex *.elf *.bin
+
DOXYGEN_OVERRIDE_PARAMS = PROJECT_NUMBER=$(LUFA_VERSION_NUM)
all: