build: replace argument dispatch and retain source-bound verification

Replace argument recovery with direct build targets. Run host, target,
board, coverage, Miri and selected Kani checks while retaining source
identities, logs and artifacts, including failed attempts.

Keep the PID proof diagnostic exception explicit and match its exact
identity alongside passing contract assertions and covers.

Validation: final-source verification matrix, assembled workflow tests
and documentation build.
This commit is contained in:
Onur Özkan committed 2026-11-07 18:12:11 +03:00
1 parent 4953f0a974
commit 62b18d5b2e
26 files changed
+2177 -1052

No files matched your search

+18 -31
View File
@@ -1,44 +1,31 @@
override SHELL := /bin/sh
override MAKEFLAGS += --no-print-directory
SHELL := /bin/sh
MAKEFLAGS += --no-print-directory
export CARGO_BUILD_JOBS ?= 2
.DEFAULT_GOAL := help
.DELETE_ON_ERROR:
override CARGO := cargo
override CARGO_FLAGS := --locked --offline
override EMBEDDED_TARGET := thumbv7em-none-eabihf
override TARGET_DIR := ../target/$(EMBEDDED_TARGET)/release
override SCRIPTS_DIR := ../scripts
CARGO_TARGET_DIR ?= ../target
override TARGET_DIR := $(CARGO_TARGET_DIR)/$(EMBEDDED_TARGET)/release
override BOARDS := geprc-f722-v2 kakute-f7-mini-v3
override BOARD_PACKAGES := $(addprefix kaptan-,$(BOARDS))
override BOARD_PACKAGE_ARGS := $(addprefix -p ,$(BOARD_PACKAGES))
override BOARD_BIN_ARGS := $(addprefix --bin ,$(BOARD_PACKAGES))
override PRIMARY_GOAL := $(firstword $(MAKECMDGOALS))
run:
@exec python3 ../../scripts/make-argv.py exec run $(CARGO) build --release \
$(CARGO_FLAGS) $(BOARD_PACKAGE_ARGS) --target $(EMBEDDED_TARGET)
@set -e; for board in $(BOARD_PACKAGES); do \
$(SCRIPTS_DIR)/create-dfu-image.sh $(TARGET_DIR)/$$board; \
done
ifeq ($(PRIMARY_GOAL),run)
.PHONY: run
# Application arguments may also look like Make goals. The run recipe recovers
# their exact boundaries from the original invocation.
.DEFAULT:
@:
else
.PHONY: help run
.NOTPARALLEL:
.PHONY: help build
help:
@printf '%s\n' 'Usage: make firmware/boards -- <cargo build arguments...>' '' \
'With no arguments, every board is built and packaged.'
@printf '%s\n' 'Usage: make -C firmware/boards build' '' \
' build Build and package every board in release mode' \
'CARGO_TARGET_DIR defaults to firmware/target; relative overrides are relative to firmware/boards/.' \
'For one board: make -C firmware/boards/<board> build|flash'
endif
build:
cargo build --release --locked --offline $(BOARD_PACKAGE_ARGS) $(BOARD_BIN_ARGS) \
--target $(EMBEDDED_TARGET) --target-dir "$(CARGO_TARGET_DIR)"
@set -e; for board in $(BOARD_PACKAGES); do \
../scripts/create-dfu-image.sh "$(TARGET_DIR)/$$board"; \
done