Skip to content

Commit

Permalink
Merge pull request KinesisCorporation#42 from allanwind/makefile
Browse files Browse the repository at this point in the history
Makefile: simplify; clean should remove images created
  • Loading branch information
ReFil authored and tricktux committed Feb 10, 2024
2 parents 7dc2b3d + d7e5043 commit e64f912
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e64f912

Please sign in to comment.