build.sh runs inside Docker (mounted at /scripts/build.sh via docker-compose volume). flash.sh runs on the host and takes the project name as an argument, auto-detecting the .uf2 file. Usage: cd color_switcher && docker compose run --rm pico-build bash /scripts/build.sh cd .. && ./flash.sh color_switcher
22 lines
829 B
Bash
Executable File
22 lines
829 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# ============================================================================
|
|
# build.sh — Build Pico firmware for a given project
|
|
# ============================================================================
|
|
# Runs inside Docker. CMake source directory is the project's cmake/ folder.
|
|
# Build artifacts (including the .uf2) land in the project's build/ folder.
|
|
#
|
|
# Usage (from inside Docker container):
|
|
# bash /scripts/build.sh
|
|
#
|
|
# The script auto-detects the project directory from the Docker working
|
|
# directory (/project), so no arguments are needed.
|
|
# ============================================================================
|
|
|
|
set -e
|
|
|
|
# Configure: cmake/ holds the CMakeLists.txt, build/ holds the output
|
|
cmake -S cmake -B build
|
|
|
|
# Compile using all available CPU cores
|
|
cmake --build build -j"$(nproc)" |