build: add directory-oriented make workflows
Host SITL smoke / Deterministic Gazebo command path (push) Has been cancelled
Host SITL smoke / Deterministic Gazebo command path (push) Has been cancelled
This commit is contained in:
1 parent
4bc98adbc6
commit
7dc3ccb619
40 files changed
+1367
-278
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user