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