Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile enhancements to optimize local workflows #363

Merged
merged 1 commit into from
Feb 5, 2024
Merged

Makefile enhancements to optimize local workflows #363

merged 1 commit into from
Feb 5, 2024

Conversation

huber-th
Copy link
Contributor

Advantage 360 Pro PR template

What's changed:

Enhance the Makefile to enable firmware building exclusively for the left side.

Why has this change been implemented:

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only, thereby expediting the build process when running locally via make.

What (if any) actions must a user take after this change:

Usage: make left to build the left hand side firmware only

This update maintains existing functionality. Without specifying the left target, firmware for both halves will be generated. GitHub Actions also keeps building firmware for both halves on changes to the repo.

@huber-th huber-th closed this Jan 31, 2024
@huber-th huber-th deleted the feature/left-only branch January 31, 2024 04:20
@ReFil
Copy link
Collaborator

ReFil commented Jan 31, 2024

This is a really cool feature! I'd be open to reopening this and merging it into main

@huber-th huber-th restored the feature/left-only branch January 31, 2024 15:15
@huber-th huber-th reopened this Jan 31, 2024
@huber-th
Copy link
Contributor Author

@ReFil while working on this I noticed that there are some deprecation warnings in the build logs. Most are for label which Zephyr deprecated in favor of using the devicetree node name as a node identifier.

zmkfirmware/zmk#2028

I don't expect those to go away and therefore break the build but might be good to clean them up sooner than later.

@ReFil
Copy link
Collaborator

ReFil commented Jan 31, 2024

Yeah that's on my list to sort, it'll be addressed as part of other planned upgrade work

@huber-th
Copy link
Contributor Author

huber-th commented Feb 1, 2024

I have another small update I made for my local process of building and cleaning by splitting the make clean into sub commands to allow for cleaning the firmware folder only without removing the docker image while maintaining current behaviour of make clean.

