aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Build
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2016-04-05 21:10:07 +1000
committerDean Camera <dean@fourwalledcubicle.com>2016-04-05 21:10:07 +1000
commit3126cbbf96a24afd447ece00248e5ece39dd088a (patch)
tree1acda324a1334c208f775b1c9e22e934ef7c64f5 /LUFA/Build
parent75b68126d01306347626215ec8ad1537c903e4cd (diff)
downloadlufa-3126cbbf96a24afd447ece00248e5ece39dd088a.tar.gz
lufa-3126cbbf96a24afd447ece00248e5ece39dd088a.tar.bz2
lufa-3126cbbf96a24afd447ece00248e5ece39dd088a.zip
Update to DMBS release-20160403 release.
Diffstat (limited to 'LUFA/Build')
-rw-r--r--LUFA/Build/DMBS/DMBS/ModulesOverview.md (renamed from LUFA/Build/DMBS/DMBS/Modules.md)20
-rw-r--r--LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md94
-rw-r--r--LUFA/Build/DMBS/DMBS/atprogram.md8
-rw-r--r--LUFA/Build/DMBS/DMBS/atprogram.mk10
-rw-r--r--LUFA/Build/DMBS/DMBS/avrdude.md8
-rw-r--r--LUFA/Build/DMBS/DMBS/avrdude.mk10
-rw-r--r--LUFA/Build/DMBS/DMBS/core.md26
-rw-r--r--LUFA/Build/DMBS/DMBS/core.mk12
-rw-r--r--LUFA/Build/DMBS/DMBS/cppcheck.md8
-rw-r--r--LUFA/Build/DMBS/DMBS/cppcheck.mk10
-rw-r--r--LUFA/Build/DMBS/DMBS/dfu.md8
-rw-r--r--LUFA/Build/DMBS/DMBS/dfu.mk10
-rw-r--r--LUFA/Build/DMBS/DMBS/doxygen.md8
-rw-r--r--LUFA/Build/DMBS/DMBS/doxygen.mk13
-rw-r--r--LUFA/Build/DMBS/DMBS/gcc.md8
-rw-r--r--LUFA/Build/DMBS/DMBS/gcc.mk10
-rw-r--r--LUFA/Build/DMBS/DMBS/hid.md8
-rw-r--r--LUFA/Build/DMBS/DMBS/hid.mk10
-rw-r--r--LUFA/Build/DMBS/Readme.md18
-rw-r--r--LUFA/Build/DMBS/Template/makefile11
20 files changed, 254 insertions, 56 deletions
diff --git a/LUFA/Build/DMBS/DMBS/Modules.md b/LUFA/Build/DMBS/DMBS/ModulesOverview.md
index 65caf8a60..1fd9cc11c 100644
--- a/LUFA/Build/DMBS/DMBS/Modules.md
+++ b/LUFA/Build/DMBS/DMBS/ModulesOverview.md
@@ -3,7 +3,7 @@ DMBS - Dean's Makefile Build System
Modules Overview
----------------
+----------------
The following modules are currently included:
@@ -16,11 +16,23 @@ The following modules are currently included:
- [GCC](gcc.md) - Compiling/Assembling/Linking with GCC
- [HID](hid.md) - Device Programming
-To use a module, you will need to add the following boilerplate to your
+## 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 is then used to indicate the location of your DMBS installation, relative
-to the current directory.
+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/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md b/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md
new file mode 100644
index 000000000..3ecbb3312
--- /dev/null
+++ b/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md
@@ -0,0 +1,94 @@
+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/LUFA/Build/DMBS/DMBS/atprogram.md b/LUFA/Build/DMBS/DMBS/atprogram.md
index d84cc9860..ea1b0d919 100644
--- a/LUFA/Build/DMBS/DMBS/atprogram.md
+++ b/LUFA/Build/DMBS/DMBS/atprogram.md
@@ -109,3 +109,11 @@ this module.
</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/LUFA/Build/DMBS/DMBS/atprogram.mk b/LUFA/Build/DMBS/DMBS/atprogram.mk
index 5c433d7db..a505275ae 100644
--- a/LUFA/Build/DMBS/DMBS/atprogram.mk
+++ b/LUFA/Build/DMBS/DMBS/atprogram.mk
@@ -13,11 +13,11 @@ DMBS_BUILD_OPTIONAL_VARS += ATPROGRAM_PROGRAMMER ATPROGRAM_INTERFACE ATPROGRAM
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
-SHELL = /bin/sh
-
-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))
+# 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
diff --git a/LUFA/Build/DMBS/DMBS/avrdude.md b/LUFA/Build/DMBS/DMBS/avrdude.md
index 6af6c70fd..d6c71ce6d 100644
--- a/LUFA/Build/DMBS/DMBS/avrdude.md
+++ b/LUFA/Build/DMBS/DMBS/avrdude.md
@@ -114,3 +114,11 @@ this module.
</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/LUFA/Build/DMBS/DMBS/avrdude.mk b/LUFA/Build/DMBS/DMBS/avrdude.mk
index 6dba68de4..c4bac8fd0 100644
--- a/LUFA/Build/DMBS/DMBS/avrdude.mk
+++ b/LUFA/Build/DMBS/DMBS/avrdude.mk
@@ -13,11 +13,11 @@ DMBS_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS AVRD
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
-SHELL = /bin/sh
-
-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))
+# 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
diff --git a/LUFA/Build/DMBS/DMBS/core.md b/LUFA/Build/DMBS/DMBS/core.md
index a6faf74d1..c7c976790 100644
--- a/LUFA/Build/DMBS/DMBS/core.md
+++ b/LUFA/Build/DMBS/DMBS/core.md
@@ -95,7 +95,7 @@ syntax) if desired, as they are provided by this module.
<tbody>
<tr>
<td>DMBS_VERSION</td>
- <td>Current version of this DMBS release.</td>
+ <td>Current version of this DMBS release, as a ISO 8601 integer (such as `160403` for `2016-04-03`).</td>
</tr>
</tbody>
</table>
@@ -109,8 +109,28 @@ this module.
<table>
<tbody>
<tr>
- <td>N/A</td>
- <td>This module provides no macros.</td>
+ <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/LUFA/Build/DMBS/DMBS/core.mk b/LUFA/Build/DMBS/DMBS/core.mk
index 913731e69..7fdb7f229 100644
--- a/LUFA/Build/DMBS/DMBS/core.mk
+++ b/LUFA/Build/DMBS/DMBS/core.mk
@@ -11,12 +11,20 @@ DMBS_BUILD_TARGETS += help list_targets list_modules list_mandatory list
DMBS_BUILD_MANDATORY_VARS +=
DMBS_BUILD_OPTIONAL_VARS +=
DMBS_BUILD_PROVIDED_VARS += DMBS_VERSION
-DMBS_BUILD_PROVIDED_MACROS +=
+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 = 0.4
+DMBS_VERSION := 20160403
+
+# 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
CONVERT_TO_PRINTABLE = $(if $(strip $(1)), $(1), (None))
diff --git a/LUFA/Build/DMBS/DMBS/cppcheck.md b/LUFA/Build/DMBS/DMBS/cppcheck.md
index d10e39040..ec0e38d02 100644
--- a/LUFA/Build/DMBS/DMBS/cppcheck.md
+++ b/LUFA/Build/DMBS/DMBS/cppcheck.md
@@ -124,3 +124,11 @@ this module.
</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/LUFA/Build/DMBS/DMBS/cppcheck.mk b/LUFA/Build/DMBS/DMBS/cppcheck.mk
index 70b9ed721..9b82fc3b0 100644
--- a/LUFA/Build/DMBS/DMBS/cppcheck.mk
+++ b/LUFA/Build/DMBS/DMBS/cppcheck.mk
@@ -14,11 +14,11 @@ DMBS_BUILD_OPTIONAL_VARS += CPPCHECK_INCLUDES CPPCHECK_EXCLUDES CPPCHECK_MSG_T
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
-SHELL = /bin/sh
-
-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))
+# 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
CPPCHECK_INCLUDES ?=
diff --git a/LUFA/Build/DMBS/DMBS/dfu.md b/LUFA/Build/DMBS/DMBS/dfu.md
index a674d4e75..456bbf6f5 100644
--- a/LUFA/Build/DMBS/DMBS/dfu.md
+++ b/LUFA/Build/DMBS/DMBS/dfu.md
@@ -112,3 +112,11 @@ this module.
</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/LUFA/Build/DMBS/DMBS/dfu.mk b/LUFA/Build/DMBS/DMBS/dfu.mk
index 1349e17a8..1eb22b864 100644
--- a/LUFA/Build/DMBS/DMBS/dfu.mk
+++ b/LUFA/Build/DMBS/DMBS/dfu.mk
@@ -13,11 +13,11 @@ DMBS_BUILD_OPTIONAL_VARS +=
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
-SHELL = /bin/sh
-
-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))
+# 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
# Sanity-check values of mandatory user-supplied variables
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
diff --git a/LUFA/Build/DMBS/DMBS/doxygen.md b/LUFA/Build/DMBS/DMBS/doxygen.md
index 11f6be5e3..837704aca 100644
--- a/LUFA/Build/DMBS/DMBS/doxygen.md
+++ b/LUFA/Build/DMBS/DMBS/doxygen.md
@@ -108,3 +108,11 @@ this module.
</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/LUFA/Build/DMBS/DMBS/doxygen.mk b/LUFA/Build/DMBS/DMBS/doxygen.mk
index 73bc7ff40..45639ad15 100644
--- a/LUFA/Build/DMBS/DMBS/doxygen.mk
+++ b/LUFA/Build/DMBS/DMBS/doxygen.mk
@@ -13,11 +13,11 @@ DMBS_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERR
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
-SHELL = /bin/sh
-
-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))
+# 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
DOXYGEN_CONF ?= doxyfile
@@ -59,5 +59,4 @@ doxygen-create: $(MAKEFILE_LIST)
@echo $(MSG_DOXYGEN_CMD) Creating new configuration file \"$(DOXYGEN_CONF)\" with latest template
doxygen -g $(DOXYGEN_CONF) > /dev/null
-# Phony build targets for this module
-.PHONY: $(DMBS_BUILD_TARGETS)
+
diff --git a/LUFA/Build/DMBS/DMBS/gcc.md b/LUFA/Build/DMBS/DMBS/gcc.md
index d25085fa6..f516da5ff 100644
--- a/LUFA/Build/DMBS/DMBS/gcc.md
+++ b/LUFA/Build/DMBS/DMBS/gcc.md
@@ -194,3 +194,11 @@ this module.
</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/LUFA/Build/DMBS/DMBS/gcc.mk b/LUFA/Build/DMBS/DMBS/gcc.mk
index c7299edff..e33c9c084 100644
--- a/LUFA/Build/DMBS/DMBS/gcc.mk
+++ b/LUFA/Build/DMBS/DMBS/gcc.mk
@@ -13,11 +13,11 @@ DMBS_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
-SHELL = /bin/sh
-
-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))
+# 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
COMPILER_PATH ?=
diff --git a/LUFA/Build/DMBS/DMBS/hid.md b/LUFA/Build/DMBS/DMBS/hid.md
index 691a422ba..b2dfbf713 100644
--- a/LUFA/Build/DMBS/DMBS/hid.md
+++ b/LUFA/Build/DMBS/DMBS/hid.md
@@ -119,3 +119,11 @@ this module.
</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/LUFA/Build/DMBS/DMBS/hid.mk b/LUFA/Build/DMBS/DMBS/hid.mk
index 3575f3777..7a0ad9d0e 100644
--- a/LUFA/Build/DMBS/DMBS/hid.mk
+++ b/LUFA/Build/DMBS/DMBS/hid.mk
@@ -13,13 +13,11 @@ DMBS_BUILD_OPTIONAL_VARS +=
DMBS_BUILD_PROVIDED_VARS +=
DMBS_BUILD_PROVIDED_MACROS +=
-SHELL = /bin/sh
-
+# Conditionally import the CORE module of DMBS if it is not already imported
DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
-
-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))
+ifeq ($(findstring CORE, $(DMBS_BUILD_MODULES)),)
+ include $(DMBS_MODULE_PATH)/core.mk
+endif
# Sanity-check values of mandatory user-supplied variables
$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
diff --git a/LUFA/Build/DMBS/Readme.md b/LUFA/Build/DMBS/Readme.md
index 05125ce5b..f4f7a5f15 100644
--- a/LUFA/Build/DMBS/Readme.md
+++ b/LUFA/Build/DMBS/Readme.md
@@ -35,7 +35,8 @@ are included via a GNU Make `include` directive. While the DMBS `core` module is
always required, you can pick and choose what other modules you wish to add to
your user project.
-[See here for the documentation on the individual modules provided by DMBS.](DMBS/Modules.md)
+[See here for the documentation on the individual modules provided by DMBS.](DMBS/ModulesOverview.md)
+If you're interested in writing your own DMBS module(s), [see here.](DMBS/WritingYourOwnModules.md)
Here's an example user makefile:
@@ -72,6 +73,21 @@ As modules are added, you can get a list of available targets by simply typing
as well as mandatory and optional variables and exposed variables and macros.
+Distribution
+----------------
+
+You can embed DMBS in your project any way you like - some options are:
+1. A git submodule
+2. A source tarball
+3. A manually copied extracted archive
+
+The intention of DMBS is that users can just import it from whatever source
+they like. If your project needs to extend the existing modules in an unusual
+manner, or if you want to provide your own modules, you can include them in
+your project repository (or submit a patch to DMBS if your module is generic
+enough to warrant wide use).
+
+
License
----------------
diff --git a/LUFA/Build/DMBS/Template/makefile b/LUFA/Build/DMBS/Template/makefile
index ba60ab9c2..d88292388 100644
--- a/LUFA/Build/DMBS/Template/makefile
+++ b/LUFA/Build/DMBS/Template/makefile
@@ -20,18 +20,13 @@ LD_FLAGS =
# Default target
all:
-# Include LUFA-specific DMBS extension modules
-DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
-include $(DMBS_LUFA_PATH)/lufa-sources.mk
-include $(DMBS_LUFA_PATH)/lufa-gcc.mk
-
-# Include common DMBS build system modules
-DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
+# Include DMBS build script makefiles
+DMBS_PATH ?= ../DMBS
include $(DMBS_PATH)/core.mk
+include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
-include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk