-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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: simplify; clean should remove images created #42
Conversation
The target all was previous running setup followed by build. As both setup and build are phony targets they run in sequence and because the firmware contain the timestamp they always run (dependencies doesn't do anything). all now does exactly what it says on the tin without introducing non-standard targets. clean now removes the images that created during build which is what you expect from that target. See: https://www.gnu.org/software/make/manual/html_node/Standard-Targets.html#Standard-Targets
Tested with podman. Please test the clean target on docker. |
The next step (for others to pursue) would be to build a fixed target (say, without the timestamp- prefix) so the build step only happens if the dependencies change. I haven't analyzed what those are yet but that should be complete to be reliable; not sure how that would work with the zmk dependency if you can infer that from Why can't everything be upstreamed to zmk so this just repo would just be a fork? |
Sorry for the radio silence lately, been very busy. The adv360 has several unique features that are in the process of getting upstreamed into zmk main however this isn't an instant process. The local building from a config repo is unique amongst boards powered by ZMK so upstreaming this config repo stuff wouldn't be trivial. looking at this it seems to be changing a lot more than it needs to to remove the docker image, why was that done? |
The point of the Makefile is use a standard installation process
(make; make install). As it left the two container around there
was big improvement in build speed from reusing the existing
containers (4m56s to 53s). The main change is to remove those
containers as expected from the clean target (line 16). Note:
original build script did this as well.
The current Makefile has separate non-standard setup and build
targets. The only point of that is you want to do:
make setup # once
make build
...
make build
As the Makefile doesn't track what changes should trigger the
setup (yet) this means any of subsequent builds may not work as
expected. As `make setup` is fast the 2nd time around it's not
worth the risk:
time podman build --tag zmk --file Dockerfile .
...
real 0m1.039s
The only other minor change is fixing the missing .PHONY target.
Let me know if you have any other questions.
|
Thanks for explaining it all to me, makes sense now :) |
I commented on the merge but will put here. Can you update the readme since it's now outdated? |
#57 should take care of this |
Makefile: simplify; clean should remove images created
The target all was previous running setup followed by build. As both setup and build are phony targets they run in sequence and because the firmware contain the timestamp they always run (dependencies doesn't do anything). all now does exactly what it says on the tin without introducing non-standard targets.
clean should remove the images that created during build which is what you expect from that target. See:
https://www.gnu.org/software/make/manual/html_node/Standard-Targets.html#Standard-Targets