diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..8e10230 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +default: + @mkdir -p "$$(pwd)/output" + docker run -it --rm \ + --user $$(id -u):$$(id -g) \ + -v "$$(pwd)/output:/build_output" \ + -v "$$(pwd)/keyboards:/qmk_firmware/keyboards:ro" \ + -e QMK_TARGET="betalupi_ergodox:default" \ + git.betalupi.com/mark/qmk + +upload: + wally-cli output/betalupi_ergodox_default.hex + +docker: + docker build docker -t git.betalupi.com/mark/qmk + + +.PHONY: docker upload default \ No newline at end of file diff --git a/README.md b/README.md index b0dd1c7..b653f2d 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,14 @@ This repository contains my keyboards' firmware and everything you need to build it. It includes a docker container for building QMK firmware, since QMK installation modifies my computer a bit more than I'd like. + ## Usage You do not need a local install of QMK to build this firmware. You'll need docker, but there's a good chance you have that installed anyway. -1. `cd` into [`./docker`](./docker) and build the container. -2. `mkdir ./output` -3. Run `./build.sh`. -4. Upload the firmware in `./output` to your keyboard using the proper tool. - - `wally-cli` works pretty well for the `betalupi_ergodox` - -## Todo - - FFT Animation: clear leds on sleep +1. `make docker` +2. `make` +3. `make upload` +Read [`Makefile`](./Makefile) for details. diff --git a/build.sh b/build.sh deleted file mode 100755 index c19ff89..0000000 --- a/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Uses the docker container defined in -# the `docker` directory of this repo. -# Run from the root directory of this repo. - -# Targets in this repo: -# betalupi_ergodox:default -# -# Usage: -# bash build.sh betalupi_ergodox:default - -docker run -it --rm \ - --user $(id -u):$(id -g) \ - -v "$(pwd)/output:/build_output" \ - -v "$(pwd)/keyboards:/qmk_firmware/keyboards:ro" \ - -e QMK_TARGET="$1" \ - git.betalupi.com/mark/qmk \ No newline at end of file diff --git a/docker/.editorconfig b/docker/.editorconfig deleted file mode 100644 index d8b9719..0000000 --- a/docker/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = false - -[*] -indent_style = tab -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = false -insert_final_newline = false - -[qmk_cli/*] -indent_style = space - -[qmk_firmware/*] -indent_style = space diff --git a/docker/Dockerfile b/docker/Dockerfile index 4bd956f..f7559d1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -74,10 +74,4 @@ WORKDIR /qmk_firmware ENV SKIP_GIT true COPY entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] - -# How to use: -# docker run -it \ -# --user 1000:1001 \ -# -v "$(pwd)/kb:/qmk_firmware/keyboards" \ -# +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 7ffac5f..9b8f37d 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -9,4 +9,6 @@ make $QMK_TARGET # Move output files to output directory. # These are the only extensions qmk can produce, # as far as I know. -mv *.{bin,hex,uf2} /build_output > /dev/null 2>&1 \ No newline at end of file +mv *.{bin,hex,uf2} /build_output > /dev/null 2>&1 + +exit 0 \ No newline at end of file