clean_firmware:
        rm -f firmware/*.uf2

clean_images:
        $(DOCKER) image rm zmk docker.io/zmkfirmware/zmk-build-arm:stable

clean: clean_firmware clean_images

Let me know if you find this useful and I can include it in this PR prior to merging.

@ReFil
Copy link
Collaborator

ReFil commented Feb 1, 2024

That looks like another useful addition, yes please

@huber-th
Copy link
Contributor Author

huber-th commented Feb 1, 2024

Is there a benefit in adding the changed/updated version.dtsi file in a repo?

I wonder if it would be a good addition to add $(shell git checkout config/version.dtsi) as the final command of the build step in the Makefile to reduce noise by resetting that file after a build to avoid it showing as changed and being part of a commit or having to manually ensure it's not commited.

@ReFil
Copy link
Collaborator

ReFil commented Feb 2, 2024

I think that's also a good idea. I couldn't think of a good way to ensure that file remains, but isn't changed as tricks like git assume unchanged dont carry over to other people's repos (and are kind of bad solutions anyway). I dont think there's anything wrong with it being changed but it's definitely not ideal to have it be changed and committed each time.

@ReFil
Copy link
Collaborator

ReFil commented Feb 2, 2024

What OS have you been testing these changes on BTW?

CHANGELOG.md Outdated
@@ -4,6 +4,10 @@ Here's all notable changes and commits to both the configuration repo and the ba
Many thanks to all those who have submitted issues and pull requests to make this firmware better!
## Config repo

2/1/2024 - Add targets to makefile to allow for cleaning firmware and docker image separately while maintaining functionality of make clean to run both
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to link the PR in these changelog lines like the other changelog lines?

Copy link
Contributor Author

@huber-th huber-th Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Would you want me to squash all changes into a single commit? I'm considering squashing and changing the commit message to better reflect all makefile changes as it is a bit more than just allowing left side build only by now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squashing into one would be appreciated

@huber-th
Copy link
Contributor Author

huber-th commented Feb 2, 2024

What OS have you been testing these changes on BTW?

I'm working with macOS Sonoma 14.3

Unfortunately I don't have any Windows machines to verify the changes on myself.

@ReFil
Copy link
Collaborator

ReFil commented Feb 2, 2024

Brilliant, I can test on Ubuntu and wsl2 but I don't have easy access to a macOS machine so between us we can cover all bases

@huber-th
Copy link
Contributor Author

huber-th commented Feb 2, 2024

Perfect. I will get the changes in later today and get it ready for you to test and verify.

@huber-th huber-th changed the title Allow building left side firmware only via Makefile Makefile enhancements to optimize local workflows Feb 3, 2024
@huber-th
Copy link
Contributor Author

huber-th commented Feb 3, 2024

Commits squashed, PR title updated and I updated the README.md with some additional info regarding building firmware locally on macOS.

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
@huber-th
Copy link
Contributor Author

huber-th commented Feb 3, 2024

Small adjustment to the brew command to install docker and colima for macOS.

Ready for review and testing on other systems.

@ReFil
Copy link
Collaborator

ReFil commented Feb 5, 2024

Everything works good on my ubuntu 20.04 system, i think it's ready to merge

@ReFil ReFil merged commit cbc0656 into KinesisCorporation:V3.0 Feb 5, 2024
1 check passed
@huber-th huber-th deleted the feature/left-only branch February 5, 2024 15:23
@huber-th
Copy link
Contributor Author

huber-th commented Feb 6, 2024

Brilliant, I can test on Ubuntu and wsl2 but I don't have easy access to a macOS machine so between us we can cover all bases

Feel free to tag me on future pull requests/changes if something needs to be tested on macOS specifically.

alok added a commit to alok/Adv360-Pro-ZMK that referenced this pull request Feb 6, 2024
* upstream/V3.0:
  Makefile enhancements to optimize local workflows (KinesisCorporation#363)
  Update Makefile variables (KinesisCorporation#335)
  Base ZMK update (KinesisCorporation#326)
  Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)
  Add version macro (KinesisCorporation#300)
  Add pull request template (KinesisCorporation#293)
  Revert "Updated keymap"
  Revert "Updated keymap"
  Updated keymap
  Updated keymap
  Make get_version use bash from $PATH (KinesisCorporation#287)
sanderdrummer added a commit to sanderdrummer/Adv360-Pro-ZMK that referenced this pull request Feb 8, 2024
* feat: update keymap

* Update bluetooth settings in light of user feedback (KinesisCorporation#289)

* Make get_version use bash from $PATH (KinesisCorporation#287)

* Make get_version use bash from $PATH

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>

* Updated keymap

* Updated keymap

* Revert "Updated keymap"

This reverts commit 18e664a.

* Revert "Updated keymap"

This reverts commit 9fc6c62.

* Add pull request template (KinesisCorporation#293)

* Add pull request template

* Update CHANGELOG.md

* Add version macro (KinesisCorporation#300)

* Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)

* Prefer `tr` to ${char^^}, which does not work on older bash versions

* Update CHANGELOG.md

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>

* Base ZMK update (KinesisCorporation#326)

* Update Makefile variables (KinesisCorporation#335)

* Makefile enhancements to optimize local workflows (KinesisCorporation#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.

* feat: add f keys

---------

Co-authored-by: ReFil <31960031+ReFil@users.noreply.github.com>
Co-authored-by: David Whetstone <humblehacker@users.noreply.github.com>
Co-authored-by: adv360proapp[bot] <105741512+adv360proapp[bot]@users.noreply.github.com>
Co-authored-by: Jim Jowdy <jjowdy@gmail.com>
Co-authored-by: Thomas Huber <113915837+huber-th@users.noreply.github.com>
tricktux pushed a commit to tricktux/Adv360-Pro-ZMK that referenced this pull request Feb 10, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
chavita1386 added a commit to chavitaRocha/Adv360-Pro-ZMK that referenced this pull request Feb 13, 2024
Makefile enhancements to optimize local workflows (KinesisCorporation#363)
cr0rc pushed a commit to cr0rc/Adv360-Pro-ZMK that referenced this pull request Feb 25, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
OAGr added a commit to OAGr/Adv360-Pro-ZMK-v1 that referenced this pull request Mar 2, 2024
* V3.0: (57 commits)
  Fix version.dtsi is reset after local firmware build (KinesisCorporation#385)
  Update build workflows (KinesisCorporation#376)
  Makefile enhancements to optimize local workflows (KinesisCorporation#363)
  Update Makefile variables (KinesisCorporation#335)
  Base ZMK update (KinesisCorporation#326)
  Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)
  Add version macro (KinesisCorporation#300)
  Add pull request template (KinesisCorporation#293)
  Revert "Updated keymap"
  Revert "Updated keymap"
  Updated keymap
  Updated keymap
  Make get_version use bash from $PATH (KinesisCorporation#287)
  Update bluetooth settings in light of user feedback (KinesisCorporation#289)
  Revert "Add version macro to keymap.json (KinesisCorporation#269)"
  Add version macro to keymap.json (KinesisCorporation#269)
  Changelog new base ZMK update (KinesisCorporation#268)
  Version compiled FW with automatic macro (KinesisCorporation#267)
  Document new NKRO settings (KinesisCorporation#264)
  Improve documentation based on feedback (KinesisCorporation#260)
  ...
yukitaka pushed a commit to yukitaka/Adv360-Pro-ZMK that referenced this pull request Mar 21, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
luna-flowers pushed a commit to luna-flowers/Adv360-Pro-ZMK that referenced this pull request Mar 22, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
ztomer pushed a commit to ztomer/Adv360-Pro-ZMK that referenced this pull request Apr 16, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
zemackdaddy pushed a commit to zemackdaddy/Adv360-Pro-ZMK that referenced this pull request Jul 7, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
moritzschatz pushed a commit to moritzschatz/Adv360-Pro-ZMK that referenced this pull request Aug 24, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
jan-l pushed a commit to jan-l/Adv360-Pro-ZMK that referenced this pull request Aug 28, 2024
…#363)

- Enhance the Makefile to enable firmware building exclusively for the left side.

To modify the keymap, flashing only the left side's firmware suffices.

This change facilitates the creation of firmware for the left side only,
thereby expediting the build process.

Usage: make left

This update maintains existing functionality. Without specifying the
left target, firmware for both halves will be generated.

- Add separate make targets to clean firmware and docker image

Add targets clean_firmware and clean_image independently while maintaing clean to run both

- Ensure files modified by the build process are reset at the end

The current build process dynamically generates the content of the version macro
in config/version.dtsi to enable users to print out the precise version and commit
the firmware was built on via a keybinding on the keymap.

This change ensurs that the changes to this macro file are reset at the end of the
build process to ensure it isn't shown as modified and added to keymap commit changes.
martypenner added a commit to martypenner/Adv360-Pro-ZMK that referenced this pull request Nov 6, 2024
* V3.0: (40 commits)
  Changelog update (KinesisCorporation#448)
  Minor docs update (KinesisCorporation#445)
  Document new layer colors and modifier color configuration option (KinesisCorporation#431)
  Zephyr 3.5 Update (KinesisCorporation#426)
  Fix Makefile errors that prevent builds on macOS (KinesisCorporation#409)
  Fix version.dtsi is reset after local firmware build (KinesisCorporation#385)
  Update build workflows (KinesisCorporation#376)
  Makefile enhancements to optimize local workflows (KinesisCorporation#363)
  Update Makefile variables (KinesisCorporation#335)
  Base ZMK update (KinesisCorporation#326)
  Prefer `tr` to ${char^^}, which does not work on older bash versions (KinesisCorporation#303)
  Add version macro (KinesisCorporation#300)
  Add pull request template (KinesisCorporation#293)
  Revert "Updated keymap"
  Revert "Updated keymap"
  Updated keymap
  Updated keymap
  Make get_version use bash from $PATH (KinesisCorporation#287)
  Update bluetooth settings in light of user feedback (KinesisCorporation#289)
  Revert "Add version macro to keymap.json (KinesisCorporation#269)"
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants