summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wind <allan@yaxto.com>2022-11-01 00:19:43 -0400
committerAllan Wind <allan@yaxto.com>2022-11-01 00:19:43 -0400
commitb3753fd71102a32976cc7692d83a37ad8d111de1 (patch)
treebc70eb25d6b6e38d3e9aee8e062517de9366b9fc
parent754f13303d86c91126c2d64c536a773b77615285 (diff)
Makefile: simplify; clean removes images
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
-rw-r--r--Makefile19
1 files changed, 7 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 35c0006..bbccd52 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,16 @@
-TIMESTAMP := $(shell date -u +"%Y%m%d%H%M%S")
DOCKER := $(shell { command -v podman || command -v docker; })
+TIMESTAMP := $(shell date -u +"%Y%m%d%H%M%S")
-.PHONY: clean setup
-
-all: setup build
-
-build: firmware/$$(TIMESTAMP)-left.uf2 firmware/$$(TIMESTAMP)-right.uf2
+.PHONY: all clean
-clean:
- rm -f firmware/*.uf2
-
-firmware/%-left.uf2 firmware/%-right.uf2: config/adv360.keymap
+all:
+ $(DOCKER) build --tag zmk --file Dockerfile .
$(DOCKER) run --rm -it --name zmk \
-v $(PWD)/firmware:/app/firmware \
-v $(PWD)/config:/app/config:ro \
-e TIMESTAMP=$(TIMESTAMP) \
zmk
-setup: Dockerfile bin/build.sh config/west.yml
- $(DOCKER) build --tag zmk --file Dockerfile .
+clean:
+ rm -f firmware/*.uf2
+ $(DOCKER) image rm zmk docker.io/zmkfirmware/zmk-build-arm:stable