From 7655205aac2ae8aca89bcd4e3e056bb20a33414c Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 2 Jun 2012 21:45:51 +0000 Subject: Clean up CORE build system module, use simple rather than recursive make variables for internal constants and $(shell) derived values. --- LUFA/Build/lufa.avrdude.in | 2 +- LUFA/Build/lufa.build.in | 26 +++++++++++++------------- LUFA/Build/lufa.core.in | 38 ++++++++++++++++++++------------------ LUFA/Build/lufa.dfu.in | 6 +++--- LUFA/Build/lufa.doxygen.in | 2 +- LUFA/makefile | 5 +++-- 6 files changed, 41 insertions(+), 38 deletions(-) (limited to 'LUFA') diff --git a/LUFA/Build/lufa.avrdude.in b/LUFA/Build/lufa.avrdude.in index dcffe84f5..014850453 100644 --- a/LUFA/Build/lufa.avrdude.in +++ b/LUFA/Build/lufa.avrdude.in @@ -48,7 +48,7 @@ AVRDUDE_PORT ?= usb AVRDUDE_FLAGS ?= # Output Messages -MSG_AVRDUDE_CMD = ' [AVRDUDE] :' +MSG_AVRDUDE_CMD := ' [AVRDUDE] :' AVRDUDE_FLASH_FLAGS = -U flash:w:$< $(AVRDUDE_FLAGS) AVRDUDE_EEP_FLAGS = -U eeprom:w:$< $(AVRDUDE_FLAGS) diff --git a/LUFA/Build/lufa.build.in b/LUFA/Build/lufa.build.in index a4b5c363e..3b28db9ee 100644 --- a/LUFA/Build/lufa.build.in +++ b/LUFA/Build/lufa.build.in @@ -76,24 +76,24 @@ CC_FLAGS ?= # Determine the utility prefix to use for the selected architecture ifeq ($(ARCH), AVR8) - CROSS = avr- + CROSS := avr- else ifeq ($(ARCH), XMEGA) - CROSS = avr- + CROSS := avr- else ifeq ($(ARCH), UC3) - CROSS = avr32- + CROSS := avr32- else $(error Unsupported architecture.) endif # Output Messages -MSG_BUILD_BEGIN = Begin compilation of project \"$(TARGET)\"... -MSG_BUILD_END = Finished building project \"$(TARGET)\". -MSG_COMPILE_CMD = ' [CC] :' -MSG_REMOVE_CMD = ' [RM] :' -MSG_LINKER_CMD = ' [LNK] :' -MSG_SIZE_CMD = ' [SIZE] :' -MSG_OBJCPY_CMD = ' [OBJCPY] :' -MSG_OBJDMP_CMD = ' [OBJDMP] :' +MSG_BUILD_BEGIN := Begin compilation of project \"$(TARGET)\"... +MSG_BUILD_END := Finished building project \"$(TARGET)\". +MSG_COMPILE_CMD := ' [CC] :' +MSG_REMOVE_CMD := ' [RM] :' +MSG_LINKER_CMD := ' [LNK] :' +MSG_SIZE_CMD := ' [SIZE] :' +MSG_OBJCPY_CMD := ' [OBJCPY] :' +MSG_OBJDMP_CMD := ' [OBJDMP] :' # Convert input source file list to differentiate them by type C_SOURCE = $(filter %.c, $(SRC)) @@ -138,8 +138,8 @@ ifneq ($(UNKNOWN_SOURCE),) endif # Determine flags to pass to the size utility based on its reported features -SIZE_MCU_FLAG = $(shell $(CROSS)size --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) -SIZE_FORMAT_FLAG = $(shell $(CROSS)size --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) +SIZE_MCU_FLAG := $(shell $(CROSS)size --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) ) +SIZE_FORMAT_FLAG := $(shell $(CROSS)size --help | grep -- --format=.*avr > /dev/null && echo --format=avr ) begin: diff --git a/LUFA/Build/lufa.core.in b/LUFA/Build/lufa.core.in index bc07a940a..f403b9edb 100644 --- a/LUFA/Build/lufa.core.in +++ b/LUFA/Build/lufa.core.in @@ -7,7 +7,7 @@ # LUFA_BUILD_MODULES += CORE -LUFA_BUILD_TARGETS += info help list_targets list_modules list_mandatory list_optional +LUFA_BUILD_TARGETS += help list_targets list_modules list_mandatory list_optional LUFA_BUILD_MANDATORY_VARS += LUFA_BUILD_OPTIONAL_VARS += @@ -19,7 +19,6 @@ LUFA_BUILD_OPTIONAL_VARS += # ----------------------------------------------------------------------------- # TARGETS: # -# info - Build system information # help - Build system help # list_targets - List all build targets # list_modules - List all build modules @@ -38,14 +37,17 @@ LUFA_BUILD_OPTIONAL_VARS += # # ----------------------------------------------------------------------------- -info: +# Build sorted and filtered lists of the included build module data +SORTED_LUFA_BUILD_MODULES = $(sort $(LUFA_BUILD_MODULES)) +SORTED_LUFA_BUILD_TARGETS = $(sort $(LUFA_BUILD_TARGETS)) +SORTED_LUFA_MANDATORY_VARS = $(sort $(LUFA_BUILD_MANDATORY_VARS)) +SORTED_LUFA_OPTIONAL_VARS = $(filter-out $(SORTED_LUFA_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS))) + +help: @echo "===================================================================" - @echo " LUFA Build System 2.0 " - @echo " (C) Dean Camera { dean @ fourwalledcubicle . com } " + @echo " LUFA Build System 2.0 " + @echo " (C) Dean Camera, 2012 { dean @ fourwalledcubicle . com } " @echo "===================================================================" - -.PHONY: info -help: info @echo "DESCRIPTION: " @echo " This build system is a set of makefile modules for (GNU) Make, to " @echo " provide a simple system for building LUFA powered applications. " @@ -61,35 +63,35 @@ help: info @echo "===================================================================" @echo " Currently used modules in this application: " @echo " " - @echo " [" $(sort $(LUFA_BUILD_MODULES)) "]" + @echo " [" $(SORTED_LUFA_BUILD_MODULES) "]" @echo " " @echo " " @echo " Currently available build targets in this application: " @echo " " - @echo " [" $(sort $(LUFA_BUILD_TARGETS)) "]" + @echo " [" $(SORTED_LUFA_BUILD_TARGETS) "]" @echo " " @echo " " @echo " Mandatory variables required by the selected build Modules: " @echo " " - @echo " [" $(sort $(LUFA_BUILD_MANDATORY_VARS)) "]" + @echo " [" $(SORTED_LUFA_MANDATORY_VARS) "]" @echo " " @echo " " @echo " Optional variables required by the selected build Modules: " @echo " " - @echo " [" $(filter-out $(LUFA_BUILD_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS))) "]" + @echo " [" $(SORTED_LUFA_OPTIONAL_VARS) "]" @echo " " @echo "===================================================================" @echo " The LUFA BuildSystem 2.0 - Powered By Unicorns (tm) " @echo "===================================================================" -list_targets: - @echo Currently Available Build Targets: $(sort $(LUFA_BUILD_TARGETS)) - list_modules: - @echo Currently Build Modules: $(sort $(LUFA_BUILD_MODULES)) + @echo Currently Build Modules: $(SORTED_LUFA_BUILD_MODULES) + +list_targets: + @echo Currently Available Build Targets: $(SORTED_LUFA_BUILD_TARGETS) list_mandatory: - @echo Mandatory Variables for Included Modules: $(sort $(LUFA_BUILD_MANDATORY_VARS)) + @echo Mandatory Variables for Included Modules: $(SORTED_LUFA_MANDATORY_VARS) list_optional: - @echo Optional Variables for Included Modules: $(filter-out $(LUFA_BUILD_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS))) + @echo Optional Variables for Included Modules: $(SORTED_LUFA_OPTIONAL_VARS) diff --git a/LUFA/Build/lufa.dfu.in b/LUFA/Build/lufa.dfu.in index c3a102be8..f855bf7b0 100644 --- a/LUFA/Build/lufa.dfu.in +++ b/LUFA/Build/lufa.dfu.in @@ -41,9 +41,9 @@ MCU ?= $(error Makefile MCU value not set.) TARGET ?= $(error Makefile TARGET value not set.) # Output Messages -MSG_COPY_CMD = ' [CP] :' -MSG_REMOVE_CMD = ' [RM] :' -MSG_DFU_CMD = ' [DFU] :' +MSG_COPY_CMD := ' [CP] :' +MSG_REMOVE_CMD := ' [RM] :' +MSG_DFU_CMD := ' [DFU] :' flip: $(TARGET).hex @echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\" diff --git a/LUFA/Build/lufa.doxygen.in b/LUFA/Build/lufa.doxygen.in index f1b9a9d6e..7d4f8ae31 100644 --- a/LUFA/Build/lufa.doxygen.in +++ b/LUFA/Build/lufa.doxygen.in @@ -44,7 +44,7 @@ DOXYGEN_FAIL_ON_WARNING ?= Y DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES HTML_STYLESHEET=$(patsubst %/,%,$(LUFA_PATH))/DoxygenPages/Style/Style.css # Output Messages -MSG_DOXYGEN_CMD = ' [DOXYGEN] :' +MSG_DOXYGEN_CMD := ' [DOXYGEN] :' # Determine Doxygen invocation command BASE_DOXYGEN_CMD = ( cat Doxygen.conf $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen - diff --git a/LUFA/makefile b/LUFA/makefile index 5b186937c..31c06b32f 100644 --- a/LUFA/makefile +++ b/LUFA/makefile @@ -9,8 +9,9 @@ # 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: -- cgit v1.2.3