rules.mk 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  17. SRC += tap_dances.c
  18. endif
  19. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  20. SRC += rgb_stuff.c
  21. ifeq ($(strip $(RGBLIGHT_TWINKLE)), yes)
  22. OPT_DEFS += -DRGBLIGHT_TWINKLE
  23. endif
  24. ifeq ($(strip $(RGBLIGHT_NOEEPROM)), yes)
  25. OPT_DEFS += -DRGBLIGHT_NOEEPROM
  26. endif
  27. ifeq ($(strip $(RGBLIGHT_STARTUP_ANIMATION)), yes)
  28. OPT_DEFS += -DRGBLIGHT_STARTUP_ANIMATION
  29. endif
  30. endif
  31. RGB_MATRIX_ENABLE ?= no
  32. ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
  33. SRC += rgb_matrix_stuff.c
  34. endif
  35. ifdef CONSOLE_ENABLE
  36. ifeq ($(strip $(KEYLOGGER_ENABLE)), yes)
  37. OPT_DEFS += -DKEYLOGGER_ENABLE
  38. endif
  39. endif
  40. ifeq ($(strip $(MAKE_BOOTLOADER)), yes)
  41. OPT_DEFS += -DMAKE_BOOTLOADER
  42. endif
  43. # At least until build.mk or the like drops, this is here to prevent
  44. # VUSB boards from enabling NKRO, as they do not support it. Ideally
  45. # this should be handled per keyboard, but until that happens ...
  46. ifeq ($(strip $(PROTOCOL)), VUSB)
  47. NKRO_ENABLE = no
  48. endif
  49. ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
  50. SRC += oled_stuff.c
  51. endif
  52. ifeq ($(strip $(PIMORONI_TRACKBALL_ENABLE)), yes)
  53. POINTING_DEVICE_ENABLE := yes
  54. OPT_DEFS += -DPIMORONI_TRACKBALL_ENABLE
  55. SRC += pimoroni_trackball.c
  56. QUANTUM_LIB_SRC += i2c_master.c
  57. endif
  58. ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
  59. ifneq ($(strip $(SPLIT_TRANSPORT)), custom)
  60. SPLIT_TRANSPORT = custom
  61. QUANTUM_LIB_SRC += drashna_transport.c
  62. OPT_DEFS += -DDRASHNA_CUSTOM_TRANSPORT
  63. # Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
  64. ifeq ($(PLATFORM),AVR)
  65. ifneq ($(NO_I2C),yes)
  66. QUANTUM_LIB_SRC += i2c_master.c \
  67. i2c_slave.c
  68. endif
  69. endif
  70. SERIAL_DRIVER ?= bitbang
  71. OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]'))
  72. ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
  73. QUANTUM_LIB_SRC += serial.c
  74. else
  75. QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c
  76. endif
  77. endif
  78. endif