rules.mk 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. SRC += $(USER_PATH)/drashna.c \
  2. $(USER_PATH)/callbacks.c \
  3. $(USER_PATH)/keyrecords/process_records.c \
  4. $(USER_PATH)/keyrecords/tapping.c
  5. ifneq ($(PLATFORM),CHIBIOS)
  6. ifneq ($(strip $(LTO_SUPPORTED)), no)
  7. LTO_ENABLE = yes
  8. endif
  9. endif
  10. SPACE_CADET_ENABLE = no
  11. GRAVE_ESC_ENABLE = no
  12. # DEBUG_MATRIX_SCAN_RATE_ENABLE = api
  13. ifneq ($(strip $(NO_SECRETS)), yes)
  14. ifneq ("$(wildcard $(USER_PATH)/keyrecords/secrets.c)","")
  15. SRC += $(USER_PATH)/keyrecords/secrets.c
  16. endif
  17. ifeq ($(strip $(NO_SECRETS)), lite)
  18. OPT_DEFS += -DNO_SECRETS
  19. endif
  20. endif
  21. ifeq ($(strip $(MAKE_BOOTLOADER)), yes)
  22. OPT_DEFS += -DMAKE_BOOTLOADER
  23. endif
  24. # At least until build.mk or the like drops, this is here to prevent
  25. # VUSB boards from enabling NKRO, as they do not support it. Ideally
  26. # this should be handled per keyboard, but until that happens ...
  27. ifeq ($(strip $(PROTOCOL)), VUSB)
  28. NKRO_ENABLE := no
  29. endif
  30. CUSTOM_UNICODE_ENABLE ?= yes
  31. ifeq ($(strip $(CUSTOM_UNICODE_ENABLE)), yes)
  32. UNICODE_ENABLE := no
  33. UNICODEMAP_ENABLE := no
  34. UCIS_ENABLE := no
  35. UNICODE_COMMON := yes
  36. OPT_DEFS += -DCUSTOM_UNICODE_ENABLE
  37. SRC += $(USER_PATH)/keyrecords/unicode.c
  38. endif
  39. CUSTOM_TAP_DANCE ?= yes
  40. ifeq ($(strip $(CUSTOM_TAP_DANCE)), yes)
  41. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  42. SRC += $(USER_PATH)/keyrecords/tap_dances.c
  43. endif
  44. endif
  45. CUSTOM_RGBLIGHT ?= yes
  46. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  47. ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes)
  48. SRC += $(USER_PATH)/rgb/rgb_stuff.c
  49. ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes)
  50. OPT_DEFS += -DRGBLIGHT_NOEEPROM
  51. endif
  52. ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes)
  53. OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION
  54. DEFERRED_EXEC_ENABLE = yes
  55. endif
  56. endif
  57. endif
  58. CUSTOM_RGB_MATRIX ?= yes
  59. ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
  60. ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes)
  61. SRC += $(USER_PATH)/rgb/rgb_matrix_stuff.c
  62. endif
  63. endif
  64. KEYLOGGER_ENABLE ?= no
  65. ifdef CONSOLE_ENABLE
  66. ifeq ($(strip $(KEYLOGGER_ENABLE)), yes)
  67. OPT_DEFS += -DKEYLOGGER_ENABLE
  68. endif
  69. endif
  70. CUSTOM_OLED_DRIVER ?= yes
  71. ifeq ($(strip $(OLED_ENABLE)), yes)
  72. ifeq ($(strip $(OLED_DRIVER)), custom)
  73. OPT_DEFS += -DOLED_ENABLE \
  74. -DOLED_DRIVER_SH1107
  75. SRC += $(USER_PATH)/oled/sh110x.c
  76. QUANTUM_LIB_SRC += i2c_master.c
  77. endif
  78. ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes)
  79. OPT_DEFS += -DCUSTOM_OLED_DRIVER_CODE
  80. SRC += $(USER_PATH)/oled/oled_stuff.c
  81. endif
  82. ifeq ($(strip $(OLED_DISPLAY_TEST)), yes)
  83. OPT_DEFS += -DOLED_DISPLAY_TEST
  84. endif
  85. DEFERRED_EXEC_ENABLE = yes
  86. endif
  87. CUSTOM_POINTING_DEVICE ?= yes
  88. ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
  89. ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes)
  90. SRC += $(USER_PATH)/pointing/pointing.c
  91. endif
  92. endif
  93. CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes
  94. ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes)
  95. ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
  96. QUANTUM_LIB_SRC += $(USER_PATH)/split/transport_sync.c
  97. OPT_DEFS += -DCUSTOM_SPLIT_TRANSPORT_SYNC
  98. endif
  99. endif
  100. AUTOCORRECTION_ENABLE ?= no
  101. ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes)
  102. SRC += $(USER_PATH)/keyrecords/autocorrection/autocorrection.c
  103. OPT_DEFS += -DAUTOCORRECTION_ENABLE
  104. endif
  105. CAPS_WORD_ENABLE ?= no
  106. ifeq ($(strip $(CAPS_WORD_ENABLE)), yes)
  107. SRC += $(USER_PATH)/keyrecords/caps_word.c
  108. OPT_DEFS += -DCAPS_WORD_ENABLE
  109. endif