common_features.mk 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 ($(PLATFORM),AVR)
  22. COMMON_VPATH += $(DRIVER_PATH)/avr
  23. else
  24. COMMON_VPATH += $(DRIVER_PATH)/arm
  25. endif
  26. ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
  27. OPT_DEFS += -DAPI_SYSEX_ENABLE
  28. SRC += $(QUANTUM_DIR)/api/api_sysex.c
  29. OPT_DEFS += -DAPI_ENABLE
  30. SRC += $(QUANTUM_DIR)/api.c
  31. MIDI_ENABLE=yes
  32. endif
  33. MUSIC_ENABLE := 0
  34. ifeq ($(strip $(AUDIO_ENABLE)), yes)
  35. OPT_DEFS += -DAUDIO_ENABLE
  36. MUSIC_ENABLE := 1
  37. SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
  38. ifeq ($(PLATFORM),AVR)
  39. SRC += $(QUANTUM_DIR)/audio/audio.c
  40. else
  41. SRC += $(QUANTUM_DIR)/audio/audio_arm.c
  42. endif
  43. SRC += $(QUANTUM_DIR)/audio/voices.c
  44. SRC += $(QUANTUM_DIR)/audio/luts.c
  45. endif
  46. ifeq ($(strip $(MIDI_ENABLE)), yes)
  47. OPT_DEFS += -DMIDI_ENABLE
  48. MUSIC_ENABLE := 1
  49. SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
  50. endif
  51. ifeq ($(MUSIC_ENABLE), 1)
  52. SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
  53. endif
  54. ifeq ($(strip $(COMBO_ENABLE)), yes)
  55. OPT_DEFS += -DCOMBO_ENABLE
  56. SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
  57. endif
  58. ifeq ($(strip $(STENO_ENABLE)), yes)
  59. OPT_DEFS += -DSTENO_ENABLE
  60. VIRTSER_ENABLE := yes
  61. SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
  62. endif
  63. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  64. OPT_DEFS += -DVIRTSER_ENABLE
  65. endif
  66. ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
  67. OPT_DEFS += -DFAUXCLICKY_ENABLE
  68. SRC += $(QUANTUM_DIR)/fauxclicky.c
  69. endif
  70. ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
  71. OPT_DEFS += -DPOINTING_DEVICE_ENABLE
  72. OPT_DEFS += -DMOUSE_ENABLE
  73. SRC += $(QUANTUM_DIR)/pointing_device.c
  74. endif
  75. ifeq ($(strip $(UCIS_ENABLE)), yes)
  76. OPT_DEFS += -DUCIS_ENABLE
  77. UNICODE_COMMON = yes
  78. SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
  79. endif
  80. ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
  81. OPT_DEFS += -DUNICODEMAP_ENABLE
  82. UNICODE_COMMON = yes
  83. SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
  84. endif
  85. ifeq ($(strip $(UNICODE_ENABLE)), yes)
  86. OPT_DEFS += -DUNICODE_ENABLE
  87. UNICODE_COMMON = yes
  88. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
  89. endif
  90. ifeq ($(strip $(UNICODE_COMMON)), yes)
  91. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
  92. endif
  93. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  94. OPT_DEFS += -DRGBLIGHT_ENABLE
  95. SRC += $(QUANTUM_DIR)/rgblight.c
  96. CIE1931_CURVE = yes
  97. LED_BREATHING_TABLE = yes
  98. ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
  99. OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
  100. else
  101. SRC += ws2812.c
  102. endif
  103. endif
  104. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  105. OPT_DEFS += -DTAP_DANCE_ENABLE
  106. SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
  107. endif
  108. ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
  109. OPT_DEFS += -DKEY_LOCK_ENABLE
  110. SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
  111. endif
  112. ifeq ($(strip $(PRINTING_ENABLE)), yes)
  113. OPT_DEFS += -DPRINTING_ENABLE
  114. SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
  115. SRC += $(TMK_DIR)/protocol/serial_uart.c
  116. endif
  117. ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
  118. OPT_DEFS += -DAUTO_SHIFT_ENABLE
  119. SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
  120. endif
  121. ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
  122. SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
  123. OPT_DEFS += $(SERIAL_DEFS)
  124. VAPTH += $(SERIAL_PATH)
  125. endif
  126. ifneq ($(strip $(VARIABLE_TRACE)),)
  127. SRC += $(QUANTUM_DIR)/variable_trace.c
  128. OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
  129. ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
  130. OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
  131. endif
  132. endif
  133. ifeq ($(strip $(LCD_ENABLE)), yes)
  134. CIE1931_CURVE = yes
  135. endif
  136. ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
  137. ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
  138. CIE1931_CURVE = yes
  139. endif
  140. ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
  141. OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
  142. endif
  143. endif
  144. ifeq ($(strip $(CIE1931_CURVE)), yes)
  145. OPT_DEFS += -DUSE_CIE1931_CURVE
  146. LED_TABLES = yes
  147. endif
  148. ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
  149. OPT_DEFS += -DUSE_LED_BREATHING_TABLE
  150. LED_TABLES = yes
  151. endif
  152. ifeq ($(strip $(LED_TABLES)), yes)
  153. SRC += $(QUANTUM_DIR)/led_tables.c
  154. endif
  155. ifeq ($(strip $(TERMINAL_ENABLE)), yes)
  156. SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
  157. OPT_DEFS += -DTERMINAL_ENABLE
  158. endif
  159. ifeq ($(strip $(USB_HID_ENABLE)), yes)
  160. include $(TMK_DIR)/protocol/usb_hid.mk
  161. endif
  162. ifeq ($(strip $(I2C_SLAVE_ENABLE)), yes)
  163. SRC += twi2c.c
  164. OPT_DEFS += -DI2C_SLAVE_ENABLE
  165. endif
  166. QUANTUM_SRC:= \
  167. $(QUANTUM_DIR)/quantum.c \
  168. $(QUANTUM_DIR)/keymap_common.c \
  169. $(QUANTUM_DIR)/keycode_config.c \
  170. $(QUANTUM_DIR)/process_keycode/process_leader.c
  171. ifndef CUSTOM_MATRIX
  172. QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
  173. endif