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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

common.mk 2.1KB

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