common_features.mk 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
  21. OPT_DEFS += -DAPI_SYSEX_ENABLE
  22. SRC += $(QUANTUM_DIR)/api/api_sysex.c
  23. OPT_DEFS += -DAPI_ENABLE
  24. SRC += $(QUANTUM_DIR)/api.c
  25. MIDI_ENABLE=yes
  26. endif
  27. MUSIC_ENABLE := 0
  28. ifeq ($(strip $(AUDIO_ENABLE)), yes)
  29. OPT_DEFS += -DAUDIO_ENABLE
  30. MUSIC_ENABLE := 1
  31. SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
  32. SRC += $(QUANTUM_DIR)/audio/audio.c
  33. SRC += $(QUANTUM_DIR)/audio/voices.c
  34. SRC += $(QUANTUM_DIR)/audio/luts.c
  35. endif
  36. ifeq ($(strip $(MIDI_ENABLE)), yes)
  37. OPT_DEFS += -DMIDI_ENABLE
  38. MUSIC_ENABLE := 1
  39. SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
  40. endif
  41. ifeq ($(MUSIC_ENABLE), 1)
  42. SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
  43. endif
  44. ifeq ($(strip $(COMBO_ENABLE)), yes)
  45. OPT_DEFS += -DCOMBO_ENABLE
  46. SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
  47. endif
  48. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  49. OPT_DEFS += -DVIRTSER_ENABLE
  50. endif
  51. ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
  52. OPT_DEFS += -DFAUXCLICKY_ENABLE
  53. SRC += $(QUANTUM_DIR)/fauxclicky.c
  54. endif
  55. ifeq ($(strip $(UCIS_ENABLE)), yes)
  56. OPT_DEFS += -DUCIS_ENABLE
  57. UNICODE_COMMON = yes
  58. SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
  59. endif
  60. ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
  61. OPT_DEFS += -DUNICODEMAP_ENABLE
  62. UNICODE_COMMON = yes
  63. SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
  64. endif
  65. ifeq ($(strip $(UNICODE_ENABLE)), yes)
  66. OPT_DEFS += -DUNICODE_ENABLE
  67. UNICODE_COMMON = yes
  68. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
  69. endif
  70. ifeq ($(strip $(UNICODE_COMMON)), yes)
  71. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
  72. endif
  73. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  74. OPT_DEFS += -DRGBLIGHT_ENABLE
  75. SRC += $(QUANTUM_DIR)/light_ws2812.c
  76. SRC += $(QUANTUM_DIR)/rgblight.c
  77. CIE1931_CURVE = yes
  78. LED_BREATHING_TABLE = yes
  79. endif
  80. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  81. OPT_DEFS += -DTAP_DANCE_ENABLE
  82. SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
  83. endif
  84. ifeq ($(strip $(PRINTING_ENABLE)), yes)
  85. OPT_DEFS += -DPRINTING_ENABLE
  86. SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
  87. SRC += $(TMK_DIR)/protocol/serial_uart.c
  88. endif
  89. ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
  90. SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
  91. OPT_DEFS += $(SERIAL_DEFS)
  92. VAPTH += $(SERIAL_PATH)
  93. endif
  94. ifneq ($(strip $(VARIABLE_TRACE)),)
  95. SRC += $(QUANTUM_DIR)/variable_trace.c
  96. OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
  97. ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
  98. OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
  99. endif
  100. endif
  101. ifeq ($(strip $(LCD_ENABLE)), yes)
  102. CIE1931_CURVE = yes
  103. endif
  104. ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
  105. ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
  106. CIE1931_CURVE = yes
  107. endif
  108. endif
  109. ifeq ($(strip $(CIE1931_CURVE)), yes)
  110. OPT_DEFS += -DUSE_CIE1931_CURVE
  111. LED_TABLES = yes
  112. endif
  113. ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
  114. OPT_DEFS += -DUSE_LED_BREATHING_TABLE
  115. LED_TABLES = yes
  116. endif
  117. ifeq ($(strip $(LED_TABLES)), yes)
  118. SRC += $(QUANTUM_DIR)/led_tables.c
  119. endif
  120. QUANTUM_SRC:= \
  121. $(QUANTUM_DIR)/quantum.c \
  122. $(QUANTUM_DIR)/keymap_common.c \
  123. $(QUANTUM_DIR)/keycode_config.c \
  124. $(QUANTUM_DIR)/process_keycode/process_leader.c
  125. ifndef CUSTOM_MATRIX
  126. QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
  127. endif