rules.mk 3.5 KB

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