Skip to content

Commit

Permalink
Optionally output config
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed Sep 22, 2023
1 parent c4d5f81 commit b522564
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ DOCKER := $(shell { command -v podman || command -v docker; })
.PHONY: all clean distclean

all:
$(DOCKER) build --tag zmk --build-arg USER_ID=$(shell id -u) --file Dockerfile .
$(DOCKER) build --tag zmk --build-arg USER_ID=$(shell id -u) .
$(DOCKER) run --rm -it --name zmk \
-v $(PWD)/bin:/app/bin:ro \
-v $(PWD)/build:/app/build \
-v $(PWD)/build.yaml:/app/build.yaml:ro \
-v $(PWD)/config:/app/config:ro \
-v $(PWD)/firmware:/app/firmware \
-e OUTPUT_CONFIG=$(OUTPUT_CONFIG) \
zmk

clean:
rm -rf firmware/*.uf2 build/[^.]*
rm -rf firmware/[^.]* build/[^.]*

distclean:
$(DOCKER) image rm zmk docker.io/zmkfirmware/zmk-build-arm:stable
8 changes: 5 additions & 3 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

config_dir="$(pwd)/config"
config_dir="${PWD}/config"
timestamp=$(date -u +"%Y%m%d%H%M%S")

while IFS=$',' read -r board shield; do
Expand All @@ -24,8 +24,10 @@ while IFS=$',' read -r board shield; do
west build -d ${build_dir} -- -DZMK_CONFIG="$config_dir"
fi

# # echo -e "${display_name} KConfig\n"
# # grep -v -e "^#" -e "^$" ${build_dir}/zephyr/.config | sort
if [[ ! -z $OUTPUT_CONFIG ]]; then
grep -v -e "^#" -e "^$" ${build_dir}/zephyr/.config | sort > \
"firmware/${timestamp}-${artifact_name}.config"
fi

cp ${build_dir}/zephyr/zmk.uf2 "firmware/${timestamp}-${artifact_name}.uf2"
done < <(yq '
Expand Down

0 comments on commit b522564

Please sign in to comment.