forked from syswonder/robonix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (77 loc) · 3.68 KB
/
Copy pathMakefile
File metadata and controls
92 lines (77 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# SPDX-License-Identifier: MulanPSL-2.0
# Robonix top-level Makefile. Orchestrates Cargo workspace build + install.
#
# The Cargo workspace lives at the repo root and references Rust system
# components under system/ plus the Rust dev tools under tools/. Python system
# components (system/scene) and Python reference services (services/*) are
# managed by uv from this same root.
.PHONY: help build release install clean fmt check pyrightconfig \
build-atlas build-pilot build-executor build-liaison build-soma build-vitals
.DEFAULT_GOAL := help
BUILD_MODE ?= debug
CARGO_FLAGS := $(if $(filter release,$(BUILD_MODE)),--release,)
help:
@echo "Robonix Makefile"
@echo ""
@echo " Build:"
@echo " make build - Build all Cargo workspace crates (debug)"
@echo " make release - Build all Cargo workspace crates (release)"
@echo " make build-atlas - Install robonix-atlas to ~/.cargo/bin"
@echo " make build-pilot - Install robonix-pilot to ~/.cargo/bin"
@echo " make build-executor - Install robonix-executor to ~/.cargo/bin"
@echo " make build-liaison - Install robonix-liaison to ~/.cargo/bin"
@echo " make build-soma - Install robonix-soma to ~/.cargo/bin"
@echo " make build-vitals - Install robonix-vitals to ~/.cargo/bin"
@echo ""
@echo " Install:"
@echo " make install - Install all binaries to ~/.cargo/bin and register this repo via rbnx setup"
@echo ""
@echo " Format & Lint:"
@echo " make fmt - cargo fmt --all"
@echo " make check - cargo fmt --check + clippy -D warnings"
@echo ""
@echo " Clean:"
@echo " make clean - cargo clean"
build:
cargo build --workspace $(CARGO_FLAGS)
release:
@$(MAKE) BUILD_MODE=release build
build-atlas:
cargo install --force --path system/atlas --bin robonix-atlas $(CARGO_FLAGS)
build-pilot:
cargo install --force --path system/pilot --bin robonix-pilot $(CARGO_FLAGS)
build-executor:
cargo install --force --path system/executor --bin robonix-executor $(CARGO_FLAGS)
build-liaison:
cargo install --force --path system/liaison --bin robonix-liaison $(CARGO_FLAGS)
build-soma:
cargo install --force --path system/soma --bin robonix-soma $(CARGO_FLAGS)
build-vitals:
cargo install --force --path system/vitals --bin robonix-vitals $(CARGO_FLAGS)
fmt:
cargo fmt --all
check:
cargo fmt --all -- --check
cargo clippy --workspace -- -D warnings
install:
cargo install --force --path tools/codegen --bin robonix-codegen $(CARGO_FLAGS)
cargo install --force --path system/atlas --bin robonix-atlas $(CARGO_FLAGS)
cargo install --force --path system/pilot --bin robonix-pilot $(CARGO_FLAGS)
cargo install --force --path system/executor --bin robonix-executor $(CARGO_FLAGS)
cargo install --force --path system/liaison --bin robonix-liaison $(CARGO_FLAGS)
cargo install --force --path system/soma --bin robonix-soma $(CARGO_FLAGS)
cargo install --force --path system/vitals --bin robonix-vitals $(CARGO_FLAGS)
cargo install --force --path tools/rbnx --bin rbnx $(CARGO_FLAGS)
@# Register this clone as the robonix source tree so packages anywhere
@# on disk can resolve capabilities/IDL via `rbnx path`. By default this
@# updates ~/.robonix/config.yaml; set ROBONIX_HOME=/path/to/dir to keep
@# install/setup state isolated for CI or temporary runner workspaces.
@REPO_ROOT="$$(pwd)"; \
echo ""; \
echo "[make install] registering robonix_source_path → $$REPO_ROOT"; \
"$$HOME/.cargo/bin/rbnx" setup "$$REPO_ROOT" || { \
echo "[make install] WARNING: 'rbnx setup' failed — run it manually:"; \
echo " cd $$REPO_ROOT && rbnx setup"; \
}
clean:
cargo clean