upload
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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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)/keymap.c \
  10. $(COMMON_DIR)/print.c \
  11. $(COMMON_DIR)/debug.c \
  12. $(COMMON_DIR)/util.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 ($(strip $(BOOTMAGIC_ENABLE)), yes)
  19. SRC += $(COMMON_DIR)/bootmagic.c
  20. SRC += $(COMMON_DIR)/avr/eeconfig.c
  21. OPT_DEFS += -DBOOTMAGIC_ENABLE
  22. else
  23. SRC += $(COMMON_DIR)/magic.c
  24. SRC += $(COMMON_DIR)/avr/eeconfig.c
  25. endif
  26. ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
  27. SRC += $(COMMON_DIR)/mousekey.c
  28. OPT_DEFS += -DMOUSEKEY_ENABLE
  29. OPT_DEFS += -DMOUSE_ENABLE
  30. endif
  31. ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
  32. OPT_DEFS += -DEXTRAKEY_ENABLE
  33. endif
  34. ifeq ($(strip $(CONSOLE_ENABLE)), yes)
  35. OPT_DEFS += -DCONSOLE_ENABLE
  36. else
  37. OPT_DEFS += -DNO_PRINT
  38. OPT_DEFS += -DNO_DEBUG
  39. endif
  40. ifeq ($(strip $(COMMAND_ENABLE)), yes)
  41. SRC += $(COMMON_DIR)/command.c
  42. OPT_DEFS += -DCOMMAND_ENABLE
  43. endif
  44. ifeq ($(strip $(NKRO_ENABLE)), yes)
  45. OPT_DEFS += -DNKRO_ENABLE
  46. endif
  47. ifeq ($(strip $(MIDI_ENABLE)), yes)
  48. OPT_DEFS += -DMIDI_ENABLE
  49. endif
  50. ifeq ($(strip $(AUDIO_ENABLE)), yes)
  51. OPT_DEFS += -DAUDIO_ENABLE
  52. endif
  53. ifeq ($(strip $(UNICODE_ENABLE)), yes)
  54. OPT_DEFS += -DUNICODE_ENABLE
  55. endif
  56. ifeq ($(strip $(USB_6KRO_ENABLE)), yes)
  57. OPT_DEFS += -DUSB_6KRO_ENABLE
  58. endif
  59. ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
  60. SRC += $(COMMON_DIR)/sleep_led.c
  61. OPT_DEFS += -DSLEEP_LED_ENABLE
  62. OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
  63. endif
  64. ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
  65. SRC += $(COMMON_DIR)/backlight.c
  66. SRC += $(COMMON_DIR)/avr/eeconfig.c
  67. OPT_DEFS += -DBACKLIGHT_ENABLE
  68. endif
  69. ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
  70. OPT_DEFS += -DBLUETOOTH_ENABLE
  71. endif
  72. ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
  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. OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
  84. # Search Path
  85. VPATH += $(TMK_DIR)/common