summaryrefslogtreecommitdiff
path: root/fw/btl/build.py
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2025-04-06 14:24:06 +0200
committerxengineering <me@xengineering.eu>2025-04-06 14:24:06 +0200
commit5376b67a9df63d2b30cac415cb827e6b4c1674e9 (patch)
treec679795279cadf7e5b5902edf5edf33370028cfa /fw/btl/build.py
parente28796985d5f605fbdb1f5043618b1f570e747af (diff)
downloadiot-contact-5376b67a9df63d2b30cac415cb827e6b4c1674e9.tar
iot-contact-5376b67a9df63d2b30cac415cb827e6b4c1674e9.tar.zst
iot-contact-5376b67a9df63d2b30cac415cb827e6b4c1674e9.zip
Build bootloader and add to website
Meson makes this relatively easy. The current approach is nevertheless a bit hacky. For the first attempt it is still way better than CMake ExternalProject.
Diffstat (limited to 'fw/btl/build.py')
-rwxr-xr-xfw/btl/build.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/fw/btl/build.py b/fw/btl/build.py
new file mode 100755
index 0000000..6478701
--- /dev/null
+++ b/fw/btl/build.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+
+
+import multiprocessing
+import shutil
+import subprocess
+import sys
+import pathlib
+
+
+build_tree = pathlib.Path(sys.argv[1])
+output_dir = build_tree.parent
+
+
+subprocess.run(
+ [
+ "make",
+ f"-j{multiprocessing.cpu_count()}",
+ "-C",
+ f"{str(build_tree)}",
+ ],
+ shell=False,
+ check=True,
+)
+
+shutil.copy(
+ build_tree / "zephyr" / "zephyr.bin",
+ output_dir / "bootloader.bin"
+)