-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from allanwind/makefile
Makefile: simplify; clean should remove images created
- Loading branch information
Showing
1 changed file
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
2562f62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the build step? The only option is to rebuild all now?
2562f62
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 'setup' target should be a no-op if you already have built it (e.g. with a previous invocation), right?