Merge pull request #126 from kidbomb/feature-ccid
[pub/USBasp.git] / LUFA / Build / LUFA / lufa-gcc.mk
1 #
2 # LUFA Library
3 # Copyright (C) Dean Camera, 2015.
4 #
5 # dean [at] fourwalledcubicle [dot] com
6 # www.lufa-lib.org
7 #
8
9 # Include Guard
10 ifeq ($(filter LUFA_GCC, $(DMBS_BUILD_MODULES)),)
11
12 DMBS_BUILD_MODULES += LUFA_GCC
13 DMBS_BUILD_TARGETS +=
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 +=
18
19 SHELL = /bin/sh
20
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))
24
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)
29
30 # Default values of optionally user-supplied variables
31 BOARD ?= NONE
32
33 # Determine the utility prefix to use for the selected architecture
34 ifeq ($(ARCH), XMEGA)
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.)
38 endif
39
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
43
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)
47
48 endif