aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Build/DMBS/Template
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Build/DMBS/Template')
-rw-r--r--LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/TEMPLATE_LIB.mk50
-rw-r--r--LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/include/template_lib.h24
-rw-r--r--LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib.c10
-rw-r--r--LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib_private.h14
-rw-r--r--LUFA/Build/DMBS/Template/makefile6
5 files changed, 103 insertions, 1 deletions
diff --git a/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/TEMPLATE_LIB.mk b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/TEMPLATE_LIB.mk
new file mode 100644
index 000000000..57037506f
--- /dev/null
+++ b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/TEMPLATE_LIB.mk
@@ -0,0 +1,50 @@
+#
+# DMBS Build System
+# Released into the public domain.
+#
+# dean [at] fourwalledcubicle [dot] com
+# www.fourwalledcubicle.com
+#
+
+# Include Guard
+ifeq ($(filter TEMPLATE_LIB, $(DMBS_BUILD_MODULES)),)
+
+# Sanity check user supplied DMBS path
+ifndef DMBS_PATH
+$(error Makefile DMBS_PATH option cannot be blank)
+endif
+
+# Location of the current module
+TEMPLATE_LIB_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+
+# Import the CORE module of DMBS
+include $(DMBS_PATH)/core.mk
+
+# This module needs to be included before gcc.mk
+ifneq ($(findstring GCC, $(DMBS_BUILD_MODULES)),)
+$(error Include this module before gcc.mk)
+endif
+
+# Help settings
+DMBS_BUILD_MODULES += TEMPLATE_LIB
+DMBS_BUILD_TARGETS +=
+DMBS_BUILD_MANDATORY_VARS += DMBS_PATH
+DMBS_BUILD_OPTIONAL_VARS +=
+DMBS_BUILD_PROVIDED_VARS += TEMPLATE_LIB_SRC
+DMBS_BUILD_PROVIDED_MACROS +=
+
+# Sanity check user supplied values
+$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
+
+# TEMPLATE_LIB Library
+TEMPLATE_LIB_SRC := $(TEMPLATE_LIB_MODULE_PATH)/src/template_lib.c
+
+# Compiler flags and sources
+SRC += $(TEMPLATE_LIB_SRC)
+CC_FLAGS += -DDMBS_MODULE_TEMPLATE_LIB
+CC_FLAGS += -I$(TEMPLATE_LIB_MODULE_PATH)/include/
+
+# Phony build targets for this module
+.PHONY: $(DMBS_BUILD_TARGETS)
+
+endif
diff --git a/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/include/template_lib.h b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/include/template_lib.h
new file mode 100644
index 000000000..1baa6357e
--- /dev/null
+++ b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/include/template_lib.h
@@ -0,0 +1,24 @@
+/*
+ DMBS Build System
+ Released into the public domain.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+ */
+
+// Include Guard
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Software version
+#define TEMPLATE_LIB_VERSION 100
+
+#include <stdint.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib.c b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib.c
new file mode 100644
index 000000000..f7f6945c1
--- /dev/null
+++ b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib.c
@@ -0,0 +1,10 @@
+/*
+ DMBS Build System
+ Released into the public domain.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+ */
+
+#include "template_lib.h"
+#include "template_lib_private.h"
diff --git a/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib_private.h b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib_private.h
new file mode 100644
index 000000000..714cd3be8
--- /dev/null
+++ b/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/src/template_lib_private.h
@@ -0,0 +1,14 @@
+/*
+ DMBS Build System
+ Released into the public domain.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.fourwalledcubicle.com
+ */
+
+// Include Guard
+#pragma once
+
+#include <stdint.h>
+#include <stddef.h>
+#include <avr/io.h>
diff --git a/LUFA/Build/DMBS/Template/makefile b/LUFA/Build/DMBS/Template/makefile
index d88292388..817f96fe3 100644
--- a/LUFA/Build/DMBS/Template/makefile
+++ b/LUFA/Build/DMBS/Template/makefile
@@ -20,8 +20,12 @@ LD_FLAGS =
# Default target
all:
-# Include DMBS build script makefiles
+# Include libraries and DMBS build script makefiles
DMBS_PATH ?= ../DMBS
+LIB_PATH ?= lib
+
+include $(LIB_PATH)/TEMPLATE_LIB/TEMPLATE_LIB.mk
+
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/cppcheck.mk