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.

479 lines
16 KiB

Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
Change split_common to use RGBLIGHT_SPLIT (#5509) * add I2C_slave_buffer_t to quantum/split_common/transport.c Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results. * add temporary pdhelix(Patched Helix) code * temporary cherry-pick from #5020 add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * add post_config.h support to build_keyboard.mk * add quantum/rgblight_post_config.h, quantum/split_common/post_config.h Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk. quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined. quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C. * Change split_common's transport.c I2C to use the synchronization feature of rgblight.c * Change split_common's transport.c serial to use the synchronization feature of rgblight.c * test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix * Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix" This reverts commit 80118a6bbd3d9fc4c7797fef0c34bc67aa73aa98. [x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3) [x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default * Test End, Revert "temporary cherry-pick from #5020" This reverts commit d35069f68bda0c50370442a5c7aae60c2f4ce5c0. * Test End, Revert "add temporary pdhelix(Patched Helix) code" This reverts commit aebddfc1a879796afae297ef0723a4fe73af3660. * temporarily cherry-pick from #5020 to see if it passes the travis-ci test. add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * Passed the travis-ci test. Revert "temporarily cherry-pick from #5020 to see if it passes the travis-ci test." This reverts commit 647c0a9755eb6a05f76d09b2d59bce67b85a841f. * update docs/config_options.md * update split_common/transport.c, improves maintainability of serial transaction IDs. No change in build result. * temporary cherry-pick from #5020 * fix build fail keebio/iris/rev3:default * fix build fail lets_split_eh/eh:default * Revert "temporary cherry-pick from #5020" This reverts commit be48ca1b4515366a097af8dd1cd7b28b7ee09947. * temporary cherry-pick from #5020 (0.6.336) * Revert "temporary cherry-pick from #5020 (0.6.336)" This reverts commit 978d26a8b3cf0acc485838a7d76d6128b77c630c. * temporary cherry-pick from #5020 (0.6.336)
5 years ago
2020 November 28 Breaking Changes Update (#11053) * Branch point for 2020 November 28 Breaking Change * Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183) * Add support for soft serial to ATmega32U2 (#10204) * Change MIDI velocity implementation to allow direct control of velocity value (#9940) * Add ability to build a subset of all keyboards based on platform. * Actually use eeprom_driver_init(). * Make bootloader_jump weak for ChibiOS. (#10417) * Joystick 16-bit support (#10439) * Per-encoder resolutions (#10259) * Share button state from mousekey to pointing_device (#10179) * Add hotfix for chibios keyboards not wake (#10088) * Add advanced/efficient RGB Matrix Indicators (#8564) * Naming change. * Support for STM32 GPIOF,G,H,I,J,K (#10206) * Add milc as a dependency and remove the installed milc (#10563) * ChibiOS upgrade: early init conversions (#10214) * ChibiOS upgrade: configuration file migrator (#9952) * Haptic and solenoid cleanup (#9700) * XD75 cleanup (#10524) * OLED display update interval support (#10388) * Add definition based on currently-selected serial driver. (#10716) * New feature: Retro Tapping per key (#10622) * Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638) * Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530) * Rescale both ChibiOS and AVR backlighting. * Reduce Helix keyboard build variation (#8669) * Minor change to behavior allowing display updates to continue between task ticks (#10750) * Some GPIO manipulations in matrix.c change to atomic. (#10491) * qmk cformat (#10767) * [Keyboard] Update the Speedo firmware for v3.0 (#10657) * Maartenwut/Maarten namechange to evyd13/Evy (#10274) * [quantum] combine repeated lines of code (#10837) * Add step sequencer feature (#9703) * aeboards/ext65 refactor (#10820) * Refactor xelus/dawn60 for Rev2 later (#10584) * add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824) * [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549) * update chibios os usb for the otg driver (#8893) * Remove HD44780 References, Part 4 (#10735) * [Keyboard] Add Valor FRL TKL (+refactor) (#10512) * Fix cursor position bug in oled_write_raw functions (#10800) * Fixup version.h writing when using SKIP_VERSION=yes (#10972) * Allow for certain code in the codebase assuming length of string. (#10974) * Add AT90USB support for serial.c (#10706) * Auto shift: support repeats and early registration (#9826) * Rename ledmatrix.h to match .c file (#7949) * Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231) * Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840) * Merge point for 2020 Nov 28 Breaking Change
3 years ago
Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
Merge ChibiOS and LUFA descriptor support (#2362) * Move lufa descriptor to protocol/usb_descriptor * Try to compile usb_descriptor on ChibiOS * Add lufa_utils for ChibiOS Lufa USB descriptors for ChibiOS * More lufa_util compatibility fixes * First compiling version of shared USB descriptor * Send the usb descriptors * Fix the CONSOLE output on ChibiOS * Add errors for unsupported interfaces * Enable support for vitual serial port USB descriptors * Implement virtual serial port for ChibiOS * Cleanup the lufa_utils Use the default lufa header files * Add raw hid support for ChibiOS This is completely untested * Enable midi compilation on ChibiOS * Move midi functionality out of lufa.c * Don't register sysex callback when not needed * ChibiOS compilation fixes * Update ChibiOS submodule * Fix the Midi USB descriptor It didn't work properly when both Midi and Virtual serial port was enabled. * Add MIDI support for ChibiOS * Fix USB descriptor strings on ChibiOS * Use serial usb driver for raw hid * Generalize the ChibiOS stream like drivers This makes the initialization much more simple and eliminates a lot of the code duplication. * Convert console output to chibios stream driver * Fixes for ChibiOS update * Update the ChibiOS contrib submodule To include the usb data toggle synchronization fixes * Fix duplicate reset enumeration on ChibiOS * Add missing include * Add number of endpoints check for ChibiOS * Enable serial USB driver on all keyboards * Add missing includes when API is enabled withot midi * Add another missing inlcude
6 years ago
Change split_common to use RGBLIGHT_SPLIT (#5509) * add I2C_slave_buffer_t to quantum/split_common/transport.c Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results. * add temporary pdhelix(Patched Helix) code * temporary cherry-pick from #5020 add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * add post_config.h support to build_keyboard.mk * add quantum/rgblight_post_config.h, quantum/split_common/post_config.h Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk. quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined. quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C. * Change split_common's transport.c I2C to use the synchronization feature of rgblight.c * Change split_common's transport.c serial to use the synchronization feature of rgblight.c * test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix * Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix" This reverts commit 80118a6bbd3d9fc4c7797fef0c34bc67aa73aa98. [x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3) [x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default * Test End, Revert "temporary cherry-pick from #5020" This reverts commit d35069f68bda0c50370442a5c7aae60c2f4ce5c0. * Test End, Revert "add temporary pdhelix(Patched Helix) code" This reverts commit aebddfc1a879796afae297ef0723a4fe73af3660. * temporarily cherry-pick from #5020 to see if it passes the travis-ci test. add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * Passed the travis-ci test. Revert "temporarily cherry-pick from #5020 to see if it passes the travis-ci test." This reverts commit 647c0a9755eb6a05f76d09b2d59bce67b85a841f. * update docs/config_options.md * update split_common/transport.c, improves maintainability of serial transaction IDs. No change in build result. * temporary cherry-pick from #5020 * fix build fail keebio/iris/rev3:default * fix build fail lets_split_eh/eh:default * Revert "temporary cherry-pick from #5020" This reverts commit be48ca1b4515366a097af8dd1cd7b28b7ee09947. * temporary cherry-pick from #5020 (0.6.336) * Revert "temporary cherry-pick from #5020 (0.6.336)" This reverts commit 978d26a8b3cf0acc485838a7d76d6128b77c630c. * temporary cherry-pick from #5020 (0.6.336)
5 years ago
2020 November 28 Breaking Changes Update (#11053) * Branch point for 2020 November 28 Breaking Change * Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183) * Add support for soft serial to ATmega32U2 (#10204) * Change MIDI velocity implementation to allow direct control of velocity value (#9940) * Add ability to build a subset of all keyboards based on platform. * Actually use eeprom_driver_init(). * Make bootloader_jump weak for ChibiOS. (#10417) * Joystick 16-bit support (#10439) * Per-encoder resolutions (#10259) * Share button state from mousekey to pointing_device (#10179) * Add hotfix for chibios keyboards not wake (#10088) * Add advanced/efficient RGB Matrix Indicators (#8564) * Naming change. * Support for STM32 GPIOF,G,H,I,J,K (#10206) * Add milc as a dependency and remove the installed milc (#10563) * ChibiOS upgrade: early init conversions (#10214) * ChibiOS upgrade: configuration file migrator (#9952) * Haptic and solenoid cleanup (#9700) * XD75 cleanup (#10524) * OLED display update interval support (#10388) * Add definition based on currently-selected serial driver. (#10716) * New feature: Retro Tapping per key (#10622) * Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638) * Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530) * Rescale both ChibiOS and AVR backlighting. * Reduce Helix keyboard build variation (#8669) * Minor change to behavior allowing display updates to continue between task ticks (#10750) * Some GPIO manipulations in matrix.c change to atomic. (#10491) * qmk cformat (#10767) * [Keyboard] Update the Speedo firmware for v3.0 (#10657) * Maartenwut/Maarten namechange to evyd13/Evy (#10274) * [quantum] combine repeated lines of code (#10837) * Add step sequencer feature (#9703) * aeboards/ext65 refactor (#10820) * Refactor xelus/dawn60 for Rev2 later (#10584) * add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824) * [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549) * update chibios os usb for the otg driver (#8893) * Remove HD44780 References, Part 4 (#10735) * [Keyboard] Add Valor FRL TKL (+refactor) (#10512) * Fix cursor position bug in oled_write_raw functions (#10800) * Fixup version.h writing when using SKIP_VERSION=yes (#10972) * Allow for certain code in the codebase assuming length of string. (#10974) * Add AT90USB support for serial.c (#10706) * Auto shift: support repeats and early registration (#9826) * Rename ledmatrix.h to match .c file (#7949) * Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231) * Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840) * Merge point for 2020 Nov 28 Breaking Change
3 years ago
2020 November 28 Breaking Changes Update (#11053) * Branch point for 2020 November 28 Breaking Change * Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183) * Add support for soft serial to ATmega32U2 (#10204) * Change MIDI velocity implementation to allow direct control of velocity value (#9940) * Add ability to build a subset of all keyboards based on platform. * Actually use eeprom_driver_init(). * Make bootloader_jump weak for ChibiOS. (#10417) * Joystick 16-bit support (#10439) * Per-encoder resolutions (#10259) * Share button state from mousekey to pointing_device (#10179) * Add hotfix for chibios keyboards not wake (#10088) * Add advanced/efficient RGB Matrix Indicators (#8564) * Naming change. * Support for STM32 GPIOF,G,H,I,J,K (#10206) * Add milc as a dependency and remove the installed milc (#10563) * ChibiOS upgrade: early init conversions (#10214) * ChibiOS upgrade: configuration file migrator (#9952) * Haptic and solenoid cleanup (#9700) * XD75 cleanup (#10524) * OLED display update interval support (#10388) * Add definition based on currently-selected serial driver. (#10716) * New feature: Retro Tapping per key (#10622) * Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638) * Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530) * Rescale both ChibiOS and AVR backlighting. * Reduce Helix keyboard build variation (#8669) * Minor change to behavior allowing display updates to continue between task ticks (#10750) * Some GPIO manipulations in matrix.c change to atomic. (#10491) * qmk cformat (#10767) * [Keyboard] Update the Speedo firmware for v3.0 (#10657) * Maartenwut/Maarten namechange to evyd13/Evy (#10274) * [quantum] combine repeated lines of code (#10837) * Add step sequencer feature (#9703) * aeboards/ext65 refactor (#10820) * Refactor xelus/dawn60 for Rev2 later (#10584) * add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824) * [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549) * update chibios os usb for the otg driver (#8893) * Remove HD44780 References, Part 4 (#10735) * [Keyboard] Add Valor FRL TKL (+refactor) (#10512) * Fix cursor position bug in oled_write_raw functions (#10800) * Fixup version.h writing when using SKIP_VERSION=yes (#10972) * Allow for certain code in the codebase assuming length of string. (#10974) * Add AT90USB support for serial.c (#10706) * Auto shift: support repeats and early registration (#9826) * Rename ledmatrix.h to match .c file (#7949) * Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231) * Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840) * Merge point for 2020 Nov 28 Breaking Change
3 years ago
Add target 'check-md5' to `build_keyboard.mk` (#11338) * Add target 'build-for-compare' to `build_keyboard.mk` The `build-for-compare` target provides an easy way to check the md5 checksum of the generated binary. You can easily see if there is any change in the generated binaries between the two versions, as in the example below. ``` $ git checkout 0.11.0 M build_keyboard.mk M tmk_core/rules.mk Note: checking out '0.11.0'. HEAD is now at c66df1664 2020 November 28 Breaking Changes Update (#11053) $ make helix:all:build-for-compare | grep ^MD5 MD5 (.build/helix_rev2_default.hex) = 5c3606562c944bb4d18832e601b45d4a MD5 (.build/helix_rev2_edvorakjp.hex) = 9e43d13d389d518ba7e99cd7337e28d6 MD5 (.build/helix_rev2_five_rows.hex) = 8bcb61c2fd5d237c2997f2fa007d4934 MD5 (.build/helix_rev2_five_rows_jis.hex) = b97cd818d52f73ca2d4e78c86d90a791 MD5 (.build/helix_rev2_froggy.hex) = c492172364188f4e2918b10bf0f3a0a6 MD5 (.build/helix_rev2_froggy_106.hex) = b0861fd735a8f81881a8c02730641a2b MD5 (.build/helix_rev2_led_test.hex) = 5c97d982a5da5cfb3dacb28a8934b81d MD5 (.build/helix_rev2_xulkal.hex) = 01f603dc46bcf9094d7e106831d8f5b1 MD5 (.build/helix_rev2_yshrsmz.hex) = 5a008bca2d0c5790a151c02834c529ba $ git checkout 0.11.1 M build_keyboard.mk M tmk_core/rules.mk Previous HEAD position was c66df1664 2020 November 28 Breaking Changes Update (#11053) HEAD is now at cc08e3082 nix-shell: add milc dependency (#11086) $ make helix:all:build-for-compare | grep ^MD5 MD5 (.build/helix_rev2_default.hex) = 5c3606562c944bb4d18832e601b45d4a MD5 (.build/helix_rev2_edvorakjp.hex) = 9e43d13d389d518ba7e99cd7337e28d6 MD5 (.build/helix_rev2_five_rows.hex) = 8bcb61c2fd5d237c2997f2fa007d4934 MD5 (.build/helix_rev2_five_rows_jis.hex) = b97cd818d52f73ca2d4e78c86d90a791 MD5 (.build/helix_rev2_froggy.hex) = c492172364188f4e2918b10bf0f3a0a6 MD5 (.build/helix_rev2_froggy_106.hex) = b0861fd735a8f81881a8c02730641a2b MD5 (.build/helix_rev2_led_test.hex) = 5c97d982a5da5cfb3dacb28a8934b81d MD5 (.build/helix_rev2_xulkal.hex) = d848383adfd7463b138c6da179cf1436 MD5 (.build/helix_rev2_yshrsmz.hex) = 5a008bca2d0c5790a151c02834c529ba ``` * make builds reproducable by default * update build_keyboard.mk: remove 'build-for-compare' target * GNU make (3.81) on macOS 10.14(Mojave) does not have the 'undefine' directive. * Adopted fauxpark's suggestion. * Update tmk_core/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * update tmk_core/rules.mk * fix tmk_core/rules.mk Co-authored-by: Zach White <skullydazed@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
  1. # Determine what keyboard we are building and setup the build environment.
  2. #
  3. # We support folders up to 5 levels deep below `keyboards/`. This file is
  4. # responsible for determining which folder is being used and doing the
  5. # corresponding environment setup.
  6. ifndef VERBOSE
  7. .SILENT:
  8. endif
  9. .DEFAULT_GOAL := all
  10. include paths.mk
  11. include $(BUILDDEFS_PATH)/message.mk
  12. # Set the qmk cli to use
  13. QMK_BIN ?= qmk
  14. # Set the filename for the final firmware binary
  15. KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
  16. TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
  17. KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
  18. # Force expansion
  19. TARGET := $(TARGET)
  20. ifneq ($(FORCE_LAYOUT),)
  21. TARGET := $(TARGET)_$(FORCE_LAYOUT)
  22. endif
  23. # Object files and generated keymap directory
  24. # To put object files in current directory, use a dot (.), do NOT make
  25. # this an empty or blank macro!
  26. KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
  27. ifdef SKIP_VERSION
  28. OPT_DEFS += -DSKIP_VERSION
  29. endif
  30. # Generate the version.h file
  31. ifdef SKIP_VERSION
  32. VERSION_H_FLAGS := --skip-all
  33. endif
  34. ifdef SKIP_GIT
  35. VERSION_H_FLAGS := --skip-git
  36. endif
  37. # Generate the board's version.h file.
  38. $(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(KEYMAP_OUTPUT)/src/version.h)
  39. # Determine which subfolders exist.
  40. KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
  41. KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1)))
  42. KEYBOARD_FOLDER_PATH_3 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_2)))
  43. KEYBOARD_FOLDER_PATH_4 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_3)))
  44. KEYBOARD_FOLDER_PATH_5 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_4)))
  45. KEYBOARD_FOLDER_1 := $(notdir $(KEYBOARD_FOLDER_PATH_1))
  46. KEYBOARD_FOLDER_2 := $(notdir $(KEYBOARD_FOLDER_PATH_2))
  47. KEYBOARD_FOLDER_3 := $(notdir $(KEYBOARD_FOLDER_PATH_3))
  48. KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4))
  49. KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5))
  50. KEYBOARD_PATHS :=
  51. KEYBOARD_PATH_1 := keyboards/$(KEYBOARD_FOLDER_PATH_1)
  52. KEYBOARD_PATH_2 := keyboards/$(KEYBOARD_FOLDER_PATH_2)
  53. KEYBOARD_PATH_3 := keyboards/$(KEYBOARD_FOLDER_PATH_3)
  54. KEYBOARD_PATH_4 := keyboards/$(KEYBOARD_FOLDER_PATH_4)
  55. KEYBOARD_PATH_5 := keyboards/$(KEYBOARD_FOLDER_PATH_5)
  56. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
  57. KEYBOARD_PATHS += $(KEYBOARD_PATH_5)
  58. endif
  59. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
  60. KEYBOARD_PATHS += $(KEYBOARD_PATH_4)
  61. endif
  62. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
  63. KEYBOARD_PATHS += $(KEYBOARD_PATH_3)
  64. endif
  65. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
  66. KEYBOARD_PATHS += $(KEYBOARD_PATH_2)
  67. endif
  68. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
  69. KEYBOARD_PATHS += $(KEYBOARD_PATH_1)
  70. endif
  71. # Pull in rules.mk files from all our subfolders
  72. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","")
  73. include $(KEYBOARD_PATH_5)/rules.mk
  74. endif
  75. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/rules.mk)","")
  76. include $(KEYBOARD_PATH_4)/rules.mk
  77. endif
  78. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/rules.mk)","")
  79. include $(KEYBOARD_PATH_3)/rules.mk
  80. endif
  81. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/rules.mk)","")
  82. include $(KEYBOARD_PATH_2)/rules.mk
  83. endif
  84. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
  85. include $(KEYBOARD_PATH_1)/rules.mk
  86. endif
  87. MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
  88. MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
  89. MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
  90. MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
  91. MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
  92. # Pull in rules from info.json
  93. INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_rules.mk)
  94. include $(INFO_RULES_MK)
  95. # Check for keymap.json first, so we can regenerate keymap.c
  96. include $(BUILDDEFS_PATH)/build_json.mk
  97. # Pull in keymap level rules.mk
  98. ifeq ("$(wildcard $(KEYMAP_PATH))", "")
  99. # Look through the possible keymap folders until we find a matching keymap.c
  100. ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","")
  101. -include $(MAIN_KEYMAP_PATH_5)/rules.mk
  102. KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c
  103. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
  104. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","")
  105. -include $(MAIN_KEYMAP_PATH_4)/rules.mk
  106. KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c
  107. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
  108. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","")
  109. -include $(MAIN_KEYMAP_PATH_3)/rules.mk
  110. KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c
  111. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
  112. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","")
  113. -include $(MAIN_KEYMAP_PATH_2)/rules.mk
  114. KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c
  115. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
  116. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","")
  117. -include $(MAIN_KEYMAP_PATH_1)/rules.mk
  118. KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c
  119. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
  120. else ifneq ($(LAYOUTS),)
  121. # If we haven't found a keymap yet fall back to community layouts
  122. include $(BUILDDEFS_PATH)/build_layout.mk
  123. else
  124. $(call CATASTROPHIC_ERROR,Invalid keymap,Could not find keymap)
  125. # this state should never be reached
  126. endif
  127. endif
  128. # Have we found a keymap.json?
  129. ifneq ("$(wildcard $(KEYMAP_JSON))", "")
  130. KEYMAP_C := $(KEYMAP_OUTPUT)/src/keymap.c
  131. KEYMAP_H := $(KEYMAP_OUTPUT)/src/config.h
  132. # Load the keymap-level rules.mk if exists
  133. -include $(KEYMAP_PATH)/rules.mk
  134. # Load any rules.mk content from keymap.json
  135. INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_OUTPUT)/src/rules.mk)
  136. include $(INFO_RULES_MK)
  137. # Add rules to generate the keymap files - indentation here is important
  138. $(KEYMAP_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
  139. @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
  140. $(eval CMD=$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON))
  141. @$(BUILD_CMD)
  142. $(KEYMAP_OUTPUT)/src/config.h: $(KEYMAP_JSON)
  143. @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
  144. $(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_H))
  145. @$(BUILD_CMD)
  146. generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c
  147. endif
  148. include $(BUILDDEFS_PATH)/converters.mk
  149. include $(BUILDDEFS_PATH)/mcu_selection.mk
  150. # Find all the C source files to be compiled in subfolders.
  151. KEYBOARD_SRC :=
  152. KEYBOARD_C_1 := $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).c
  153. KEYBOARD_C_2 := $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).c
  154. KEYBOARD_C_3 := $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).c
  155. KEYBOARD_C_4 := $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).c
  156. KEYBOARD_C_5 := $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).c
  157. ifneq ("$(wildcard $(KEYBOARD_C_5))","")
  158. KEYBOARD_SRC += $(KEYBOARD_C_5)
  159. endif
  160. ifneq ("$(wildcard $(KEYBOARD_C_4))","")
  161. KEYBOARD_SRC += $(KEYBOARD_C_4)
  162. endif
  163. ifneq ("$(wildcard $(KEYBOARD_C_3))","")
  164. KEYBOARD_SRC += $(KEYBOARD_C_3)
  165. endif
  166. ifneq ("$(wildcard $(KEYBOARD_C_2))","")
  167. KEYBOARD_SRC += $(KEYBOARD_C_2)
  168. endif
  169. ifneq ("$(wildcard $(KEYBOARD_C_1))","")
  170. KEYBOARD_SRC += $(KEYBOARD_C_1)
  171. endif
  172. # Generate KEYBOARD_name_subname for all levels of the keyboard folder
  173. KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1)))
  174. KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2)))
  175. KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3)))
  176. KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4)))
  177. KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5)))
  178. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
  179. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5)
  180. endif
  181. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
  182. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4)
  183. endif
  184. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
  185. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3)
  186. endif
  187. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
  188. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2)
  189. endif
  190. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
  191. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1)
  192. endif
  193. # Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
  194. # that the same keymap may be used on multiple keyboards.
  195. #
  196. # We grab the most top-level include file that we can. That file should
  197. # use #ifdef statements to include all the neccesary subfolder includes,
  198. # as described here:
  199. #
  200. # https://docs.qmk.fm/#/feature_layouts?id=tips-for-making-layouts-keyboard-agnostic
  201. #
  202. QMK_KEYBOARD_H = $(KEYBOARD_OUTPUT)/src/default_keyboard.h
  203. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","")
  204. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
  205. endif
  206. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).h)","")
  207. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_2).h
  208. endif
  209. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).h)","")
  210. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_3).h
  211. endif
  212. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).h)","")
  213. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_4).h
  214. endif
  215. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","")
  216. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
  217. endif
  218. # Determine and set parameters based on the keyboard's processor family.
  219. # We can assume a ChibiOS target When MCU_FAMILY is defined since it's
  220. # not used for LUFA
  221. ifdef MCU_FAMILY
  222. PLATFORM=CHIBIOS
  223. PLATFORM_KEY=chibios
  224. FIRMWARE_FORMAT?=bin
  225. OPT_DEFS += -DMCU_$(MCU_FAMILY)
  226. else ifdef ARM_ATSAM
  227. PLATFORM=ARM_ATSAM
  228. PLATFORM_KEY=arm_atsam
  229. FIRMWARE_FORMAT=bin
  230. else
  231. PLATFORM=AVR
  232. PLATFORM_KEY=avr
  233. FIRMWARE_FORMAT?=hex
  234. endif
  235. # Find all of the config.h files and add them to our CONFIG_H define.
  236. CONFIG_H :=
  237. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")
  238. CONFIG_H += $(KEYBOARD_PATH_5)/config.h
  239. endif
  240. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/config.h)","")
  241. CONFIG_H += $(KEYBOARD_PATH_4)/config.h
  242. endif
  243. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/config.h)","")
  244. CONFIG_H += $(KEYBOARD_PATH_3)/config.h
  245. endif
  246. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/config.h)","")
  247. CONFIG_H += $(KEYBOARD_PATH_2)/config.h
  248. endif
  249. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","")
  250. CONFIG_H += $(KEYBOARD_PATH_1)/config.h
  251. endif
  252. POST_CONFIG_H :=
  253. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_config.h)","")
  254. POST_CONFIG_H += $(KEYBOARD_PATH_1)/post_config.h
  255. endif
  256. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_config.h)","")
  257. POST_CONFIG_H += $(KEYBOARD_PATH_2)/post_config.h
  258. endif
  259. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_config.h)","")
  260. POST_CONFIG_H += $(KEYBOARD_PATH_3)/post_config.h
  261. endif
  262. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_config.h)","")
  263. POST_CONFIG_H += $(KEYBOARD_PATH_4)/post_config.h
  264. endif
  265. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","")
  266. POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h
  267. endif
  268. # Pull in stuff from info.json
  269. INFO_JSON_FILES :=
  270. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","")
  271. INFO_JSON_FILES += $(KEYBOARD_PATH_1)/info.json
  272. endif
  273. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/info.json)","")
  274. INFO_JSON_FILES += $(KEYBOARD_PATH_2)/info.json
  275. endif
  276. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/info.json)","")
  277. INFO_JSON_FILES += $(KEYBOARD_PATH_3)/info.json
  278. endif
  279. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/info.json)","")
  280. INFO_JSON_FILES += $(KEYBOARD_PATH_4)/info.json
  281. endif
  282. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
  283. INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
  284. endif
  285. CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h
  286. KEYBOARD_SRC += $(KEYBOARD_OUTPUT)/src/default_keyboard.c
  287. $(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
  288. @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
  289. $(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h)
  290. @$(BUILD_CMD)
  291. $(KEYBOARD_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES)
  292. @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
  293. $(eval CMD=$(QMK_BIN) generate-keyboard-c --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.c)
  294. @$(BUILD_CMD)
  295. $(KEYBOARD_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
  296. @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
  297. $(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h)
  298. @$(BUILD_CMD)
  299. $(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES)
  300. @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
  301. $(eval CMD=$(QMK_BIN) generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h)
  302. @$(BUILD_CMD)
  303. generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.c $(KEYBOARD_OUTPUT)/src/default_keyboard.h $(KEYBOARD_OUTPUT)/src/layouts.h
  304. .INTERMEDIATE : generated-files
  305. # Userspace setup and definitions
  306. ifeq ("$(USER_NAME)","")
  307. USER_NAME := $(KEYMAP)
  308. endif
  309. USER_PATH := users/$(USER_NAME)
  310. # Pull in user level rules.mk
  311. -include $(USER_PATH)/rules.mk
  312. ifneq ("$(wildcard $(USER_PATH)/config.h)","")
  313. CONFIG_H += $(USER_PATH)/config.h
  314. endif
  315. ifneq ("$(wildcard $(USER_PATH)/post_config.h)","")
  316. POST_CONFIG_H += $(USER_PATH)/post_config.h
  317. endif
  318. # Disable features that a keyboard doesn't support
  319. -include $(BUILDDEFS_PATH)/disable_features.mk
  320. # Pull in post_rules.mk files from all our subfolders
  321. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_rules.mk)","")
  322. include $(KEYBOARD_PATH_1)/post_rules.mk
  323. endif
  324. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_rules.mk)","")
  325. include $(KEYBOARD_PATH_2)/post_rules.mk
  326. endif
  327. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_rules.mk)","")
  328. include $(KEYBOARD_PATH_3)/post_rules.mk
  329. endif
  330. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_rules.mk)","")
  331. include $(KEYBOARD_PATH_4)/post_rules.mk
  332. endif
  333. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_rules.mk)","")
  334. include $(KEYBOARD_PATH_5)/post_rules.mk
  335. endif
  336. ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
  337. CONFIG_H += $(KEYMAP_PATH)/config.h
  338. endif
  339. ifneq ("$(KEYMAP_H)","")
  340. CONFIG_H += $(KEYMAP_H)
  341. endif
  342. # project specific files
  343. SRC += \
  344. $(KEYBOARD_SRC) \
  345. $(KEYMAP_C) \
  346. $(QUANTUM_SRC) \
  347. $(QUANTUM_DIR)/main.c \
  348. # Optimize size but this may cause error "relocation truncated to fit"
  349. #EXTRALDFLAGS = -Wl,--relax
  350. # Search Path
  351. VPATH += $(KEYMAP_PATH)
  352. VPATH += $(USER_PATH)
  353. VPATH += $(KEYBOARD_PATHS)
  354. VPATH += $(COMMON_VPATH)
  355. VPATH += $(KEYBOARD_OUTPUT)/src
  356. VPATH += $(KEYMAP_OUTPUT)/src
  357. include $(BUILDDEFS_PATH)/common_features.mk
  358. include $(BUILDDEFS_PATH)/generic_features.mk
  359. include $(TMK_PATH)/protocol.mk
  360. include $(PLATFORM_PATH)/common.mk
  361. include $(BUILDDEFS_PATH)/bootloader.mk
  362. SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
  363. SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
  364. SRC += $(TMK_COMMON_SRC)
  365. OPT_DEFS += $(TMK_COMMON_DEFS)
  366. EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
  367. SKIP_COMPILE := no
  368. ifneq ($(REQUIRE_PLATFORM_KEY),)
  369. ifneq ($(REQUIRE_PLATFORM_KEY),$(PLATFORM_KEY))
  370. SKIP_COMPILE := yes
  371. endif
  372. endif
  373. include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
  374. -include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
  375. ifneq ($(strip $(PROTOCOL)),)
  376. include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
  377. else
  378. include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
  379. endif
  380. # TODO: remove this bodge?
  381. PROJECT_DEFS := $(OPT_DEFS)
  382. PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
  383. PROJECT_CONFIG := $(CONFIG_H)
  384. CONFIG_H += $(POST_CONFIG_H)
  385. ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
  386. OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
  387. $(KEYMAP_OUTPUT)_SRC := $(SRC)
  388. $(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \
  389. -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \
  390. -DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\"
  391. $(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
  392. $(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
  393. $(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC)
  394. $(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
  395. $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
  396. $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
  397. # Default target.
  398. ifeq ($(SKIP_COMPILE),no)
  399. all: build check-size
  400. else
  401. all:
  402. echo "skipped" >&2
  403. endif
  404. build: elf cpfirmware
  405. check-size: build
  406. check-md5: build
  407. objs-size: build
  408. include $(BUILDDEFS_PATH)/show_options.mk
  409. include $(BUILDDEFS_PATH)/common_rules.mk
  410. # Ensure we have generated files available for each of the objects
  411. define GEN_FILES
  412. $1: generated-files
  413. endef
  414. $(foreach O,$(OBJ),$(eval $(call GEN_FILES,$(patsubst %.a,%.o,$(O)))))