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:
1 parent
4953f0a974
commit
62b18d5b2e
26 files changed
+2177
-1052
No files matched your search
+18
-31
@@ -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
|
||||
+19
-58
@@ -1,69 +1,30 @@
|
||||
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 DFU_UTIL := dfu-util
|
||||
|
||||
override EMBEDDED_TARGET := thumbv7em-none-eabihf
|
||||
override PACKAGE := kaptan-$(BOARD)
|
||||
override TARGET_DIR := ../../target/$(EMBEDDED_TARGET)/release
|
||||
override CREATE_IMAGE := ../../scripts/create-dfu-image.sh
|
||||
CARGO_TARGET_DIR ?= ../../target
|
||||
override ELF := $(CARGO_TARGET_DIR)/$(EMBEDDED_TARGET)/release/$(PACKAGE)
|
||||
|
||||
override DFU_DEVICE := 0483:df11
|
||||
override DFU_ALT := 0
|
||||
override DFU_ADDRESS := 0x08000000:leave
|
||||
|
||||
override PRIMARY_GOAL := $(firstword $(MAKECMDGOALS))
|
||||
|
||||
run:
|
||||
@exec python3 ../../../scripts/make-argv.py exec run $(CARGO) build --release \
|
||||
$(CARGO_FLAGS) -p $(PACKAGE) --target $(EMBEDDED_TARGET)
|
||||
$(CREATE_IMAGE) $(TARGET_DIR)/$(PACKAGE)
|
||||
|
||||
_build:
|
||||
$(CARGO) build --release $(CARGO_FLAGS) -p $(PACKAGE) \
|
||||
--target $(EMBEDDED_TARGET)
|
||||
$(CREATE_IMAGE) $(TARGET_DIR)/$(PACKAGE)
|
||||
|
||||
flash: _build
|
||||
@printf '%s\n' 'Flashing $(TARGET_DIR)/$(PACKAGE).bin to $(DFU_DEVICE)'
|
||||
@exec python3 ../../../scripts/make-argv.py exec flash \
|
||||
$(DFU_UTIL) --device $(DFU_DEVICE) --alt $(DFU_ALT) \
|
||||
--dfuse-address $(DFU_ADDRESS) \
|
||||
--download $(TARGET_DIR)/$(PACKAGE).bin
|
||||
|
||||
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
|
||||
|
||||
ifeq ($(PRIMARY_GOAL),flash)
|
||||
|
||||
.PHONY: flash _build
|
||||
|
||||
.DEFAULT:
|
||||
@:
|
||||
|
||||
else
|
||||
|
||||
.PHONY: help run flash _build
|
||||
.NOTPARALLEL:
|
||||
.PHONY: help build flash
|
||||
|
||||
help:
|
||||
@printf '%s\n' 'Usage: make firmware/boards/$(BOARD) -- <cargo build arguments...>' '' \
|
||||
' make firmware/boards/$(BOARD) flash -- <dfu-util arguments...>' '' \
|
||||
'With no arguments, this board is built and packaged.' \
|
||||
'The flash target builds, packages, and writes this board over DFU.'
|
||||
@printf '%s\n' 'Usage: make -C firmware/boards/$(BOARD) build|flash' '' \
|
||||
' build Build and package $(PACKAGE) in release mode' \
|
||||
' flash Build, package, and write $(PACKAGE) over DFU' '' \
|
||||
'CARGO_TARGET_DIR defaults to firmware/target; relative overrides are relative to this board directory.' \
|
||||
'For custom Cargo or DFU options, invoke cargo or dfu-util directly.'
|
||||
|
||||
endif
|
||||
build:
|
||||
cargo build --release --locked --offline -p $(PACKAGE) --bin $(PACKAGE) \
|
||||
--target $(EMBEDDED_TARGET) --target-dir "$(CARGO_TARGET_DIR)"
|
||||
../../scripts/create-dfu-image.sh "$(ELF)"
|
||||
|
||||
endif
|
||||
flash: build
|
||||
dfu-util --device 0483:df11 --alt 0 --dfuse-address 0x08000000:leave \
|
||||
--download "$(ELF).bin"
|
||||
Reference in new issue
Block a user