Use makefile for a reusable docker image

This commit is contained in:
Josh French
2022-10-11 11:13:38 -04:00
parent 2f0f47dc43
commit 1d14ffdb30
3 changed files with 24 additions and 5 deletions
+21
View File
@@ -0,0 +1,21 @@
.PHONY: clean timestamp setup
all: setup build
build: timestamp firmware/$$(TIMESTAMP)-left.uf2 firmware/$$(TIMESTAMP)-right.uf2
clean:
rm ./firmware/*.uf2
firmware/%-left.uf2 firmware/%-right.uf2: config/adv360.keymap timestamp
docker run --rm -it --name zmk \
-v $(PWD)/firmware:/app/firmware \
-v $(PWD)/config:/app/config:ro \
-e TIMESTAMP=$(TIMESTAMP) \
zmk
setup:
docker build --tag zmk .
timestamp:
$(eval TIMESTAMP:=$(shell date -u +"%Y%m%d%H%M%S"))