Model100: build in place with Kaleidoscope's makefile
Assisted-by: Claude Opus 5.5 via Claude Code
change ltprzznkotqmswvvyyqplqqulqxvllrw
commit cbaa07ecde9565fd92ed1047f8cd5e4e5fc379ae
author Alpha Chen <alpha@kejadlen.dev>
date
parent qyonzslv
diff --git a/Model100/Makefile b/Model100/Makefile
new file mode 100644
index 0000000..19019b3
--- /dev/null
+++ b/Model100/Makefile
@@ -0,0 +1,48 @@
+# This makefile for a Kaleidoscope sketch pulls in all the targets
+# required to build the example
+
+
+
+
+ifneq ($(KALEIDOSCOPE_DIR),)
+search_path += $(KALEIDOSCOPE_DIR)
+endif
+
+ifneq ($(ARDUINO_DIRECTORIES_USER),)
+search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
+endif
+
+ifeq ($(shell uname -s),Darwin)
+search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
+else
+search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
+endif
+
+sketch_makefile := etc/makefiles/sketch.mk
+
+$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
+
+ifneq ($(ks_dir),)
+
+$(info Using Kaleidoscope from $(ks_dir))
+
+export KALEIDOSCOPE_DIR := $(ks_dir)
+include $(ks_dir)/$(sketch_makefile)
+
+else
+
+$(info I can't find your Kaleidoscope installation.)
+$(info )
+$(info I tried looking in:)
+$(info )
+$(foreach candidate, $(search_path), $(info $(candidate)))
+$(info )
+$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
+$(info variable to the location of your Kaleidoscope directory.)
+
+endif
+
+
+null-target:
+	$(info You should never see this message)
+	@:
diff --git a/Model100/sketch.yaml b/Model100/sketch.yaml
new file mode 100644
index 0000000..6065348
--- /dev/null
+++ b/Model100/sketch.yaml
@@ -0,0 +1 @@
+default_fqbn: keyboardio:gd32:keyboardio_model_100
diff --git a/README.md b/README.md
index 50fe542..ee910c1 100644
--- a/README.md
+++ b/README.md
@@ -10,9 +10,17 @@ Keyboard designs and firmware keymaps:
 
 The Nix flake's dev shell provides `ergogen`.
 
-To build the Model 100 firmware, copy `Model100/Model100.ino` over
-`examples/Devices/Keyboardio/Model100/Model100.ino` in a Kaleidoscope
-checkout.
+To flash the Model 100, run `make setup` in a Kaleidoscope checkout,
+point `KALEIDOSCOPE_DIR` at it, and flash from the sketch directory
+while holding `Prog`. These steps come from Kaleidoscope's README and
+haven't been tried here, and the 2022 sketch may not build against
+current Kaleidoscope.
+
+```sh
+export KALEIDOSCOPE_DIR=/path/to/Kaleidoscope
+cd Model100
+make flash
+```
 
 To build the Kyria firmware, point QMK at the userspace and compile it: