build: add directory-oriented make workflows
Host SITL smoke / Deterministic Gazebo command path (push) Has been cancelled

This commit is contained in:
Onur Özkan committed 2026-08-30 07:05:01 +03:00
1 parent 4bc98adbc6
commit 7dc3ccb619
40 files changed
+1367 -278

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
override SHELL := /bin/sh
override MAKEFLAGS += --no-print-directory
.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
override BOARDS := geprc-f722-v2 kakute-f7-mini-v3
override BOARD_PACKAGES := $(addprefix kaptan-,$(BOARDS))
override BOARD_PACKAGE_ARGS := $(addprefix -p ,$(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
help:
@printf '%s\n' 'Usage: make firmware/boards -- <cargo build arguments...>' '' \
'With no arguments, every board is built and packaged.'
endif
+69
View File
@@ -0,0 +1,69 @@
override SHELL := /bin/sh
override MAKEFLAGS += --no-print-directory
.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
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
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.'
endif
endif
+3 -1
View File
@@ -14,7 +14,9 @@ kaptan-config = { path = "../../libs/kaptan-config" }
platform-stm32f7 = { path = "../../platforms/stm32f7" }
# RTIC's attribute expansion emits absolute `rtic` support paths in the final
# board crate; the task graph and all RTIC source remain platform-owned.
rtic = { version = "2.3", default-features = false, features = ["thumbv7-backend"] }
rtic = { version = "2.3", default-features = false, features = [
"thumbv7-backend",
] }
[[bin]]
name = "kaptan-geprc-f722-v2"
+3
View File
@@ -0,0 +1,3 @@
override BOARD := geprc-f722-v2
include ../board.mk
+3 -1
View File
@@ -13,7 +13,9 @@ kaptan-config = { path = "../../libs/kaptan-config" }
platform-stm32f7 = { path = "../../platforms/stm32f7" }
# RTIC's attribute expansion emits absolute `rtic` support paths in the final
# board crate; the task graph and all RTIC source remain platform-owned.
rtic = { version = "2.3", default-features = false, features = ["thumbv7-backend"] }
rtic = { version = "2.3", default-features = false, features = [
"thumbv7-backend",
] }
[[bin]]
name = "kaptan-kakute-f7-mini-v3"
@@ -0,0 +1,3 @@
override BOARD := kakute-f7-mini-v3
include ../board.mk