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.

457 lines
15 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. # Determine which subfolders exist.
  31. KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
  32. KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1)))
  33. KEYBOARD_FOLDER_PATH_3 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_2)))
  34. KEYBOARD_FOLDER_PATH_4 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_3)))
  35. KEYBOARD_FOLDER_PATH_5 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_4)))
  36. KEYBOARD_FOLDER_1 := $(notdir $(KEYBOARD_FOLDER_PATH_1))
  37. KEYBOARD_FOLDER_2 := $(notdir $(KEYBOARD_FOLDER_PATH_2))
  38. KEYBOARD_FOLDER_3 := $(notdir $(KEYBOARD_FOLDER_PATH_3))
  39. KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4))
  40. KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5))
  41. KEYBOARD_PATHS :=
  42. KEYBOARD_PATH_1 := keyboards/$(KEYBOARD_FOLDER_PATH_1)
  43. KEYBOARD_PATH_2 := keyboards/$(KEYBOARD_FOLDER_PATH_2)
  44. KEYBOARD_PATH_3 := keyboards/$(KEYBOARD_FOLDER_PATH_3)
  45. KEYBOARD_PATH_4 := keyboards/$(KEYBOARD_FOLDER_PATH_4)
  46. KEYBOARD_PATH_5 := keyboards/$(KEYBOARD_FOLDER_PATH_5)
  47. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
  48. KEYBOARD_PATHS += $(KEYBOARD_PATH_5)
  49. endif
  50. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
  51. KEYBOARD_PATHS += $(KEYBOARD_PATH_4)
  52. endif
  53. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
  54. KEYBOARD_PATHS += $(KEYBOARD_PATH_3)
  55. endif
  56. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
  57. KEYBOARD_PATHS += $(KEYBOARD_PATH_2)
  58. endif
  59. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
  60. KEYBOARD_PATHS += $(KEYBOARD_PATH_1)
  61. endif
  62. # Pull in rules.mk files from all our subfolders
  63. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","")
  64. include $(KEYBOARD_PATH_5)/rules.mk
  65. endif
  66. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/rules.mk)","")
  67. include $(KEYBOARD_PATH_4)/rules.mk
  68. endif
  69. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/rules.mk)","")
  70. include $(KEYBOARD_PATH_3)/rules.mk
  71. endif
  72. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/rules.mk)","")
  73. include $(KEYBOARD_PATH_2)/rules.mk
  74. endif
  75. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
  76. include $(KEYBOARD_PATH_1)/rules.mk
  77. endif
  78. MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
  79. MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
  80. MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
  81. MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
  82. MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
  83. # Pull in rules from info.json
  84. INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_rules.mk)
  85. include $(INFO_RULES_MK)
  86. # Check for keymap.json first, so we can regenerate keymap.c
  87. include build_json.mk
  88. # Pull in keymap level rules.mk
  89. ifeq ("$(wildcard $(KEYMAP_PATH))", "")
  90. # Look through the possible keymap folders until we find a matching keymap.c
  91. ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","")
  92. -include $(MAIN_KEYMAP_PATH_5)/rules.mk
  93. KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c
  94. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
  95. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","")
  96. -include $(MAIN_KEYMAP_PATH_4)/rules.mk
  97. KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c
  98. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
  99. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","")
  100. -include $(MAIN_KEYMAP_PATH_3)/rules.mk
  101. KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c
  102. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
  103. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","")
  104. -include $(MAIN_KEYMAP_PATH_2)/rules.mk
  105. KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c
  106. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
  107. else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","")
  108. -include $(MAIN_KEYMAP_PATH_1)/rules.mk
  109. KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c
  110. KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
  111. else ifneq ($(LAYOUTS),)
  112. # If we haven't found a keymap yet fall back to community layouts
  113. include build_layout.mk
  114. else
  115. $(error Could not find keymap)
  116. # this state should never be reached
  117. endif
  118. endif
  119. # Have we found a keymap.json?
  120. ifneq ("$(wildcard $(KEYMAP_JSON))", "")
  121. KEYMAP_C := $(KEYMAP_OUTPUT)/src/keymap.c
  122. KEYMAP_H := $(KEYMAP_OUTPUT)/src/config.h
  123. # Load the keymap-level rules.mk if exists
  124. -include $(KEYMAP_PATH)/rules.mk
  125. # Load any rules.mk content from keymap.json
  126. INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_OUTPUT)/src/rules.mk)
  127. include $(INFO_RULES_MK)
  128. # Add rules to generate the keymap files - indentation here is important
  129. $(KEYMAP_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
  130. $(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
  131. $(KEYMAP_OUTPUT)/src/config.h: $(KEYMAP_JSON)
  132. $(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --keymap $(KEYMAP) --output $(KEYMAP_H)
  133. generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c
  134. endif
  135. ifeq ($(strip $(CTPC)), yes)
  136. CONVERT_TO_PROTON_C=yes
  137. endif
  138. ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
  139. include platforms/chibios/boards/QMK_PROTON_C/convert_to_proton_c.mk
  140. endif
  141. include $(BUILDDEFS_PATH)/mcu_selection.mk
  142. # Find all the C source files to be compiled in subfolders.
  143. KEYBOARD_SRC :=
  144. KEYBOARD_C_1 := $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).c
  145. KEYBOARD_C_2 := $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).c
  146. KEYBOARD_C_3 := $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).c
  147. KEYBOARD_C_4 := $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).c
  148. KEYBOARD_C_5 := $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).c
  149. ifneq ("$(wildcard $(KEYBOARD_C_5))","")
  150. KEYBOARD_SRC += $(KEYBOARD_C_5)
  151. endif
  152. ifneq ("$(wildcard $(KEYBOARD_C_4))","")
  153. KEYBOARD_SRC += $(KEYBOARD_C_4)
  154. endif
  155. ifneq ("$(wildcard $(KEYBOARD_C_3))","")
  156. KEYBOARD_SRC += $(KEYBOARD_C_3)
  157. endif
  158. ifneq ("$(wildcard $(KEYBOARD_C_2))","")
  159. KEYBOARD_SRC += $(KEYBOARD_C_2)
  160. endif
  161. ifneq ("$(wildcard $(KEYBOARD_C_1))","")
  162. KEYBOARD_SRC += $(KEYBOARD_C_1)
  163. endif
  164. # Generate KEYBOARD_name_subname for all levels of the keyboard folder
  165. KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1)))
  166. KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2)))
  167. KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3)))
  168. KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4)))
  169. KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5)))
  170. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
  171. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5)
  172. endif
  173. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
  174. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4)
  175. endif
  176. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
  177. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3)
  178. endif
  179. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
  180. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2)
  181. endif
  182. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
  183. OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1)
  184. endif
  185. # Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
  186. # that the same keymap may be used on multiple keyboards.
  187. #
  188. # We grab the most top-level include file that we can. That file should
  189. # use #ifdef statements to include all the neccesary subfolder includes,
  190. # as described here:
  191. #
  192. # https://docs.qmk.fm/#/feature_layouts?id=tips-for-making-layouts-keyboard-agnostic
  193. #
  194. QMK_KEYBOARD_H = $(KEYBOARD_OUTPUT)/src/default_keyboard.h
  195. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","")
  196. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h
  197. endif
  198. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/$(KEYBOARD_FOLDER_2).h)","")
  199. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_2).h
  200. endif
  201. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/$(KEYBOARD_FOLDER_3).h)","")
  202. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_3).h
  203. endif
  204. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/$(KEYBOARD_FOLDER_4).h)","")
  205. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_4).h
  206. endif
  207. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","")
  208. QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
  209. endif
  210. # Determine and set parameters based on the keyboard's processor family.
  211. # We can assume a ChibiOS target When MCU_FAMILY is defined since it's
  212. # not used for LUFA
  213. ifdef MCU_FAMILY
  214. PLATFORM=CHIBIOS
  215. PLATFORM_KEY=chibios
  216. FIRMWARE_FORMAT?=bin
  217. OPT_DEFS += -DMCU_$(MCU_FAMILY)
  218. else ifdef ARM_ATSAM
  219. PLATFORM=ARM_ATSAM
  220. PLATFORM_KEY=arm_atsam
  221. FIRMWARE_FORMAT=bin
  222. else
  223. PLATFORM=AVR
  224. PLATFORM_KEY=avr
  225. FIRMWARE_FORMAT?=hex
  226. endif
  227. # Find all of the config.h files and add them to our CONFIG_H define.
  228. CONFIG_H :=
  229. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")
  230. CONFIG_H += $(KEYBOARD_PATH_5)/config.h
  231. endif
  232. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/config.h)","")
  233. CONFIG_H += $(KEYBOARD_PATH_4)/config.h
  234. endif
  235. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/config.h)","")
  236. CONFIG_H += $(KEYBOARD_PATH_3)/config.h
  237. endif
  238. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/config.h)","")
  239. CONFIG_H += $(KEYBOARD_PATH_2)/config.h
  240. endif
  241. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","")
  242. CONFIG_H += $(KEYBOARD_PATH_1)/config.h
  243. endif
  244. POST_CONFIG_H :=
  245. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_config.h)","")
  246. POST_CONFIG_H += $(KEYBOARD_PATH_1)/post_config.h
  247. endif
  248. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_config.h)","")
  249. POST_CONFIG_H += $(KEYBOARD_PATH_2)/post_config.h
  250. endif
  251. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_config.h)","")
  252. POST_CONFIG_H += $(KEYBOARD_PATH_3)/post_config.h
  253. endif
  254. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_config.h)","")
  255. POST_CONFIG_H += $(KEYBOARD_PATH_4)/post_config.h
  256. endif
  257. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","")
  258. POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h
  259. endif
  260. # Pull in stuff from info.json
  261. INFO_JSON_FILES :=
  262. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","")
  263. INFO_JSON_FILES += $(KEYBOARD_PATH_1)/info.json
  264. endif
  265. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/info.json)","")
  266. INFO_JSON_FILES += $(KEYBOARD_PATH_2)/info.json
  267. endif
  268. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/info.json)","")
  269. INFO_JSON_FILES += $(KEYBOARD_PATH_3)/info.json
  270. endif
  271. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/info.json)","")
  272. INFO_JSON_FILES += $(KEYBOARD_PATH_4)/info.json
  273. endif
  274. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
  275. INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
  276. endif
  277. CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h
  278. $(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
  279. $(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h
  280. $(KEYBOARD_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
  281. $(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h
  282. $(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES)
  283. $(QMK_BIN) generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h
  284. generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.h $(KEYBOARD_OUTPUT)/src/layouts.h
  285. .INTERMEDIATE : generated-files
  286. # Userspace setup and definitions
  287. ifeq ("$(USER_NAME)","")
  288. USER_NAME := $(KEYMAP)
  289. endif
  290. USER_PATH := users/$(USER_NAME)
  291. # Pull in user level rules.mk
  292. -include $(USER_PATH)/rules.mk
  293. ifneq ("$(wildcard $(USER_PATH)/config.h)","")
  294. CONFIG_H += $(USER_PATH)/config.h
  295. endif
  296. ifneq ("$(wildcard $(USER_PATH)/post_config.h)","")
  297. POST_CONFIG_H += $(USER_PATH)/post_config.h
  298. endif
  299. # Disable features that a keyboard doesn't support
  300. -include $(BUILDDEFS_PATH)/disable_features.mk
  301. # Pull in post_rules.mk files from all our subfolders
  302. ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_rules.mk)","")
  303. include $(KEYBOARD_PATH_1)/post_rules.mk
  304. endif
  305. ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_rules.mk)","")
  306. include $(KEYBOARD_PATH_2)/post_rules.mk
  307. endif
  308. ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_rules.mk)","")
  309. include $(KEYBOARD_PATH_3)/post_rules.mk
  310. endif
  311. ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_rules.mk)","")
  312. include $(KEYBOARD_PATH_4)/post_rules.mk
  313. endif
  314. ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_rules.mk)","")
  315. include $(KEYBOARD_PATH_5)/post_rules.mk
  316. endif
  317. ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
  318. CONFIG_H += $(KEYMAP_PATH)/config.h
  319. endif
  320. ifneq ("$(KEYMAP_H)","")
  321. CONFIG_H += $(KEYMAP_H)
  322. endif
  323. # project specific files
  324. SRC += \
  325. $(KEYBOARD_SRC) \
  326. $(KEYMAP_C) \
  327. $(QUANTUM_SRC) \
  328. $(QUANTUM_DIR)/main.c \
  329. # Optimize size but this may cause error "relocation truncated to fit"
  330. #EXTRALDFLAGS = -Wl,--relax
  331. # Search Path
  332. VPATH += $(KEYMAP_PATH)
  333. VPATH += $(USER_PATH)
  334. VPATH += $(KEYBOARD_PATHS)
  335. VPATH += $(COMMON_VPATH)
  336. include common_features.mk
  337. include $(BUILDDEFS_PATH)/generic_features.mk
  338. include $(TMK_PATH)/protocol.mk
  339. include $(PLATFORM_PATH)/common.mk
  340. include $(BUILDDEFS_PATH)/bootloader.mk
  341. SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
  342. SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
  343. SRC += $(TMK_COMMON_SRC)
  344. OPT_DEFS += $(TMK_COMMON_DEFS)
  345. EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
  346. SKIP_COMPILE := no
  347. ifneq ($(REQUIRE_PLATFORM_KEY),)
  348. ifneq ($(REQUIRE_PLATFORM_KEY),$(PLATFORM_KEY))
  349. SKIP_COMPILE := yes
  350. endif
  351. endif
  352. include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
  353. -include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
  354. ifneq ($(strip $(PROTOCOL)),)
  355. include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
  356. else
  357. include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
  358. endif
  359. # TODO: remove this bodge?
  360. PROJECT_DEFS := $(OPT_DEFS)
  361. PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
  362. PROJECT_CONFIG := $(CONFIG_H)
  363. CONFIG_H += $(POST_CONFIG_H)
  364. ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
  365. OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
  366. $(KEYMAP_OUTPUT)_SRC := $(SRC)
  367. $(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \
  368. -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \
  369. -DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
  370. -DQMK_SUBPROJECT -DQMK_SUBPROJECT_H -DQMK_SUBPROJECT_CONFIG_H
  371. $(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
  372. $(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
  373. $(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC)
  374. $(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
  375. $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
  376. $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
  377. # Default target.
  378. ifeq ($(SKIP_COMPILE),no)
  379. all: build check-size
  380. else
  381. all:
  382. echo "skipped" >&2
  383. endif
  384. build: elf cpfirmware
  385. check-size: build
  386. check-md5: build
  387. objs-size: build
  388. include $(BUILDDEFS_PATH)/show_options.mk
  389. include $(TMK_PATH)/rules.mk
  390. # Ensure we have generated files available for each of the objects
  391. define GEN_FILES
  392. $1: generated-files
  393. endef
  394. $(foreach O,$(OBJ),$(eval $(call GEN_FILES,$(patsubst %.a,%.o,$(O)))))