3 # Copyright (C) Dean Camera, 2012.
5 # dean [at] fourwalledcubicle [dot] com
9 LUFA_BUILD_MODULES
+= SOURCES
11 LUFA_BUILD_MANDATORY_VARS
+= LUFA_PATH ARCH
12 LUFA_BUILD_OPTIONAL_VARS
+=
13 LUFA_BUILD_PROVIDED_VARS
+= LUFA_SRC_USB LUFA_SRC_USBCLASS LUFA_SRC_TEMPERATURE LUFA_SRC_SERIAL LUFA_SRC_TWI LUFA_SRC_PLATFORM
14 LUFA_BUILD_PROVIDED_MACROS
+=
16 # -----------------------------------------------------------------------------
17 # LUFA Sources Buildsystem Makefile Module.
18 # -----------------------------------------------------------------------------
20 # Provides a set of makefile variables for the various LUFA module sources.
21 # Once included, the sources required to use a given LUFA module will become
22 # available using the makefile variable names listed in the LUFA project
24 # -----------------------------------------------------------------------------
29 # MANDATORY PARAMETERS:
31 # LUFA_PATH - Path to the LUFA library core
32 # ARCH - Device architecture name
34 # OPTIONAL PARAMETERS:
40 # LUFA_SRC_USB - List of LUFA USB driver source files
41 # LUFA_SRC_USBCLASS - List of LUFA USB Class driver source files
42 # LUFA_SRC_TEMPERATURE - List of LUFA temperature sensor driver source
44 # LUFA_SRC_SERIAL - List of LUFA Serial U(S)ART driver source files
45 # LUFA_SRC_TWI - List of LUFA TWI driver source files
46 # LUFA_SRC_PLATFORM - List of LUFA architecture specific platform
47 # management source files
53 # -----------------------------------------------------------------------------
57 ERROR_IF_UNSET ?
= $(if
$(filter undefined
, $(origin $(strip $(1)))), $(error Makefile
$(strip $(1)) value not set
))
58 ERROR_IF_EMPTY ?
= $(if
$(strip $($(strip $(1)))), , $(error Makefile
$(strip $(1)) option cannot be blank
))
59 ERROR_IF_NONBOOL ?
= $(if
$(filter Y N
, $($(strip $(1)))), , $(error Makefile
$(strip $(1)) option must be Y or N
))
61 # Sanity check user supplied values
62 $(foreach MANDATORY_VAR
, $(LUFA_BUILD_MANDATORY_VARS
), $(call ERROR_IF_UNSET
, $(MANDATORY_VAR
)))
63 $(call ERROR_IF_EMPTY
, LUFA_PATH
)
64 $(call ERROR_IF_EMPTY
, ARCH
)
66 # Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
67 LUFA_ROOT_PATH ?
= $(patsubst %/,%,$(LUFA_PATH
))
69 # Construct LUFA module source variables
70 LUFA_SRC_USB
:= $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/Device_
$(ARCH
).c \
71 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/Endpoint_
$(ARCH
).c \
72 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/Host_
$(ARCH
).c \
73 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/Pipe_
$(ARCH
).c \
74 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/USBController_
$(ARCH
).c \
75 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/USBInterrupt_
$(ARCH
).c \
76 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/EndpointStream_
$(ARCH
).c \
77 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/$(ARCH
)/PipeStream_
$(ARCH
).c \
78 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/ConfigDescriptors.c \
79 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/DeviceStandardReq.c \
80 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/Events.c \
81 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/HostStandardReq.c \
82 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Core
/USBTask.c \
83 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Common
/HIDParser.c
84 LUFA_SRC_USBCLASS
:= $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Device
/AudioClassDevice.c \
85 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Device
/CDCClassDevice.c \
86 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Device
/HIDClassDevice.c \
87 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Device
/MassStorageClassDevice.c \
88 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Device
/MIDIClassDevice.c \
89 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Device
/RNDISClassDevice.c \
90 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/AndroidAccessoryClassHost.c \
91 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/AudioClassHost.c \
92 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/CDCClassHost.c \
93 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/HIDClassHost.c \
94 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/MassStorageClassHost.c \
95 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/MIDIClassHost.c \
96 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/PrinterClassHost.c \
97 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/RNDISClassHost.c \
98 $(LUFA_ROOT_PATH
)/Drivers
/USB
/Class
/Host
/StillImageClassHost.c
99 LUFA_SRC_TEMPERATURE
:= $(LUFA_ROOT_PATH
)/Drivers
/Board
/Temperature.c
100 LUFA_SRC_SERIAL
:= $(LUFA_ROOT_PATH
)/Drivers
/Peripheral
/$(ARCH
)/Serial_
$(ARCH
).c
101 LUFA_SRC_TWI
:= $(LUFA_ROOT_PATH
)/Drivers
/Peripheral
/$(ARCH
)/TWI_
$(ARCH
).c
104 LUFA_SRC_PLATFORM
:= $(LUFA_ROOT_PATH
)/Platform
/UC3
/Exception.S \
105 $(LUFA_ROOT_PATH
)/Platform
/UC3
/InterruptManagement.c
110 # Build a list of all available module sources
111 LUFA_SRC_ALL_FILES
:= $(LUFA_SRC_USB
) \
112 $(LUFA_SRC_USBCLASS
) \
113 $(LUFA_SRC_TEMPERATURE
) \