Clean up CORE build system module, use simple rather than recursive make variables...
authorDean Camera <dean@fourwalledcubicle.com>
Sat, 2 Jun 2012 21:45:51 +0000 (21:45 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sat, 2 Jun 2012 21:45:51 +0000 (21:45 +0000)
Bootloaders/CDC/makefile
Bootloaders/DFU/makefile
Bootloaders/HID/makefile
LUFA/Build/lufa.avrdude.in
LUFA/Build/lufa.build.in
LUFA/Build/lufa.core.in
LUFA/Build/lufa.dfu.in
LUFA/Build/lufa.doxygen.in
LUFA/makefile

index 64d7928..822a411 100644 (file)
 #
 # 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.
 #
 # 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.
 
 # 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
 
 MCU          = at90usb1287
 ARCH         = AVR8
index 22ae1d6..d6d1bb3 100644 (file)
 #
 # 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.
 #
 # 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.
 
 # 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
 
 MCU          = at90usb1287
 ARCH         = AVR8
index 9e33f7b..667bfd9 100644 (file)
 #
 # 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.
 #
 # 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.
 
 # 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
 
 MCU          = at90usb1287
 ARCH         = AVR8
index dcffe84..0148504 100644 (file)
@@ -48,7 +48,7 @@ AVRDUDE_PORT       ?= usb
 AVRDUDE_FLAGS      ?= \r
 \r
 # Output Messages\r
 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
 AVRDUDE_FLASH_FLAGS = -U flash:w:$< $(AVRDUDE_FLAGS)\r
 AVRDUDE_EEP_FLAGS   = -U eeprom:w:$< $(AVRDUDE_FLAGS)\r
index a4b5c36..3b28db9 100644 (file)
@@ -76,24 +76,24 @@ CC_FLAGS       ?=
 \r
 # Determine the utility prefix to use for the selected architecture\r
 ifeq ($(ARCH), AVR8)\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
 else ifeq ($(ARCH), XMEGA)\r
-   CROSS     = avr-\r
+   CROSS       := avr-\r
 else ifeq ($(ARCH), UC3)\r
 else ifeq ($(ARCH), UC3)\r
-   CROSS     = avr32-\r
+   CROSS       := avr32-\r
 else\r
     $(error Unsupported architecture.)\r
 endif\r
 \r
 # Output Messages\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
 \r
 # Convert input source file list to differentiate them by type\r
 C_SOURCE   = $(filter %.c, $(SRC))\r
@@ -138,8 +138,8 @@ ifneq ($(UNKNOWN_SOURCE),)
 endif\r
 \r
 # Determine flags to pass to the size utility based on its reported features\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
 begin:\r
index bc07a94..f403b9e 100644 (file)
@@ -7,7 +7,7 @@
 #\r
 \r
 LUFA_BUILD_MODULES        += CORE\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
 LUFA_BUILD_MANDATORY_VARS += \r
 LUFA_BUILD_OPTIONAL_VARS  += \r
 \r
@@ -19,7 +19,6 @@ LUFA_BUILD_OPTIONAL_VARS  +=
 # -----------------------------------------------------------------------------\r
 # TARGETS:\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
 #    help                      - Build system help\r
 #    list_targets              - List all build targets\r
 #    list_modules              - List all build modules\r
@@ -38,14 +37,17 @@ LUFA_BUILD_OPTIONAL_VARS  +=
 #\r
 # -----------------------------------------------------------------------------\r
 \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 "==================================================================="\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
        @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 "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
@@ -61,35 +63,35 @@ help: info
        @echo "==================================================================="\r
        @echo "  Currently used modules in this application:                      "\r
        @echo "                                                                   "\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 "                                                                   "\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 "                                                                   "\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 "                                                                   "\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
        @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
 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
 \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
        \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
index c3a102b..f855bf7 100644 (file)
@@ -41,9 +41,9 @@ MCU            ?= $(error Makefile MCU value not set.)
 TARGET         ?= $(error Makefile TARGET value not set.)\r
 \r
 # Output Messages\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
 \r
 flip: $(TARGET).hex\r
        @echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\"\r
index f1b9a9d..7d4f8ae 100644 (file)
@@ -44,7 +44,7 @@ DOXYGEN_FAIL_ON_WARNING ?= Y
 DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES HTML_STYLESHEET=$(patsubst %/,%,$(LUFA_PATH))/DoxygenPages/Style/Style.css\r
 \r
 # Output Messages\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
 \r
 # Determine Doxygen invocation command\r
 BASE_DOXYGEN_CMD = ( cat Doxygen.conf $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -\r
index 5b18693..31c06b3 100644 (file)
@@ -9,8 +9,9 @@
 #  Makefile for the LUFA library itself.
 # ---------------------------------------
 
 #  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:
 DOXYGEN_OVERRIDE_PARAMS = PROJECT_NUMBER=$(LUFA_VERSION_NUM)
 
 all: