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

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