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.

63 lines
2.3 KiB

  1. # WARNING: Until issue [#173](https://github.com/tmk/tmk_keyboard/issues/173) goes through, the [core][1] repository will not be up-to-date with the latest changes and fixes, but can still be used.
  2. If you want to use TMK for your own keyboard project, you've got three options for embedding the [core][1].
  3. The recommended option is [subtrees](#1-git-subtree).
  4. After adding the embed you'll need to [modify the Makefile](#modifications-to-the-makefile) of your project to point to the core correctly.
  5. ## 1. git subtree
  6. In order to set up the subtree in your project, first add the core repository as a remote:
  7. ```
  8. git remote add -f core https://github.com/tmk/tmk_core
  9. ```
  10. Then add the core as a subtree (directory) in your local repository:
  11. ```
  12. git subtree add -P tmk_core core master --squash
  13. ```
  14. And that's it!
  15. When you want to update the subtree in your repository to match the master on [tmk_core][1], do this:
  16. ```
  17. git subtree pull -P tmk_core core master --squash
  18. ```
  19. ## 2. git submodule
  20. In order to set up the submodule in your project, first add a new submodule:
  21. ```
  22. git submodule add https://github.com/tmk/tmk_core tmk_core
  23. ```
  24. Then pull, sync and update the submodule:
  25. ```
  26. git pull
  27. git submodule sync --recursive
  28. git submodule update --init --recursive
  29. ```
  30. And that's it!
  31. When you want to update the subtree in your repository to match the master on [tmk_core][1], follow the same steps as above.
  32. If you want to clone a repository from GitHub that has submodule(s) in it, pass <kbd>--recursive</kbd> when cloning, like so:
  33. `git clone --recursive https://github.com/<username>/<repository>`
  34. ## 3. Manually (without git)
  35. *Note: This is not recommended in any way, but it's still possible.*
  36. Download a zipped version of the [tmk_core][1] repository using this link:
  37. <https://github.com/tmk/tmk_core/archive/master.zip>
  38. Extract the zip in your project's directory, then rename the folder to <kbd>tmk_core</kbd>.
  39. ## Modifications to the *Makefile*
  40. The one thing you have to make sure to change in the *Makefile* (compared to [tmk_keyboard](https://github.com/tmk/tmk_keyboard) drivers' *[Makefile](https://github.com/tmk/tmk_keyboard/blob/master/keyboard/gh60/Makefile#L45)*) is the "TMK_DIR" variable, which needs to point to the embed directory:
  41. ```Makefile
  42. TMK_DIR = ./tmk_core
  43. ```
  44. [1]: https://github.com/tmk/tmk_core