rules.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. SRC += drashna.c \
  2. process_records.c
  3. ifneq ($(PLATFORM),CHIBIOS)
  4. LTO_ENABLE = yes
  5. endif
  6. SPACE_CADET_ENABLE = no
  7. GRAVE_ESC_ENABLE = no
  8. ifneq ($(strip $(NO_SECRETS)), yes)
  9. ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
  10. SRC += secrets.c
  11. endif
  12. ifeq ($(strip $(NO_SECRETS)), lite)
  13. OPT_DEFS += -DNO_SECRETS
  14. endif
  15. endif
  16. CUSTOM_TAP_DANCE ?= yes
  17. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  18. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  19. SRC += tap_dances.c
  20. endif
  21. endif
  22. CUSTOM_RGBLIGHT ?= yes
  23. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  24. ifeq ($(strip $(CUSTOM_RGBLIGHT)), yes)
  25. SRC += rgb_stuff.c
  26. ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes)
  27. OPT_DEFS += -DRGBLIGHT_TWINKLE
  28. endif
  29. ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes)
  30. OPT_DEFS += -DRGBLIGHT_NOEEPROM
  31. endif
  32. ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes)
  33. OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION
  34. endif
  35. endif
  36. endif
  37. CUSTOM_RGB_MATRIX ?= yes
  38. ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
  39. ifeq ($(strip $(CUSTOM_RGB_MATRIX)), yes)
  40. SRC += rgb_matrix_stuff.c
  41. endif
  42. endif
  43. KEYLOGGER_ENABLE ?= no
  44. ifdef CONSOLE_ENABLE
  45. ifeq ($(strip $(KEYLOGGER_ENABLE)), yes)
  46. OPT_DEFS += -DKEYLOGGER_ENABLE
  47. endif
  48. endif
  49. ifeq ($(strip $(MAKE_BOOTLOADER)), yes)
  50. OPT_DEFS += -DMAKE_BOOTLOADER
  51. endif
  52. # At least until build.mk or the like drops, this is here to prevent
  53. # VUSB boards from enabling NKRO, as they do not support it. Ideally
  54. # this should be handled per keyboard, but until that happens ...
  55. ifeq ($(strip $(PROTOCOL)), VUSB)
  56. NKRO_ENABLE = no
  57. endif
  58. CUSTOM_OLED_DRIVER ?= yes
  59. ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
  60. ifeq ($(strip $(CUSTOM_OLED_DRIVER)), yes)
  61. SRC += oled_stuff.c
  62. endif
  63. endif
  64. ifeq ($(strip $(PIMORONI_TRACKBALL_ENABLE)), yes)
  65. POINTING_DEVICE_ENABLE := yes
  66. OPT_DEFS += -DPIMORONI_TRACKBALL_ENABLE
  67. SRC += pimoroni_trackball.c
  68. QUANTUM_LIB_SRC += i2c_master.c
  69. endif
  70. CUSTOM_SPLIT_TRANSPORT ?= yes
  71. ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
  72. ifneq ($(strip $(SPLIT_TRANSPORT)), custom)
  73. ifeq ($(strip $(CUSTOM_SPLIT_TRANSPORT)), yes)
  74. SPLIT_TRANSPORT = custom
  75. QUANTUM_LIB_SRC += drashna_transport.c
  76. OPT_DEFS += -DDRASHNA_CUSTOM_TRANSPORT
  77. # Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
  78. ifeq ($(PLATFORM),AVR)
  79. ifneq ($(NO_I2C),yes)
  80. QUANTUM_LIB_SRC += i2c_master.c \
  81. i2c_slave.c
  82. endif
  83. endif
  84. SERIAL_DRIVER ?= bitbang
  85. OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]'))
  86. ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
  87. QUANTUM_LIB_SRC += serial.c
  88. else
  89. QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c
  90. endif
  91. endif
  92. endif
  93. endif
  94. # DEBUG_MATRIX_SCAN_RATE_ENABLE = api