rules.mk 3.6 KB

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