3 # Copyright (C) Dean Camera, 2015.
5 # dean [at] fourwalledcubicle [dot] com
9 DMBS_BUILD_MODULES
+= LUFA_GCC
11 DMBS_BUILD_MANDATORY_VARS
+= LUFA_PATH ARCH F_USB
12 DMBS_BUILD_OPTIONAL_VARS
+= BOARD
13 DMBS_BUILD_PROVIDED_VARS
+=
14 DMBS_BUILD_PROVIDED_MACROS
+=
18 ERROR_IF_UNSET ?
= $(if
$(filter undefined
, $(origin $(strip $(1)))), $(error Makefile
$(strip $(1)) value not set
))
19 ERROR_IF_EMPTY ?
= $(if
$(strip $($(strip $(1)))), , $(error Makefile
$(strip $(1)) option cannot be blank
))
20 ERROR_IF_NONBOOL ?
= $(if
$(filter Y N
, $($(strip $(1)))), , $(error Makefile
$(strip $(1)) option must be Y or N
))
22 # Sanity check user supplied values
23 $(call ERROR_IF_EMPTY
, LUFA_PATH
)
24 $(call ERROR_IF_EMPTY
, ARCH
)
25 $(call ERROR_IF_EMPTY
, F_USB
)
27 # Default values of optionally user-supplied variables
30 # Determine the utility prefix to use for the selected architecture
32 $(warning The XMEGA device support is currently EXPERIMENTAL
(incomplete and
/or non-functional
), and is included for preview purposes only.
)
33 else ifeq ($(ARCH
), UC3
)
34 $(warning The UC3 device support is currently EXPERIMENTAL
(incomplete and
/or non-functional
), and is included for preview purposes only.
)
37 # Common LUFA C/C++ includes/definitions
38 LUFA_CXX_INCLUDES
= -I.
-I
$(patsubst %/,%,$(LUFA_PATH
))/..
39 LUFA_CXX_DEFINES
= -DARCH
=ARCH_
$(ARCH
) -DBOARD
=BOARD_
$(BOARD
) -DF_USB
=$(F_USB
)UL
41 # LUFA specific standard build options
42 C_FLAGS
+= $(LUFA_CXX_INCLUDES
) $(LUFA_CXX_DEFINES
) $(LUFA_CXX_FLAGS
)
43 CPP_FLAGS
+= $(LUFA_CXX_INCLUDES
) $(LUFA_CXX_DEFINES
) $(LUFA_CXX_FLAGS
)