aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Build/DMBS/Template/lib/TEMPLATE_LIB/TEMPLATE_LIB.mk
blob: 57037506f41fe1d9e2b8110d6f221dc517ebe1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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