aboutsummaryrefslogtreecommitdiff
path: root/main/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-04-25 12:47:39 +0200
committerlonkaars <loek@pipeframe.xyz>2024-04-25 12:47:39 +0200
commit04111f06c66f6f935651903e85bda36d6f05d349 (patch)
treeeacfdc4b5714400ae26d152ea693785eba7f10e8 /main/makefile
parentabc1d59a6aa5cf2e3f4b99f14d57cb462c95b7d1 (diff)
improve build/flash instructions
Diffstat (limited to 'main/makefile')
-rw-r--r--main/makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/main/makefile b/main/makefile
new file mode 100644
index 0000000..833fd02
--- /dev/null
+++ b/main/makefile
@@ -0,0 +1,22 @@
+# this file is for lazy people (loek)
+
+.PHONY: FORCE
+
+all: FORCE build/main.uf2
+
+build/build.ninja: CMakeLists.txt
+ mkdir -p build
+ cmake -B build -G Ninja
+
+build/main.uf2: build/build.ninja FORCE
+ ninja -C build
+# ninja automatically builds in parallel, so is preferred
+
+flash: build/main.uf2 FORCE
+ picotool load -fx $<
+# -f forces a reboot of the pico before flashing
+# -x resets the pico after flashing
+
+clean: FORCE
+ $(RM) -r build
+