You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
5.2 KiB

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