common_features.mk 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # Copyright 2017 Fred Sundvik
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. SERIAL_DIR := $(QUANTUM_DIR)/serial_link
  16. SERIAL_PATH := $(QUANTUM_PATH)/serial_link
  17. SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
  18. SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
  19. SERIAL_DEFS += -DSERIAL_LINK_ENABLE
  20. COMMON_VPATH += $(SERIAL_PATH)
  21. ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
  22. OPT_DEFS += -DAPI_SYSEX_ENABLE
  23. SRC += $(QUANTUM_DIR)/api/api_sysex.c
  24. OPT_DEFS += -DAPI_ENABLE
  25. SRC += $(QUANTUM_DIR)/api.c
  26. MIDI_ENABLE=yes
  27. endif
  28. MUSIC_ENABLE := 0
  29. ifeq ($(strip $(AUDIO_ENABLE)), yes)
  30. OPT_DEFS += -DAUDIO_ENABLE
  31. MUSIC_ENABLE := 1
  32. SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
  33. SRC += $(QUANTUM_DIR)/audio/audio.c
  34. SRC += $(QUANTUM_DIR)/audio/voices.c
  35. SRC += $(QUANTUM_DIR)/audio/luts.c
  36. endif
  37. ifeq ($(strip $(MIDI_ENABLE)), yes)
  38. OPT_DEFS += -DMIDI_ENABLE
  39. MUSIC_ENABLE := 1
  40. SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
  41. endif
  42. ifeq ($(MUSIC_ENABLE), 1)
  43. SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
  44. endif
  45. ifeq ($(strip $(COMBO_ENABLE)), yes)
  46. OPT_DEFS += -DCOMBO_ENABLE
  47. SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
  48. endif
  49. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  50. OPT_DEFS += -DVIRTSER_ENABLE
  51. endif
  52. ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
  53. OPT_DEFS += -DFAUXCLICKY_ENABLE
  54. SRC += $(QUANTUM_DIR)/fauxclicky.c
  55. endif
  56. ifeq ($(strip $(UCIS_ENABLE)), yes)
  57. OPT_DEFS += -DUCIS_ENABLE
  58. UNICODE_COMMON = yes
  59. SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
  60. endif
  61. ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
  62. OPT_DEFS += -DUNICODEMAP_ENABLE
  63. UNICODE_COMMON = yes
  64. SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
  65. endif
  66. ifeq ($(strip $(UNICODE_ENABLE)), yes)
  67. OPT_DEFS += -DUNICODE_ENABLE
  68. UNICODE_COMMON = yes
  69. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
  70. endif
  71. ifeq ($(strip $(UNICODE_COMMON)), yes)
  72. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
  73. endif
  74. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  75. OPT_DEFS += -DRGBLIGHT_ENABLE
  76. SRC += $(QUANTUM_DIR)/rgblight.c
  77. CIE1931_CURVE = yes
  78. LED_BREATHING_TABLE = yes
  79. ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
  80. OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
  81. else
  82. SRC += $(QUANTUM_DIR)/light_ws2812.c
  83. endif
  84. endif
  85. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  86. OPT_DEFS += -DTAP_DANCE_ENABLE
  87. SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
  88. endif
  89. ifeq ($(strip $(PRINTING_ENABLE)), yes)
  90. OPT_DEFS += -DPRINTING_ENABLE
  91. SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
  92. SRC += $(TMK_DIR)/protocol/serial_uart.c
  93. endif
  94. ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
  95. SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
  96. OPT_DEFS += $(SERIAL_DEFS)
  97. VAPTH += $(SERIAL_PATH)
  98. endif
  99. ifneq ($(strip $(VARIABLE_TRACE)),)
  100. SRC += $(QUANTUM_DIR)/variable_trace.c
  101. OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
  102. ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
  103. OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
  104. endif
  105. endif
  106. ifeq ($(strip $(LCD_ENABLE)), yes)
  107. CIE1931_CURVE = yes
  108. endif
  109. ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
  110. ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
  111. CIE1931_CURVE = yes
  112. endif
  113. endif
  114. ifeq ($(strip $(CIE1931_CURVE)), yes)
  115. OPT_DEFS += -DUSE_CIE1931_CURVE
  116. LED_TABLES = yes
  117. endif
  118. ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
  119. OPT_DEFS += -DUSE_LED_BREATHING_TABLE
  120. LED_TABLES = yes
  121. endif
  122. ifeq ($(strip $(LED_TABLES)), yes)
  123. SRC += $(QUANTUM_DIR)/led_tables.c
  124. endif
  125. QUANTUM_SRC:= \
  126. $(QUANTUM_DIR)/quantum.c \
  127. $(QUANTUM_DIR)/keymap_common.c \
  128. $(QUANTUM_DIR)/keycode_config.c \
  129. $(QUANTUM_DIR)/process_keycode/process_leader.c
  130. ifndef CUSTOM_MATRIX
  131. QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
  132. endif