diff options
| -rwxr-xr-x | fw/btl/build.py | 29 | ||||
| -rw-r--r-- | fw/btl/meson.build | 11 | ||||
| -rw-r--r-- | web/layouts/home.html | 1 | ||||
| -rw-r--r-- | web/meson.build | 1 | 
4 files changed, 42 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" +) diff --git a/fw/btl/meson.build b/fw/btl/meson.build index b783191..37c8c25 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -12,3 +12,14 @@ bootloader_project = external_project.add_project('configure.py',    ],    verbose: true,  ) + +bootloader = custom_target('bootloader', +  output: ['bootloader.bin'], +  command: [ +    meson.current_source_dir() / 'build.py', +    meson.current_build_dir() / 'build', +  ], +  build_by_default: true, +  install: true, +  install_dir: 'website/static', +) diff --git a/web/layouts/home.html b/web/layouts/home.html index bf534cf..4f1f7fc 100644 --- a/web/layouts/home.html +++ b/web/layouts/home.html @@ -3,5 +3,6 @@  <ul>  	<li><a href="static/bill-of-materials.csv">bill-of-materials.csv</a></li>  	<li><a href="static/schematic.pdf">schematic.pdf</a></li> +	<li><a href="static/bootloader.bin">bootloader.bin</a></li>  </ul>  {{- end -}} diff --git a/web/meson.build b/web/meson.build index 1526621..270b7c3 100644 --- a/web/meson.build +++ b/web/meson.build @@ -13,6 +13,7 @@ website = custom_target('website',    depends: [      schematic,      bom, +    bootloader,    ],    build_by_default: true,    install: true,  | 
