lufa.mk 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. LUFA_DIR = protocol/lufa
  2. # Path to the LUFA library
  3. LUFA_PATH ?= $(LUFA_DIR)/LUFA-git
  4. # Create the LUFA source path variables by including the LUFA makefile
  5. ifneq (, $(wildcard $(TMK_PATH)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk))
  6. # New build system from 20120730
  7. LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA
  8. include $(TMK_PATH)/$(LUFA_PATH)/LUFA/Build/lufa_sources.mk
  9. else
  10. include $(TMK_PATH)/$(LUFA_PATH)/LUFA/makefile
  11. endif
  12. LUFA_SRC = lufa.c \
  13. descriptor.c \
  14. $(LUFA_SRC_USB)
  15. ifeq ($(strip $(MIDI_ENABLE)), yes)
  16. include $(TMK_PATH)/protocol/midi.mk
  17. endif
  18. ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
  19. LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
  20. $(TMK_DIR)/protocol/serial_uart.c
  21. endif
  22. SRC += $(LUFA_SRC)
  23. # Search Path
  24. VPATH += $(TMK_PATH)/$(LUFA_DIR)
  25. VPATH += $(TMK_PATH)/$(LUFA_PATH)
  26. # Option modules
  27. #ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
  28. #endif
  29. #ifdef EXTRAKEY_ENABLE
  30. #endif
  31. # LUFA library compile-time options and predefined tokens
  32. LUFA_OPTS = -DUSB_DEVICE_ONLY
  33. LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS
  34. LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
  35. #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT
  36. LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8
  37. LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1
  38. OPT_DEFS += -DF_USB=$(F_USB)UL
  39. OPT_DEFS += -DARCH=ARCH_$(ARCH)
  40. OPT_DEFS += $(LUFA_OPTS)
  41. # This indicates using LUFA stack
  42. OPT_DEFS += -DPROTOCOL_LUFA