Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

common.mk 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. COMMON_DIR = common
  2. SRC += $(COMMON_DIR)/host.c \
  3. $(COMMON_DIR)/keyboard.c \
  4. $(COMMON_DIR)/action.c \
  5. $(COMMON_DIR)/action_tapping.c \
  6. $(COMMON_DIR)/action_macro.c \
  7. $(COMMON_DIR)/action_layer.c \
  8. $(COMMON_DIR)/action_util.c \
  9. $(COMMON_DIR)/print.c \
  10. $(COMMON_DIR)/debug.c \
  11. $(COMMON_DIR)/util.c \
  12. $(COMMON_DIR)/hook.c \
  13. $(COMMON_DIR)/avr/suspend.c \
  14. $(COMMON_DIR)/avr/xprintf.S \
  15. $(COMMON_DIR)/avr/timer.c \
  16. $(COMMON_DIR)/avr/bootloader.c
  17. # Option modules
  18. ifeq (yes,$(strip $(UNIMAP_ENABLE)))
  19. SRC += $(COMMON_DIR)/unimap.c
  20. OPT_DEFS += -DUNIMAP_ENABLE
  21. else
  22. ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
  23. SRC += $(COMMON_DIR)/actionmap.c
  24. OPT_DEFS += -DACTIONMAP_ENABLE
  25. else
  26. SRC += $(COMMON_DIR)/keymap.c
  27. endif
  28. endif
  29. ifeq (yes,$(strip $(BOOTMAGIC_ENABLE)))
  30. SRC += $(COMMON_DIR)/bootmagic.c
  31. SRC += $(COMMON_DIR)/avr/eeconfig.c
  32. OPT_DEFS += -DBOOTMAGIC_ENABLE
  33. endif
  34. ifeq (yes,$(strip $(MOUSEKEY_ENABLE)))
  35. SRC += $(COMMON_DIR)/mousekey.c
  36. OPT_DEFS += -DMOUSEKEY_ENABLE
  37. OPT_DEFS += -DMOUSE_ENABLE
  38. endif
  39. ifeq (yes,$(strip $(EXTRAKEY_ENABLE)))
  40. OPT_DEFS += -DEXTRAKEY_ENABLE
  41. endif
  42. ifeq (yes,$(strip $(CONSOLE_ENABLE)))
  43. OPT_DEFS += -DCONSOLE_ENABLE
  44. else
  45. OPT_DEFS += -DNO_PRINT
  46. OPT_DEFS += -DNO_DEBUG
  47. endif
  48. ifeq (yes,$(strip $(COMMAND_ENABLE)))
  49. SRC += $(COMMON_DIR)/command.c
  50. OPT_DEFS += -DCOMMAND_ENABLE
  51. endif
  52. ifeq (yes,$(strip $(NKRO_ENABLE)))
  53. OPT_DEFS += -DNKRO_ENABLE
  54. endif
  55. ifeq (yes,$(strip $(USB_6KRO_ENABLE)))
  56. OPT_DEFS += -DUSB_6KRO_ENABLE
  57. endif
  58. ifeq (yes, $(strip $(KEYBOARD_LOCK_ENABLE)))
  59. OPT_DEFS += -DKEYBOARD_LOCK_ENABLE
  60. endif
  61. ifeq (yes,$(strip $(SLEEP_LED_ENABLE)))
  62. SRC += $(COMMON_DIR)/avr/sleep_led.c
  63. OPT_DEFS += -DSLEEP_LED_ENABLE
  64. OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
  65. endif
  66. ifeq (yes,$(strip $(BACKLIGHT_ENABLE)))
  67. SRC += $(COMMON_DIR)/backlight.c
  68. OPT_DEFS += -DBACKLIGHT_ENABLE
  69. endif
  70. ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE)))
  71. OPT_DEFS += -DKEYMAP_SECTION_ENABLE
  72. ifeq ($(strip $(MCU)),atmega32u2)
  73. EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
  74. else ifeq ($(strip $(MCU)),atmega32u4)
  75. EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
  76. else
  77. EXTRALDFLAGS = $(error no ldscript for keymap section)
  78. endif
  79. endif
  80. # Version string
  81. VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
  82. OPT_DEFS += -DVERSION=$(VERSION)
  83. # Search Path
  84. VPATH += $(TMK_DIR)/common