diff options
Diffstat (limited to 'common_features.mk')
| -rw-r--r-- | common_features.mk | 194 |
1 files changed, 95 insertions, 99 deletions
diff --git a/common_features.mk b/common_features.mk index 64ddc85fd..269ca2b13 100644 --- a/common_features.mk +++ b/common_features.mk | |||
| @@ -13,26 +13,24 @@ | |||
| 13 | # You should have received a copy of the GNU General Public License | 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/>. | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 | ||
| 16 | SERIAL_DIR := $(QUANTUM_DIR)/serial_link | ||
| 17 | SERIAL_PATH := $(QUANTUM_PATH)/serial_link | 16 | SERIAL_PATH := $(QUANTUM_PATH)/serial_link |
| 18 | SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c) | 17 | |
| 19 | SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) | 18 | QUANTUM_SRC += \ |
| 20 | SERIAL_DEFS += -DSERIAL_LINK_ENABLE | 19 | $(QUANTUM_DIR)/quantum.c \ |
| 21 | COMMON_VPATH += $(SERIAL_PATH) | 20 | $(QUANTUM_DIR)/keymap_common.c \ |
| 21 | $(QUANTUM_DIR)/keycode_config.c | ||
| 22 | 22 | ||
| 23 | ifeq ($(strip $(API_SYSEX_ENABLE)), yes) | 23 | ifeq ($(strip $(API_SYSEX_ENABLE)), yes) |
| 24 | OPT_DEFS += -DAPI_SYSEX_ENABLE | 24 | OPT_DEFS += -DAPI_SYSEX_ENABLE |
| 25 | SRC += $(QUANTUM_DIR)/api/api_sysex.c | ||
| 26 | OPT_DEFS += -DAPI_ENABLE | 25 | OPT_DEFS += -DAPI_ENABLE |
| 27 | SRC += $(QUANTUM_DIR)/api.c | ||
| 28 | MIDI_ENABLE=yes | 26 | MIDI_ENABLE=yes |
| 27 | SRC += $(QUANTUM_DIR)/api/api_sysex.c | ||
| 28 | SRC += $(QUANTUM_DIR)/api.c | ||
| 29 | endif | 29 | endif |
| 30 | 30 | ||
| 31 | MUSIC_ENABLE := 0 | ||
| 32 | |||
| 33 | ifeq ($(strip $(AUDIO_ENABLE)), yes) | 31 | ifeq ($(strip $(AUDIO_ENABLE)), yes) |
| 34 | OPT_DEFS += -DAUDIO_ENABLE | 32 | OPT_DEFS += -DAUDIO_ENABLE |
| 35 | MUSIC_ENABLE := 1 | 33 | MUSIC_ENABLE = yes |
| 36 | SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c | 34 | SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c |
| 37 | SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c | 35 | SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c |
| 38 | SRC += $(QUANTUM_DIR)/audio/audio_$(PLATFORM_KEY).c | 36 | SRC += $(QUANTUM_DIR)/audio/audio_$(PLATFORM_KEY).c |
| @@ -42,19 +40,15 @@ endif | |||
| 42 | 40 | ||
| 43 | ifeq ($(strip $(MIDI_ENABLE)), yes) | 41 | ifeq ($(strip $(MIDI_ENABLE)), yes) |
| 44 | OPT_DEFS += -DMIDI_ENABLE | 42 | OPT_DEFS += -DMIDI_ENABLE |
| 45 | MUSIC_ENABLE := 1 | 43 | MUSIC_ENABLE = yes |
| 46 | SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c | 44 | SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c |
| 47 | endif | 45 | endif |
| 48 | 46 | ||
| 49 | ifeq ($(MUSIC_ENABLE), 1) | 47 | MUSIC_ENABLE ?= no |
| 48 | ifeq ($(MUSIC_ENABLE), yes) | ||
| 50 | SRC += $(QUANTUM_DIR)/process_keycode/process_music.c | 49 | SRC += $(QUANTUM_DIR)/process_keycode/process_music.c |
| 51 | endif | 50 | endif |
| 52 | 51 | ||
| 53 | ifeq ($(strip $(COMBO_ENABLE)), yes) | ||
| 54 | OPT_DEFS += -DCOMBO_ENABLE | ||
| 55 | SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c | ||
| 56 | endif | ||
| 57 | |||
| 58 | ifeq ($(strip $(STENO_ENABLE)), yes) | 52 | ifeq ($(strip $(STENO_ENABLE)), yes) |
| 59 | OPT_DEFS += -DSTENO_ENABLE | 53 | OPT_DEFS += -DSTENO_ENABLE |
| 60 | VIRTSER_ENABLE ?= yes | 54 | VIRTSER_ENABLE ?= yes |
| @@ -76,28 +70,6 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) | |||
| 76 | SRC += $(QUANTUM_DIR)/pointing_device.c | 70 | SRC += $(QUANTUM_DIR)/pointing_device.c |
| 77 | endif | 71 | endif |
| 78 | 72 | ||
| 79 | ifeq ($(strip $(UCIS_ENABLE)), yes) | ||
| 80 | OPT_DEFS += -DUCIS_ENABLE | ||
| 81 | UNICODE_COMMON := yes | ||
| 82 | SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c | ||
| 83 | endif | ||
| 84 | |||
| 85 | ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) | ||
| 86 | OPT_DEFS += -DUNICODEMAP_ENABLE | ||
| 87 | UNICODE_COMMON := yes | ||
| 88 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c | ||
| 89 | endif | ||
| 90 | |||
| 91 | ifeq ($(strip $(UNICODE_ENABLE)), yes) | ||
| 92 | OPT_DEFS += -DUNICODE_ENABLE | ||
| 93 | UNICODE_COMMON := yes | ||
| 94 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c | ||
| 95 | endif | ||
| 96 | |||
| 97 | ifeq ($(strip $(UNICODE_COMMON)), yes) | ||
| 98 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c | ||
| 99 | endif | ||
| 100 | |||
| 101 | VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c | 73 | VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c |
| 102 | EEPROM_DRIVER ?= vendor | 74 | EEPROM_DRIVER ?= vendor |
| 103 | ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),) | 75 | ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),) |
| @@ -245,31 +217,18 @@ ifeq ($(strip $(RGB_KEYCODES_ENABLE)), yes) | |||
| 245 | SRC += $(QUANTUM_DIR)/process_keycode/process_rgb.c | 217 | SRC += $(QUANTUM_DIR)/process_keycode/process_rgb.c |
| 246 | endif | 218 | endif |
| 247 | 219 | ||
| 248 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) | ||
| 249 | OPT_DEFS += -DTAP_DANCE_ENABLE | ||
| 250 | SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c | ||
| 251 | endif | ||
| 252 | |||
| 253 | ifeq ($(strip $(KEY_LOCK_ENABLE)), yes) | ||
| 254 | OPT_DEFS += -DKEY_LOCK_ENABLE | ||
| 255 | SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c | ||
| 256 | endif | ||
| 257 | |||
| 258 | ifeq ($(strip $(PRINTING_ENABLE)), yes) | 220 | ifeq ($(strip $(PRINTING_ENABLE)), yes) |
| 259 | OPT_DEFS += -DPRINTING_ENABLE | 221 | OPT_DEFS += -DPRINTING_ENABLE |
| 260 | SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c | 222 | SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c |
| 261 | SRC += $(TMK_DIR)/protocol/serial_uart.c | 223 | SRC += $(TMK_DIR)/protocol/serial_uart.c |
| 262 | endif | 224 | endif |
| 263 | 225 | ||
| 264 | ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) | ||
| 265 | OPT_DEFS += -DAUTO_SHIFT_ENABLE | ||
| 266 | SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c | ||
| 267 | ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes) | ||
| 268 | OPT_DEFS += -DAUTO_SHIFT_MODIFIERS | ||
| 269 | endif | ||
| 270 | endif | ||
| 271 | |||
| 272 | ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) | 226 | ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) |
| 227 | SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c) | ||
| 228 | SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) | ||
| 229 | SERIAL_DEFS += -DSERIAL_LINK_ENABLE | ||
| 230 | COMMON_VPATH += $(SERIAL_PATH) | ||
| 231 | |||
| 273 | SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) | 232 | SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) |
| 274 | OPT_DEFS += $(SERIAL_DEFS) | 233 | OPT_DEFS += $(SERIAL_DEFS) |
| 275 | VAPTH += $(SERIAL_PATH) | 234 | VAPTH += $(SERIAL_PATH) |
| @@ -368,29 +327,6 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes) | |||
| 368 | OPT_DEFS += -DENCODER_ENABLE | 327 | OPT_DEFS += -DENCODER_ENABLE |
| 369 | endif | 328 | endif |
| 370 | 329 | ||
| 371 | HAPTIC_ENABLE ?= no | ||
| 372 | ifneq ($(strip $(HAPTIC_ENABLE)),no) | ||
| 373 | COMMON_VPATH += $(DRIVER_PATH)/haptic | ||
| 374 | SRC += haptic.c | ||
| 375 | OPT_DEFS += -DHAPTIC_ENABLE | ||
| 376 | endif | ||
| 377 | |||
| 378 | ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), ) | ||
| 379 | SRC += DRV2605L.c | ||
| 380 | QUANTUM_LIB_SRC += i2c_master.c | ||
| 381 | OPT_DEFS += -DDRV2605L | ||
| 382 | endif | ||
| 383 | |||
| 384 | ifneq ($(filter SOLENOID, $(HAPTIC_ENABLE)), ) | ||
| 385 | SRC += solenoid.c | ||
| 386 | OPT_DEFS += -DSOLENOID_ENABLE | ||
| 387 | endif | ||
| 388 | |||
| 389 | ifeq ($(strip $(HD44780_ENABLE)), yes) | ||
| 390 | SRC += drivers/avr/hd44780.c | ||
| 391 | OPT_DEFS += -DHD44780_ENABLE | ||
| 392 | endif | ||
| 393 | |||
| 394 | ifeq ($(strip $(VELOCIKEY_ENABLE)), yes) | 330 | ifeq ($(strip $(VELOCIKEY_ENABLE)), yes) |
| 395 | OPT_DEFS += -DVELOCIKEY_ENABLE | 331 | OPT_DEFS += -DVELOCIKEY_ENABLE |
| 396 | SRC += $(QUANTUM_DIR)/velocikey.c | 332 | SRC += $(QUANTUM_DIR)/velocikey.c |
| @@ -409,26 +345,11 @@ ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes) | |||
| 409 | SRC += $(QUANTUM_DIR)/dynamic_keymap.c | 345 | SRC += $(QUANTUM_DIR)/dynamic_keymap.c |
| 410 | endif | 346 | endif |
| 411 | 347 | ||
| 412 | ifeq ($(strip $(LEADER_ENABLE)), yes) | ||
| 413 | SRC += $(QUANTUM_DIR)/process_keycode/process_leader.c | ||
| 414 | OPT_DEFS += -DLEADER_ENABLE | ||
| 415 | endif | ||
| 416 | |||
| 417 | |||
| 418 | ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes) | 348 | ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes) |
| 419 | SRC += $(QUANTUM_DIR)/dip_switch.c | 349 | OPT_DEFS += -DDIP_SWITCH_ENABLE |
| 420 | OPT_DEFS += -DDIP_SWITCH_ENABLE | 350 | SRC += $(QUANTUM_DIR)/dip_switch.c |
| 421 | endif | 351 | endif |
| 422 | 352 | ||
| 423 | include $(DRIVER_PATH)/qwiic/qwiic.mk | ||
| 424 | |||
| 425 | QUANTUM_SRC:= \ | ||
| 426 | $(QUANTUM_DIR)/quantum.c \ | ||
| 427 | $(QUANTUM_DIR)/keymap_common.c \ | ||
| 428 | $(QUANTUM_DIR)/keycode_config.c | ||
| 429 | |||
| 430 | |||
| 431 | |||
| 432 | VALID_CUSTOM_MATRIX_TYPES:= yes lite no | 353 | VALID_CUSTOM_MATRIX_TYPES:= yes lite no |
| 433 | 354 | ||
| 434 | CUSTOM_MATRIX ?= no | 355 | CUSTOM_MATRIX ?= no |
| @@ -486,6 +407,29 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | |||
| 486 | COMMON_VPATH += $(QUANTUM_PATH)/split_common | 407 | COMMON_VPATH += $(QUANTUM_PATH)/split_common |
| 487 | endif | 408 | endif |
| 488 | 409 | ||
| 410 | HAPTIC_ENABLE ?= no | ||
| 411 | ifneq ($(strip $(HAPTIC_ENABLE)),no) | ||
| 412 | COMMON_VPATH += $(DRIVER_PATH)/haptic | ||
| 413 | SRC += haptic.c | ||
| 414 | OPT_DEFS += -DHAPTIC_ENABLE | ||
| 415 | endif | ||
| 416 | |||
| 417 | ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), ) | ||
| 418 | SRC += DRV2605L.c | ||
| 419 | QUANTUM_LIB_SRC += i2c_master.c | ||
| 420 | OPT_DEFS += -DDRV2605L | ||
| 421 | endif | ||
| 422 | |||
| 423 | ifneq ($(filter SOLENOID, $(HAPTIC_ENABLE)), ) | ||
| 424 | SRC += solenoid.c | ||
| 425 | OPT_DEFS += -DSOLENOID_ENABLE | ||
| 426 | endif | ||
| 427 | |||
| 428 | ifeq ($(strip $(HD44780_ENABLE)), yes) | ||
| 429 | SRC += drivers/avr/hd44780.c | ||
| 430 | OPT_DEFS += -DHD44780_ENABLE | ||
| 431 | endif | ||
| 432 | |||
| 489 | ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) | 433 | ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) |
| 490 | OPT_DEFS += -DOLED_DRIVER_ENABLE | 434 | OPT_DEFS += -DOLED_DRIVER_ENABLE |
| 491 | COMMON_VPATH += $(DRIVER_PATH)/oled | 435 | COMMON_VPATH += $(DRIVER_PATH)/oled |
| @@ -493,10 +437,34 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) | |||
| 493 | SRC += oled_driver.c | 437 | SRC += oled_driver.c |
| 494 | endif | 438 | endif |
| 495 | 439 | ||
| 440 | include $(DRIVER_PATH)/qwiic/qwiic.mk | ||
| 441 | |||
| 442 | ifeq ($(strip $(UCIS_ENABLE)), yes) | ||
| 443 | OPT_DEFS += -DUCIS_ENABLE | ||
| 444 | UNICODE_COMMON := yes | ||
| 445 | SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c | ||
| 446 | endif | ||
| 447 | |||
| 448 | ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) | ||
| 449 | OPT_DEFS += -DUNICODEMAP_ENABLE | ||
| 450 | UNICODE_COMMON := yes | ||
| 451 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c | ||
| 452 | endif | ||
| 453 | |||
| 454 | ifeq ($(strip $(UNICODE_ENABLE)), yes) | ||
| 455 | OPT_DEFS += -DUNICODE_ENABLE | ||
| 456 | UNICODE_COMMON := yes | ||
| 457 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c | ||
| 458 | endif | ||
| 459 | |||
| 460 | ifeq ($(strip $(UNICODE_COMMON)), yes) | ||
| 461 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c | ||
| 462 | endif | ||
| 463 | |||
| 496 | SPACE_CADET_ENABLE ?= yes | 464 | SPACE_CADET_ENABLE ?= yes |
| 497 | ifeq ($(strip $(SPACE_CADET_ENABLE)), yes) | 465 | ifeq ($(strip $(SPACE_CADET_ENABLE)), yes) |
| 498 | SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c | 466 | SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c |
| 499 | OPT_DEFS += -DSPACE_CADET_ENABLE | 467 | OPT_DEFS += -DSPACE_CADET_ENABLE |
| 500 | endif | 468 | endif |
| 501 | 469 | ||
| 502 | MAGIC_ENABLE ?= yes | 470 | MAGIC_ENABLE ?= yes |
| @@ -515,3 +483,31 @@ ifeq ($(strip $(DYNAMIC_MACRO_ENABLE)), yes) | |||
| 515 | SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c | 483 | SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c |
| 516 | OPT_DEFS += -DDYNAMIC_MACRO_ENABLE | 484 | OPT_DEFS += -DDYNAMIC_MACRO_ENABLE |
| 517 | endif | 485 | endif |
| 486 | |||
| 487 | ifeq ($(strip $(COMBO_ENABLE)), yes) | ||
| 488 | SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c | ||
| 489 | OPT_DEFS += -DCOMBO_ENABLE | ||
| 490 | endif | ||
| 491 | |||
| 492 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) | ||
| 493 | SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c | ||
| 494 | OPT_DEFS += -DTAP_DANCE_ENABLE | ||
| 495 | endif | ||
| 496 | |||
| 497 | ifeq ($(strip $(KEY_LOCK_ENABLE)), yes) | ||
| 498 | SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c | ||
| 499 | OPT_DEFS += -DKEY_LOCK_ENABLE | ||
| 500 | endif | ||
| 501 | |||
| 502 | ifeq ($(strip $(LEADER_ENABLE)), yes) | ||
| 503 | SRC += $(QUANTUM_DIR)/process_keycode/process_leader.c | ||
| 504 | OPT_DEFS += -DLEADER_ENABLE | ||
| 505 | endif | ||
| 506 | |||
| 507 | ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) | ||
| 508 | SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c | ||
| 509 | OPT_DEFS += -DAUTO_SHIFT_ENABLE | ||
| 510 | ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes) | ||
| 511 | OPT_DEFS += -DAUTO_SHIFT_MODIFIERS | ||
| 512 | endif | ||
| 513 | endif | ||
