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.5KB

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