diff options
Diffstat (limited to 'lib/lufa/LUFA/Build/DMBS')
25 files changed, 2295 insertions, 0 deletions
diff --git a/lib/lufa/LUFA/Build/DMBS/.gitignore b/lib/lufa/LUFA/Build/DMBS/.gitignore new file mode 100644 index 0000000000..938768908a --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/.gitignore @@ -0,0 +1,9 @@ +*.lss +*.bin +*.elf +*.hex +*.eep +*.map +*.o +*.d +*.sym diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c b/lib/lufa/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c new file mode 100644 index 0000000000..35ea2d79b7 --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c @@ -0,0 +1,39 @@ +/* + DMBS Build System + Released into the public domain. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com + */ + +/** \file + * + * Special application to extract an EEPROM image stored in FLASH memory, and + * copy it to the device EEPROM. This application is designed to be used with + * the HID build system module of DMBS to program the EEPROM of a target device + * that uses the HID bootloader protocol, which does not have native EEPROM + * programming support. + */ + +#include <avr/io.h> +#include <avr/eeprom.h> +#include <avr/pgmspace.h> + +/* References to the binary EEPROM data linked in the AVR's FLASH memory space */ +extern const char _binary_InputEEData_bin_start[]; +extern const char _binary_InputEEData_bin_end[]; +extern const char _binary_InputEEData_bin_size[]; + +/* Friendly names for the embedded binary data stored in FLASH memory space */ +#define InputEEData _binary_InputEEData_bin_start +#define InputEEData_size ((int)_binary_InputEEData_bin_size) + +int main(void) +{ + /* Copy out the embedded EEPROM data from FLASH to EEPROM memory space */ + for (uint16_t i = 0; i < InputEEData_size; i++) + eeprom_update_byte((uint8_t*)i, pgm_read_byte(&InputEEData[i])); + + /* Infinite loop once complete */ + for (;;); +} diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile b/lib/lufa/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile new file mode 100644 index 0000000000..879eda8cf2 --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile @@ -0,0 +1,35 @@ +# +# DMBS Build System +# Released into the public domain. +# +# dean [at] fourwalledcubicle [dot] com +# www.fourwalledcubicle.com +# + +# Run "make help" for target help. + +MCU = atmega128 +ARCH = AVR8 +F_CPU = 1000000 +OPTIMIZATION = s +TARGET = HID_EEPROM_Loader +SRC = $(TARGET).c +CC_FLAGS = +LD_FLAGS = +OBJECT_FILES = InputEEData.o + +# Default target +all: + +# Determine the AVR sub-architecture of the build main application object file +FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1) + +# Create a linkable object file with the input binary EEPROM data stored in the FLASH section +InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST) + @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\" + avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@ + +# Include LUFA build script makefiles +include ../core.mk +include ../gcc.mk +include ../hid.mk diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/License.txt b/lib/lufa/LUFA/Build/DMBS/DMBS/License.txt new file mode 100644 index 0000000000..322c7624e5 --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/License.txt @@ -0,0 +1,32 @@ + DMBS Build System + Released into the public domain. + + dean [at] fourwalledcubicle [dot] com + www.fourwalledcubicle.com + + + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/> diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/ModulesOverview.md b/lib/lufa/LUFA/Build/DMBS/DMBS/ModulesOverview.md new file mode 100644 index 0000000000..1fd9cc11cc --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/ModulesOverview.md @@ -0,0 +1,38 @@ +DMBS - Dean's Makefile Build System +=================================== + + +Modules Overview +---------------- + +The following modules are currently included: + + - [ATPROGRAM](atprogram.md) - Device Programming + - [AVRDUDE](avrdude.md) - Device Programming + - [CORE](core.md) - DMBS Core Functionality + - [CPPCHECK](cppcheck.md) - Static Code Analysis + - [DFU](dfu.md) - Device Programming + - [DOXYGEN](doxygen.md) - Automated Source Code Documentation + - [GCC](gcc.md) - Compiling/Assembling/Linking with GCC + - [HID](hid.md) - Device Programming + +## Importing modules into your project makefile + +To use a module, it is recommended to add the following boilerplate to your +makefile: + + # Include DMBS build script makefiles + DMBS_PATH ?= ../DMBS + +Which can then used to indicate the location of your DMBS installation, relative +to the current directory, when importing modules. For example: + + DMBS_PATH ?= ../DMBS + include $(DMBS_PATH)/core.mk + include $(DMBS_PATH)/gcc.mk + +Imports the `CORE` and `GCC` modules from DMBS using a single path relative to +your project's makefile. + +If you wish to write your own DMBS module(s), +[see the documentation here for more details.](WritingYourOwnModules.md) diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md b/lib/lufa/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md new file mode 100644 index 0000000000..16df7a53bb --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md @@ -0,0 +1,95 @@ +DMBS - Dean's Makefile Build System +=================================== + + +Writing Your Own Modules +------------------------ + +A DMBS module consists of the several boilerplate sections, explained below. + +## The DMBS module hooks + +Your module needs to advertise to DMBS its name, its makefile targets, the +required and optional variables, and the variables and macros the module +provides for use elsewhere. This is achieved with the following section: + + DMBS_BUILD_MODULES += EXAMPLE + DMBS_BUILD_TARGETS += example-target another-target + DMBS_BUILD_MANDATORY_VARS += MANDATORY_NAME ALSO_MANDATORY + DMBS_BUILD_OPTIONAL_VARS += OPTIONAL_NAME ALSO_OPTIONAL + DMBS_BUILD_PROVIDED_VARS += MEANING_OF_LIFE + DMBS_BUILD_PROVIDED_MACROS += STRIP_WHITESPACE + +The example above declares that this module is called `EXAMPLE`, and exposes the +listed targets, variable requirements and provides variables and macros. + +Your module name and provided variable/macro names must be unique, however you +can (and should) re-use variable names where appropriate if they apply to +several modules (such as `ARCH` to specify the project's microcontroller +architecture). Re-using targets is not recommended, but can be used to extend +the dependencies of another module's targets. + +## Importing the CORE module + +Next, your module should always import the DMBS `CORE` module, via the +following: + + # Conditionally import the CORE module of DMBS if it is not already imported + DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) + ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) + include $(DMBS_MODULE_PATH)/core.mk + endif + +This ensures that the `make help` target is always available. In addition, the +`CORE` module exposes some [commonly used macros and variables](core.md) to +your module. + +## Setting optional variable's defaults + +If a variable is optional, you should provide a default value. Do this via the +`?=` operator of `make`, which sets a variable's value if it has not yet been +set: + + MY_OPTIONAL_VARIABLE ?= some_default_value + +## Sanity checking user input + +Sanity checks are what make DMBS useful. Where possible, validate user input and +convert generated errors to human-friendly messages. This can be achieved by +enforcing that all the declared module mandatory variables have been set by the +user: + + # Sanity-check values of mandatory user-supplied variables + $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) + +As well as complaining if they are set, but currently empty: + + $(call ERROR_IF_EMPTY, SOME_MANDATORY_VARIABLE) + $(call ERROR_IF_EMPTY, SOME_OPTIONAL_BUT_NON_EMPTY_VARIABLE) + +Or even if they are boolean (`Y` or `N`) variables that have an invalid value: + + $(call ERROR_IF_NONBOOL, SOME_BOOL_VARIABLE) + +## Adding targets + +The meat of a DMBS module is the targets, which are run when the user types +`make {target name}` from the command line. These can be as complex or simple +as you like. See the GNU make manual for information on writing make targets. + + example-target: + echo "Your DMBS module works!" + +## And finally, list the PHONYs + +Important in GNU Make is the concept of phony targets; this special directive +tells make that a given target should never be considered a valid file. Listing +phonies ensures that, for example, if your module had a target called `build`, +it would always run when the user types `make build` from the command line, even +if a file called `build` existed in the user project folder. + +You can list module-internal targets here, as well as mark all public targets +via the module header's `DMBS_BUILD_TARGETS` variable. + + # Phony build targets for this module + .PHONY: $(DMBS_BUILD_TARGETS) some-module-internal-target another-internal-target diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/atprogram.md b/lib/lufa/LUFA/Build/DMBS/DMBS/atprogram.md new file mode 100644 index 0000000000..ea1b0d9194 --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/atprogram.md @@ -0,0 +1,119 @@ +DMBS - Dean's Makefile Build System +=================================== + + +Module: ATPROGRAM +----------------- + +The ATPROGRAM module provides build targets for use with the official +`ATPROGRAM` back-end utility distributed with the free +[Atmel Studio](http://www.atmel.com) software released by Atmel. + +## Importing This Module into a Makefile: + +To use this module in your application makefile, add the following code to your +makefile: + + include $(DMBS_PATH)/atprogram.mk + +## Prerequisites: + +This module requires the `atprogram.exe` utility to be available in your +system's `PATH` variable. The `atprogram.exe` utility is distributed in Atmel +Studio (usually) inside the application install folder's `atbackend` +subdirectory. + +## Build Targets: + +The following targets are supported by this module: + +<table> + <tbody> + <tr> + <td>atprogram</td> + <td>Program the device FLASH memory with the application's executable data.</td> + </tr> + <tr> + <td>atprogram-ee</td> + <td>Program the device EEPROM memory with the application's EEPROM data.</td> + </tr> + </tbody> +</table> + +## Mandatory Variables: + +The following variables must be defined (with a `NAME = VALUE` syntax, one +variable per line) in the user makefile to be able to use this module: + +<table> + <tbody> + <tr> + <td>MCU</td> + <td>Name of the Atmel processor model (e.g. `at90usb1287`).</td> + </tr> + <tr> + <td>TARGET</td> + <td>Name of the application output file prefix (e.g. `TestApplication`).</td> + </tr> + </tbody> +</table> + +## Optional Variables: + +The following variables may be defined (with a `NAME = VALUE` syntax, one +variable per line) in the user makefile. If not specified, a default value will +be assumed. + +<table> + <tbody> + <tr> + <td>ATPROGRAM_PROGRAMMER</td> + <td>Name of the Atmel programmer or debugger tool to communicate with (e.g. `jtagice3`). Default is `atmelice`.</td> + </tr> + <tr> + <td>ATPROGRAM_INTERFACE</td> + <td>Name of the programming interface to use when programming the target (e.g. `spi`). Default is `jtag`.</td> + </tr> + <tr> + <td>ATPROGRAM_PORT</td> + <td>Name of the communication port to use when when programming with a serially connected tool (e.g. `COM2`). Default is `usb`.</td> + </tr> + </tbody> +</table> + +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + +<table> + <tbody> + <tr> + <td>N/A</td> + <td>This module provides no variables.</td> + </tr> + </tbody> +</table> + +## Provided Macros: + +The following macros may be referenced in a user makefile (via +`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by +this module. + +<table> + <tbody> + <tr> + <td>N/A</td> + <td>This module provides no macros.</td> + </tr> + </tbody> +</table> + +## Module Changelog: + +The changes to this module since its initial release are listed below, as of the +DMBS version where the change was made. + +### 20160403 +Initial release. diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/atprogram.mk b/lib/lufa/LUFA/Build/DMBS/DMBS/atprogram.mk new file mode 100644 index 0000000000..a505275aed --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/atprogram.mk @@ -0,0 +1,68 @@ +# +# DMBS Build System +# Released into the public domain. +# +# dean [at] fourwalledcubicle [dot] com +# www.fourwalledcubicle.com +# + +DMBS_BUILD_MODULES += ATPROGRAM +DMBS_BUILD_TARGETS += atprogram atprogram-ee +DMBS_BUILD_MANDATORY_VARS += MCU TARGET +DMBS_BUILD_OPTIONAL_VARS += ATPROGRAM_PROGRAMMER ATPROGRAM_INTERFACE ATPROGRAM_PORT +DMBS_BUILD_PROVIDED_VARS += +DMBS_BUILD_PROVIDED_MACROS += + +# Conditionally import the CORE module of DMBS if it is not already imported +DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) +ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) + include $(DMBS_MODULE_PATH)/core.mk +endif + +# Default values of optionally user-supplied variables +ATPROGRAM_PROGRAMMER ?= atmelice +ATPROGRAM_INTERFACE ?= jtag +ATPROGRAM_PORT ?= + +# Sanity check user supplied values +$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) +$(call ERROR_IF_EMPTY, MCU) +$(call ERROR_IF_EMPTY, TARGET) +$(call ERROR_IF_EMPTY, ATPROGRAM_PROGRAMMER) +$(call ERROR_IF_EMPTY, ATPROGRAM_INTERFACE) + +# Output Messages +MSG_ATPROGRAM_CMD := ' [ATPRGRM] :' + +# Construct base atprogram command flags +BASE_ATPROGRAM_FLAGS := --tool $(ATPROGRAM_PROGRAMMER) --interface $(ATPROGRAM_INTERFACE) --device $(MCU) +ifneq ($(ATPROGRAM_PORT),) + BASE_ATPROGRAM_FLAGS += --port $(ATPROGRAM_PORT) +endif + +# Construct the flags to use for the various memory spaces +ifeq ($(ARCH), AVR8) + ATPROGRAM_FLASH_FLAGS := --chiperase --flash + ATPROGRAM_EEPROM_FLAGS := --eeprom +else ifeq ($(ARCH), XMEGA) + ATPROGRAM_FLASH_FLAGS := --erase --flash + ATPROGRAM_EEPROM_FLAGS := --eeprom +else ifeq ($(ARCH), UC3) + ATPROGRAM_FLASH_FLAGS := --erase + ATPROGRAM_EEPROM_FLAGS := --eeprom +else + $(error Unsupported architecture "$(ARCH)") +endif + +# Programs in the target FLASH memory using ATPROGRAM +atprogram: $(TARGET).elf $(MAKEFILE_LIST) + @echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" FLASH using \"$(ATPROGRAM_PROGRAMMER)\" + atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_FLASH_FLAGS) --file $< + +# Programs in the target EEPROM memory using ATPROGRAM +atprogram-ee: $(TARGET).elf $(MAKEFILE_LIST) + @echo $(MSG_ATPROGRAM_CMD) Programming device \"$(MCU)\" EEPROM using \"$(ATPROGRAM_PROGRAMMER)\" + atprogram $(BASE_ATPROGRAM_FLAGS) program $(ATPROGRAM_EEPROM_FLAGS) --file $< + +# Phony build targets for this module +.PHONY: $(DMBS_BUILD_TARGETS) diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/avrdude.md b/lib/lufa/LUFA/Build/DMBS/DMBS/avrdude.md new file mode 100644 index 0000000000..d6c71ce6db --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/avrdude.md @@ -0,0 +1,124 @@ +DMBS - Dean's Makefile Build System +=================================== + + +Module: AVRDUDE +----------------- + +The AVRDUDE module provides build targets for use with the official +open source `AVRDUDE` programmer utility, for the reprogramming of Atmel devices +using a wide variety of official and non-official programming devices and +bootloaders. + +## Importing This Module into a Makefile: + +To use this module in your application makefile, add the following code to your +makefile: + + include $(DMBS_PATH)/avrdude.mk + +## Prerequisites: + +This module requires the `avrdude` utility to be available in your +system's `PATH` variable. The `avrdude` utility is distributed on the project's +[official site](https://savannah.nongnu.org/projects/avrdude) but is also +made available in many *nix operating system's package managers. + +## Build Targets: + +The following targets are supported by this module: + +<table> + <tbody> + <tr> + <td>avrdude</td> + <td>Program the device FLASH memory with the application's executable data.</td> + </tr> + <tr> + <td>avrdude-ee</td> + <td>Program the device EEPROM memory with the application's EEPROM data.</td> + </tr> + </tbody> +</table> + +## Mandatory Variables: + +The following variables must be defined (with a `NAME = VALUE` syntax, one +variable per line) in the user makefile to be able to use this module: + +<table> + <tbody> + <tr> + <td>MCU</td> + <td>Name of the Atmel processor model (e.g. `at90usb1287`).</td> + </tr> + <tr> + <td>TARGET</td> + <td>Name of the application output file prefix (e.g. `TestApplication`).</td> + </tr> + </tbody> +</table> + +## Optional Variables: + +The following variables may be defined (with a `NAME = VALUE` syntax, one +variable per line) in the user makefile. If not specified, a default value will +be assumed. + +<table> + <tbody> + <tr> + <td>AVRDUDE_PROGRAMMER</td> + <td>Name of the programmer/debugger tool or bootloader to communicate with (e.g. `jtagicemkii`). Default is `jtagicemkii`.</td> + </tr> + <tr> + <td>AVRDUDE_PORT</td> + <td>Name of the communication port to use when when programming with a serially connected tool (e.g. `COM2`). Default is `usb`.</td> + </tr> + <tr> + <td>AVRDUDE_FLAGS</td> + <td>Additional flags to pass to `avrdude` when invoking the tool. Default is empty (no additional flags).</td> + </tr> + <tr> + <td>AVRDUDE_MEMORY</td> + <td>Memory space to program when executing the `avrdude` target (e.g. 'application` for an XMEGA device). Default is `flash`.</td> + </tr> + </tbody> +</table> + +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + +<table> + <tbody> + <tr> + <td>N/A</td> + <td>This module provides no variables.</td> + </tr> + </tbody> +</table> + +## Provided Macros: + +The following macros may be referenced in a user makefile (via +`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by +this module. + +<table> + <tbody> + <tr> + <td>N/A</td> + <td>This module provides no macros.</td> + </tr> + </tbody> +</table> + +## Module Changelog: + +The changes to this module since its initial release are listed below, as of the +DMBS version where the change was made. + +### 20160403 +Initial release. diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/avrdude.mk b/lib/lufa/LUFA/Build/DMBS/DMBS/avrdude.mk new file mode 100644 index 0000000000..c4bac8fd0e --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/avrdude.mk @@ -0,0 +1,52 @@ +# +# DMBS Build System +# Released into the public domain. +# +# dean [at] fourwalledcubicle [dot] com +# www.fourwalledcubicle.com +# + +DMBS_BUILD_MODULES += AVRDUDE +DMBS_BUILD_TARGETS += avrdude avrdude-ee +DMBS_BUILD_MANDATORY_VARS += MCU TARGET +DMBS_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS AVRDUDE_MEMORY +DMBS_BUILD_PROVIDED_VARS += +DMBS_BUILD_PROVIDED_MACROS += + +# Conditionally import the CORE module of DMBS if it is not already imported +DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) +ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),) + include $(DMBS_MODULE_PATH)/core.mk +endif + +# Default values of optionally user-supplied variables +AVRDUDE_PROGRAMMER ?= jtagicemkii +AVRDUDE_PORT ?= usb +AVRDUDE_FLAGS ?= +AVRDUDE_MEMORY ?= flash + +# Sanity check user supplied values +$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) +$(call ERROR_IF_EMPTY, MCU) +$(call ERROR_IF_EMPTY, TARGET) +$(call ERROR_IF_EMPTY, AVRDUDE_PROGRAMMER) +$(call ERROR_IF_EMPTY, AVRDUDE_PORT) + +# Output Messages +MSG_AVRDUDE_CMD := ' [AVRDUDE] :' + +# Construct base avrdude command flags +BASE_AVRDUDE_FLAGS := -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) + +# Programs in the target FLASH memory using AVRDUDE +avrdude: $(TARGET).hex $(MAKEFILE_LIST) + @echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" FLASH using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\" + avrdude $(BASE_AVRDUDE_FLAGS) -U $(AVRDUDE_MEMORY):w:$< $(AVRDUDE_FLAGS) + +# Programs in the target EEPROM memory using AVRDUDE +avrdude-ee: $(TARGET).eep $(MAKEFILE_LIST) + @echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" EEPROM using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\" + avrdude $(BASE_AVRDUDE_FLAGS) -U eeprom:w:$< $(AVRDUDE_FLAGS) + +# Phony build targets for this module +.PHONY: $(DMBS_BUILD_TARGETS) diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/core.md b/lib/lufa/LUFA/Build/DMBS/DMBS/core.md new file mode 100644 index 0000000000..406abfecd7 --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/core.md @@ -0,0 +1,136 @@ +DMBS - Dean's Makefile Build System +=================================== + + +Module: CORE +------------ + +The CORE module provides the core DMBS infrastructure used by other DMBS +modules, and must always be imported. Additionally, this module provides the +help system for DMBS. + +## Importing This Module into a Makefile: + +To use this module in your application makefile, add the following code to your +makefile: + + include $(DMBS_PATH)/core.mk + +## Prerequisites: + +None. + +## Build Targets: + +The following targets are supported by this module: + +<table> + <tbody> + <tr> + <td>help</td> + <td>Show help for the current project, including a list of all available targets, variables and macros from the imported modules.</td> + </tr> + <tr> + <td>list_targets</td> + <td>Show a list of all build targets from the imported modules.</td> + </tr> + <tr> + <td>list_modules</td> + <td>Show a list of all imported modules.</td> + </tr> + <tr> + <td>list_mandatory</td> + <td>Show a list of all mandatory variables from the imported modules.</td> + </tr> + <tr> + <td>list_optional</td> + <td>Show a list of all optional variables from the imported modules.</td> + </tr> + <tr> + <td>list_provided</td> + <td>Show a list of all variables provided by the imported modules.</td> + </tr> + <tr> + <td>list_macros</td> + <td>Show a list of all macros provided by the imported modules.</td> + </tr> + </tbody> +</table> + +## Mandatory Variables: + +The following variables must be defined (with a `NAME = VALUE` syntax, one +variable per line) in the user makefile to be able to use this module: + +<table> + <tbody> + <tr> + <td>N/A</td> + <td>This module has no mandatory variables.</td> + </tr> + </tbody> +</table> + +## Optional Variables: + +The following variables may be defined (with a `NAME = VALUE` syntax, one +variable per line) in the user makefile. If not specified, a default value will +be assumed. + +<table> + <tbody> + <tr> + <td>N/A</td> + <td>This module has no optional variables.</td> + </tr> + </tbody> +</table> + +## Provided Variables: + +The following variables may be referenced in a user makefile (via `$(NAME)` +syntax) if desired, as they are provided by this module. + +<table> + <tbody> + <tr> + <td>DMBS_VERSION</td> + <td>Current version of this DMBS release, as a ISO 8601 integer (such as `20160403` for `2016-04-03`).</td> + </tr> + </tbody> +</table> + +## Provided Macros: + +The following macros may be referenced in a user makefile (via +`$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by +this module. + +<table> + <tbody> + <tr> + <td>DMBS_CHECK_VERSION</td> + <td>Macro to check the current DMBS version against the first argument and abort if the required version is newer than the current version.</td> + </tr> + <tr> + <td>ERROR_IF_UNSET</td> + <td>Macro to check the given makefile variable name passed as the first argument, and abort if it has not been set by any makefile module.</td> + </tr> + <tr> + <td>ERROR_IF_EMPTY</td> + <td>Macro to check the given makefile variable name passed as the first argument, and abort if it has an empty value.</td> + </tr> + <tr> + <td>ERROR_IF_NONBOOL</td> + <td>Macro to check the given makefile variable name passed as the first argument, and abort if it has a value other than `Y` or `N`.</td> + </tr> + </tbody> +</table> + +## Module Changelog: + +The changes to this module since its initial release are listed below, as of the +DMBS version where the change was made. + +### 20160403 +Initial release. diff --git a/lib/lufa/LUFA/Build/DMBS/DMBS/core.mk b/lib/lufa/LUFA/Build/DMBS/DMBS/core.mk new file mode 100644 index 0000000000..1edbd178c1 --- /dev/null +++ b/lib/lufa/LUFA/Build/DMBS/DMBS/core.mk @@ -0,0 +1,147 @@ +# +# DMBS Build System +# Released into the public domain. +# +# dean [at] fourwalledcubicle [dot] com +# www.fourwalledcubicle.com +# + +DMBS_BUILD_MODULES += CORE +DMBS_BUILD_TARGETS += help list_targets list_modules list_mandatory list_optional list_provided list_macros +DMBS_BUILD_MANDATORY_VARS += +DMBS_BUILD_OPTIONAL_VARS += +DMBS_BUILD_PROVIDED_VARS += DMBS_VERSION +DMBS_BUILD_PROVIDED_MACROS += DMBS_CHECK_VERSION ERROR_IF_UNSET ERROR_IF_EMPTY ERROR_IF_NONBOOL + +SHELL = /bin/sh + +# Current DMBS release version +DMBS_VERSION := 20170426 + +# Macro to check the DMBS version, aborts if the given DMBS version is below the current version +DMBS_CHECK_VERSION ?= $(if $(filter-out 0, $(shell test $(DMBS_VERSION) -lt $(1); echo $$?)), , $(error DMBS version $(1) or newer required, current version is $(DMBS_VERSION))) + +# Macros to use in other modules to check various conditions +ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set)) +ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank)) +ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N)) + +# Converts a given input to a printable output using "(None)" if no items are in the list |