Browse Source

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
V3.0
Allan Wind 3 years ago
parent
commit
b3753fd711
  1. 19
      Makefile

19
Makefile

@ -1,21 +1,16 @@
TIMESTAMP := $(shell date -u +"%Y%m%d%H%M%S")
DOCKER := $(shell { command -v podman || command -v docker; }) DOCKER := $(shell { command -v podman || command -v docker; })
TIMESTAMP := $(shell date -u +"%Y%m%d%H%M%S")
.PHONY: clean setup .PHONY: all clean
all: setup build
build: firmware/$$(TIMESTAMP)-left.uf2 firmware/$$(TIMESTAMP)-right.uf2
clean: all:
rm -f firmware/*.uf2 $(DOCKER) build --tag zmk --file Dockerfile .
firmware/%-left.uf2 firmware/%-right.uf2: config/adv360.keymap
$(DOCKER) run --rm -it --name zmk \ $(DOCKER) run --rm -it --name zmk \
-v $(PWD)/firmware:/app/firmware \ -v $(PWD)/firmware:/app/firmware \
-v $(PWD)/config:/app/config:ro \ -v $(PWD)/config:/app/config:ro \
-e TIMESTAMP=$(TIMESTAMP) \ -e TIMESTAMP=$(TIMESTAMP) \
zmk zmk
setup: Dockerfile bin/build.sh config/west.yml clean:
$(DOCKER) build --tag zmk --file Dockerfile . rm -f firmware/*.uf2
$(DOCKER) image rm zmk docker.io/zmkfirmware/zmk-build-arm:stable

Loading…
Cancel
Save