rules.mk 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. SPACE_CADET_ENABLE = no
  11. GRAVE_ESC_ENABLE = no
  12. endif
  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. ifeq ($(strip $(PER_KEY_TAPPING)), yes)
  34. OPT_DEFS += -DPER_KEY_TAPPING
  35. endif
  36. CUSTOM_UNICODE_ENABLE ?= yes
  37. ifeq ($(strip $(CUSTOM_UNICODE_ENABLE)), yes)
  38. UNICODE_ENABLE := no
  39. UNICODEMAP_ENABLE := no
  40. UCIS_ENABLE := no
  41. UNICODE_COMMON := yes
  42. OPT_DEFS += -DCUSTOM_UNICODE_ENABLE
  43. SRC += $(USER_PATH)/keyrecords/unicode.c
  44. endif
  45. CUSTOM_TAP_DANCE ?= yes
  46. ifeq ($(strip $(CUSTOM_TAP_DANCE)), yes)
  47. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  48. SRC += $(USER_PATH)/keyrecords/tap_dances.c
  49. endif
  50. endif
  51. CUSTOM_RGBLIGHT ?= yes
  52. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  53. ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes)
  54. SRC += $(USER_PATH)/rgb/rgb_stuff.c
  55. OPT_DEFS += -DCUSTOM_RGBLIGHT
  56. ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes)
  57. OPT_DEFS += -DRGBLIGHT_NOEEPROM
  58. endif
  59. ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes)
  60. OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION
  61. DEFERRED_EXEC_ENABLE = yes
  62. endif
  63. endif
  64. endif
  65. CUSTOM_RGB_MATRIX ?= yes
  66. ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
  67. ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes)
  68. SRC += $(USER_PATH)/rgb/rgb_matrix_stuff.c
  69. OPT_DEFS += -DCUSTOM_RGB_MATRIX
  70. endif
  71. endif
  72. KEYLOGGER_ENABLE ?= no
  73. ifdef CONSOLE_ENABLE
  74. ifeq ($(strip $(KEYLOGGER_ENABLE)), yes)
  75. OPT_DEFS += -DKEYLOGGER_ENABLE
  76. endif
  77. endif
  78. ifeq ($(strip $(I2C_SCANNER_ENABLE)), yes)
  79. OPT_DEFS += -DI2C_SCANNER_ENABLE
  80. CONSOLE_ENABLE := yes
  81. endif
  82. CUSTOM_OLED_DRIVER ?= yes
  83. ifeq ($(strip $(OLED_ENABLE)), yes)
  84. ifeq ($(strip $(OLED_DRIVER)), custom)
  85. OPT_DEFS += -DOLED_ENABLE \
  86. -DOLED_DRIVER_SH1107
  87. SRC += $(USER_PATH)/oled/sh110x.c
  88. QUANTUM_LIB_SRC += i2c_master.c
  89. endif
  90. ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes)
  91. OPT_DEFS += -DCUSTOM_OLED_DRIVER
  92. SRC += $(USER_PATH)/oled/oled_stuff.c
  93. endif
  94. ifeq ($(strip $(OLED_DISPLAY_TEST)), yes)
  95. OPT_DEFS += -DOLED_DISPLAY_TEST
  96. endif
  97. DEFERRED_EXEC_ENABLE = yes
  98. endif
  99. CUSTOM_POINTING_DEVICE ?= yes
  100. ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
  101. ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes)
  102. SRC += $(USER_PATH)/pointing/pointing.c
  103. OPT_DEFS += -DCUSTOM_POINTING_DEVICE
  104. OPT_DEFS += -DPOINTING_DEVICE_AUTO_MOUSE_ENABLE
  105. endif
  106. endif
  107. CUSTOM_SPLIT_TRANSPORT_SYNC ?= yes
  108. ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT_SYNC)), yes)
  109. ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
  110. QUANTUM_LIB_SRC += $(USER_PATH)/split/transport_sync.c
  111. OPT_DEFS += -DCUSTOM_SPLIT_TRANSPORT_SYNC
  112. endif
  113. endif
  114. ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes)
  115. AUTOCORRECT_ENABLE = yes
  116. endif
  117. CUSTOM_BOOTMAGIC_ENABLE ?= yes
  118. ifeq ($(strip $(CUSTOM_BOOTMAGIC_ENABLE)), yes)
  119. ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes)
  120. SRC += bootmagic_better.c
  121. endif
  122. endif