Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (67 loc) · 2.73 KB
/
Copy pathMakefile
File metadata and controls
82 lines (67 loc) · 2.73 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
.PHONY: help test packaging-test prepare-release-files lint format format-check ci-check build build-binary build-bundle install clean
PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
SHAREDIR ?= $(PREFIX)/share
DATADIR ?= $(SHAREDIR)/aish
SYSTEMD_UNITDIR ?= /etc/systemd/system
DESTDIR ?=
TARGET ?= x86_64-unknown-linux-musl
NO_BUILD ?= 0
PYTHON ?= python3
help:
@echo "AI Shell - Make Commands"
@echo ""
@echo "Building:"
@echo " make build Build release binary (musl)"
@echo " make build-bundle Build release bundle archive"
@echo " make install Install built artifacts into DESTDIR/PREFIX"
@echo ""
@echo "Development:"
@echo " make test Run tests"
@echo " make packaging-test Run release script smoke tests"
@echo " make prepare-release-files VERSION=X.Y.Z[-PRERELEASE] [DATE=YYYY-MM-DD]"
@echo " make lint Run clippy"
@echo " make format Format code"
@echo " make format-check Check code formatting"
@echo " make ci-check Run the same local validation gates as CI"
@echo " make clean Clean build artifacts"
test:
cargo test --workspace
PYTHON="$(PYTHON)" ./packaging/tests/release_scripts_smoke.sh
./packaging/tests/seed_skills_ownership_smoke.sh
packaging-test:
PYTHON="$(PYTHON)" ./packaging/tests/release_scripts_smoke.sh
./packaging/tests/seed_skills_ownership_smoke.sh
prepare-release-files:
@test -n "$(VERSION)" || { echo "VERSION is required, for example: make prepare-release-files VERSION=1.0.0-beta.1" >&2; exit 2; }
$(PYTHON) packaging/scripts/update_release_files.py --version "$(VERSION)" $(if $(DATE),--date "$(DATE)",)
lint:
cargo clippy --all-targets -- -D warnings
format:
cargo fmt --all
format-check:
cargo fmt --all -- --check
ci-check: format-check lint test
build:
./build.sh
build-binary: build
build-bundle:
./packaging/build_bundle.sh
install:
@if [ "$(NO_BUILD)" != "1" ]; then \
$(MAKE) build; \
fi
@echo "Installing built artifacts into $(DESTDIR)"
install -d "$(DESTDIR)$(BINDIR)"
install -m 0755 target/$(TARGET)/release/aish "$(DESTDIR)$(BINDIR)/aish"
# security_policy.yaml is compile-time embedded / seeded under ~/.config/aish
# at runtime; do not install a system copy under /etc/aish.
install -d "$(DESTDIR)$(SYSTEMD_UNITDIR)"
sed 's|@AISH_BINDIR@|$(BINDIR)|g' packaging/systemd/aish-sandbox.service.in > "$(DESTDIR)$(SYSTEMD_UNITDIR)/aish-sandbox.service"
chmod 0644 "$(DESTDIR)$(SYSTEMD_UNITDIR)/aish-sandbox.service"
install -m 0644 packaging/systemd/aish-sandbox.socket "$(DESTDIR)$(SYSTEMD_UNITDIR)/aish-sandbox.socket"
@# Packaged skills are compile-time embedded into the aish binary; nothing to
@# install under $(DATADIR)/skills or seed into ~/.config/aish/skills.
clean:
cargo clean
rm -rf dist/ build/ artifacts/