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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. else
  23. ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
  24. SRC += $(COMMON_DIR)/actionmap.c
  25. OPT_DEFS += -DACTIONMAP_ENABLE
  26. else
  27. SRC += $(COMMON_DIR)/keymap.c
  28. endif
  29. endif
  30. ifeq (yes,$(strip $(BOOTMAGIC_ENABLE)))
  31. SRC += $(COMMON_DIR)/bootmagic.c
  32. SRC += $(COMMON_DIR)/avr/eeconfig.c
  33. OPT_DEFS += -DBOOTMAGIC_ENABLE
  34. endif
  35. ifeq (yes,$(strip $(MOUSEKEY_ENABLE)))
  36. SRC += $(COMMON_DIR)/mousekey.c
  37. OPT_DEFS += -DMOUSEKEY_ENABLE
  38. OPT_DEFS += -DMOUSE_ENABLE
  39. endif
  40. ifeq (yes,$(strip $(EXTRAKEY_ENABLE)))
  41. OPT_DEFS += -DEXTRAKEY_ENABLE
  42. endif
  43. ifeq (yes,$(strip $(CONSOLE_ENABLE)))
  44. OPT_DEFS += -DCONSOLE_ENABLE
  45. else
  46. OPT_DEFS += -DNO_PRINT
  47. OPT_DEFS += -DNO_DEBUG
  48. endif
  49. ifeq (yes,$(strip $(COMMAND_ENABLE)))
  50. SRC += $(COMMON_DIR)/command.c
  51. OPT_DEFS += -DCOMMAND_ENABLE
  52. endif
  53. ifeq (yes,$(strip $(NKRO_ENABLE)))
  54. OPT_DEFS += -DNKRO_ENABLE
  55. endif
  56. ifeq (yes,$(strip $(USB_6KRO_ENABLE)))
  57. OPT_DEFS += -DUSB_6KRO_ENABLE
  58. endif
  59. ifeq (yes, $(strip $(KEYBOARD_LOCK_ENABLE)))
  60. OPT_DEFS += -DKEYBOARD_LOCK_ENABLE
  61. endif
  62. ifeq (yes,$(strip $(SLEEP_LED_ENABLE)))
  63. SRC += $(COMMON_DIR)/avr/sleep_led.c
  64. OPT_DEFS += -DSLEEP_LED_ENABLE
  65. OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
  66. endif
  67. ifeq (yes,$(strip $(BACKLIGHT_ENABLE)))
  68. SRC += $(COMMON_DIR)/backlight.c
  69. OPT_DEFS += -DBACKLIGHT_ENABLE
  70. endif
  71. ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE)))
  72. OPT_DEFS += -DKEYMAP_SECTION_ENABLE
  73. ifeq ($(strip $(MCU)),atmega32u2)
  74. EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
  75. else ifeq ($(strip $(MCU)),atmega32u4)
  76. EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
  77. else
  78. EXTRALDFLAGS = $(error no ldscript for keymap section)
  79. endif
  80. endif
  81. # Version string
  82. VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
  83. OPT_DEFS += -DVERSION=$(VERSION)
  84. # Search Path
  85. VPATH += $(TMK_DIR)/common