summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThomas Huber <113915837+huber-th@users.noreply.github.com>2024-02-05 01:55:24 -0800
committerGitHub <noreply@github.com>2024-02-05 09:55:24 +0000
commitcbc065666897ce7ae66a4e7d30c88211537f6148 (patch)
treecd2386a0360c6e13e9804c8a637f601408168a3d /Makefile
parent0737d53e019903fd986df25d1ee3384f16ad7639 (diff)
Makefile enhancements to optimize local workflows (#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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 39d09d3..9d7d347 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ SELINUX1 := :z
SELINUX2 := ,z
endif
-.PHONY: all clean
+.PHONY: all left clean_firmware clean_image clean
all:
$(shell bin/get_version.sh >> /dev/null)
@@ -20,8 +20,26 @@ all:
-v $(PWD)/config:/app/config:ro$(SELINUX2) \
-e TIMESTAMP=$(TIMESTAMP) \
-e COMMIT=$(COMMIT) \
+ -e BUILD_RIGHT=true \
zmk
+ $(shell git checkout config/version.dtsi)
-clean:
+left:
+ $(shell bin/get_version.sh >> /dev/null)
+ $(DOCKER) build --tag zmk --file Dockerfile .
+ $(DOCKER) run --rm -it --name zmk \
+ -v $(PWD)/firmware:/app/firmware$(SELINUX1) \
+ -v $(PWD)/config:/app/config:ro$(SELINUX2) \
+ -e TIMESTAMP=$(TIMESTAMP) \
+ -e COMMIT=$(COMMIT) \
+ -e BUILD_RIGHT=false \
+ zmk
+ $(shell git checkout config/version.dtsi)
+
+clean_firmware:
rm -f firmware/*.uf2
+
+clean_image:
$(DOCKER) image rm zmk docker.io/zmkfirmware/zmk-build-arm:stable
+
+clean: clean_firmware clean_image