3 # Released into the public domain.
5 # dean [at] fourwalledcubicle [dot] com
6 # www.fourwalledcubicle.com
10 ifeq ($(filter TEMPLATE_LIB
, $(DMBS_BUILD_MODULES
)),)
12 # Sanity check user supplied DMBS path
14 $(error Makefile DMBS_PATH option cannot be blank
)
17 # Location of the current module
18 TEMPLATE_LIB_MODULE_PATH
:= $(patsubst %/,%,$(dir $(lastword
$(MAKEFILE_LIST
))))
20 # Import the CORE module of DMBS
21 include $(DMBS_PATH
)/core.mk
23 # This module needs to be included before gcc.mk
24 ifneq ($(findstring GCC
, $(DMBS_BUILD_MODULES
)),)
25 $(error Include this module before gcc.mk
)
29 DMBS_BUILD_MODULES
+= TEMPLATE_LIB
31 DMBS_BUILD_MANDATORY_VARS
+= DMBS_PATH
32 DMBS_BUILD_OPTIONAL_VARS
+=
33 DMBS_BUILD_PROVIDED_VARS
+= TEMPLATE_LIB_SRC
34 DMBS_BUILD_PROVIDED_MACROS
+=
36 # Sanity check user supplied values
37 $(foreach MANDATORY_VAR
, $(DMBS_BUILD_MANDATORY_VARS
), $(call ERROR_IF_UNSET
, $(MANDATORY_VAR
)))
39 # TEMPLATE_LIB Library
40 TEMPLATE_LIB_SRC
:= $(TEMPLATE_LIB_MODULE_PATH
)/src
/template_lib.c
42 # Compiler flags and sources
43 SRC
+= $(TEMPLATE_LIB_SRC
)
44 CC_FLAGS
+= -DDMBS_MODULE_TEMPLATE_LIB
45 CC_FLAGS
+= -I
$(TEMPLATE_LIB_MODULE_PATH
)/include/
47 # Phony build targets for this module
48 .PHONY
: $(DMBS_BUILD_TARGETS
)