ergodox build qmk source code

本文记录 ergodox 从源码编译固件,正常情况下直接使用 ergodox 提供的web配置页 http://configure.ergodox-ez.com/ 即可。 这里是因为在 ymdk build qmk source code 中发现 OSM 功能配置页中没有提供多 modifiers 的功能。如:

OSM(MOD_LCTL|MOD_LALT|MOD_LGUI)

因为 ergodox 针对配置添加了相关功能,需要克隆其 fork 的仓库:https://github.com/zsa/qmk_firmware/ 编译可以直接使用配置页下载的代码文件包,放置到特定profile路径就好:

$ tree keyboards/ergodox_ez/keymaps/onriv_space
keyboards/ergodox_ez/keymaps/onriv_space
├── config.h
├── keymap.c
└── rules.mk

ergodox配置页下载的代码有详尽的文档:

$ cat README.md
# Building your layout from source

Congratulations on taking the next step, and making use of your keyboard's open-source nature! There's so much power to unlock — this is going to be fun. :)

Here are some initial pointers to get you started:

- Use the documentation at [https://docs.qmk.fm/](https://docs.qmk.fm/) to set up your environment for building your firmware.
- Build your layout against [https://github.com/zsa/qmk_firmware/](https://github.com/zsa/qmk_firmware/) which is our QMK fork (instead of qmk/qmk_firmware). This is what Oryx (the graphical configurator) uses, so it's guaranteed to work.
- Create a folder with a simple name (no spaces!) for your layout inside the qmk_firmware/keyboards/ergodox_ez/keymaps/ folder.
- Copy the contents of the \*\_source folder (in the .zip you downloaded from Oryx) into this folder.
- Make sure you've set up your environment per the [QMK docs](https://docs.qmk.fm/#/newbs_getting_started?id=set-up-your-environment) so compilation would actually work.
- From your shell, make sure your working directory is qmk*firmware, then enter the command `make ergodox_ez:_layout_`, substituting the name of the folder you created for "_layout_".

Good luck on your journey! And remember, if you get stuck, you can always get back to your [original layout](https://configure.ergodox-ez.com/ergodox-ez/layouts/vKp4Q/g7yne/0) from Oryx.

编译使用命令:

CFLAGS='-Wno-error=unused-variable' make ergodox_ez:onriv_space

ergodox的这份代码产物大小比 ymdk build qmk source code 中生成的产物大小小很多,相关优化技巧可以参考:Reducing firmware size in QMK

相关备份: https://github.com/onriv/zsa_qmk_firmware/releases/tag/ergodox_build_1.0