Replace the LUFA build system with DMBS.
[pub/lufa.git] / LUFA / Build / LUFA / lufa-sources.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 DMBS_BUILD_MODULES += LUFA_SOURCES
10 DMBS_BUILD_TARGETS +=
11 DMBS_BUILD_MANDATORY_VARS += LUFA_PATH ARCH
12 DMBS_BUILD_OPTIONAL_VARS +=
13 DMBS_BUILD_PROVIDED_VARS += LUFA_SRC_USB_DEVICE LUFA_SRC_USB_HOST \
14 LUFA_SRC_USB LUFA_SRC_USBCLASS_DEVICE \
15 LUFA_SRC_USBCLASS_HOST LUFA_SRC_USBCLASS \
16 LUFA_SRC_TEMPERATURE LUFA_SRC_SERIAL \
17 LUFA_SRC_TWI LUFA_SRC_PLATFORM
18 DMBS_BUILD_PROVIDED_MACROS +=
19
20 SHELL = /bin/sh
21
22 ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
23 ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
24 ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
25
26 # Sanity check user supplied values
27 $(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
28 $(call ERROR_IF_EMPTY, LUFA_PATH)
29 $(call ERROR_IF_EMPTY, ARCH)
30
31 # Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
32 LUFA_ROOT_PATH ?= $(patsubst %/,%,$(LUFA_PATH))
33
34 # Construct LUFA module source variables
35 LUFA_SRC_USB_COMMON := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBController_$(ARCH).c \
36 $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBInterrupt_$(ARCH).c \
37 $(LUFA_ROOT_PATH)/Drivers/USB/Core/ConfigDescriptors.c \
38 $(LUFA_ROOT_PATH)/Drivers/USB/Core/Events.c \
39 $(LUFA_ROOT_PATH)/Drivers/USB/Core/USBTask.c \
40 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Common/HIDParser.c \
41
42 LUFA_SRC_USB_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Host_$(ARCH).c \
43 $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Pipe_$(ARCH).c \
44 $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/PipeStream_$(ARCH).c \
45 $(LUFA_ROOT_PATH)/Drivers/USB/Core/HostStandardReq.c \
46 $(LUFA_SRC_USB_COMMON)
47
48 LUFA_SRC_USB_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Device_$(ARCH).c \
49 $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Endpoint_$(ARCH).c \
50 $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/EndpointStream_$(ARCH).c \
51 $(LUFA_ROOT_PATH)/Drivers/USB/Core/DeviceStandardReq.c \
52 $(LUFA_SRC_USB_COMMON)
53
54 LUFA_SRC_USBCLASS_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/AudioClassDevice.c \
55 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c \
56 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/HIDClassDevice.c \
57 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MassStorageClassDevice.c \
58 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDIClassDevice.c \
59 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/PrinterClassDevice.c \
60 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/RNDISClassDevice.c \
61
62 LUFA_SRC_USBCLASS_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c \
63 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AudioClassHost.c \
64 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/CDCClassHost.c \
65 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HIDClassHost.c \
66 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MassStorageClassHost.c \
67 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MIDIClassHost.c \
68 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/PrinterClassHost.c \
69 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/RNDISClassHost.c \
70 $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/StillImageClassHost.c
71
72 LUFA_SRC_USB := $(sort $(LUFA_SRC_USB_COMMON) $(LUFA_SRC_USB_HOST) $(LUFA_SRC_USB_DEVICE))
73
74 LUFA_SRC_USBCLASS := $(LUFA_SRC_USBCLASS_DEVICE) $(LUFA_SRC_USBCLASS_HOST)
75
76 LUFA_SRC_TEMPERATURE := $(LUFA_ROOT_PATH)/Drivers/Board/Temperature.c
77
78 LUFA_SRC_SERIAL := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/Serial_$(ARCH).c
79
80 LUFA_SRC_TWI := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/TWI_$(ARCH).c
81
82 ifeq ($(ARCH), UC3)
83 LUFA_SRC_PLATFORM := $(LUFA_ROOT_PATH)/Platform/UC3/Exception.S \
84 $(LUFA_ROOT_PATH)/Platform/UC3/InterruptManagement.c
85 else
86 LUFA_SRC_PLATFORM :=
87 endif
88
89 # Build a list of all available module sources
90 LUFA_SRC_ALL_FILES := $(LUFA_SRC_USB) \
91 $(LUFA_SRC_USBCLASS) \
92 $(LUFA_SRC_TEMPERATURE) \
93 $(LUFA_SRC_SERIAL) \
94 $(LUFA_SRC_TWI) \
95 $(LUFA_SRC_PLATFORM)