-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (46 loc) · 2.65 KB
/
Makefile
File metadata and controls
66 lines (46 loc) · 2.65 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
.PHONY: all build build-release swift-build rust-build rust-build-release \
test rust-test smoke-test lint fmt install clean
# Run make targets from within `nix develop` or a rustup environment.
# Default: release build of both binaries
all: build-release
# ── Build ────────────────────────────────────────────────────────────────────
build: rust-build
build-release: swift-build rust-build-release
# Swift CLI — MUST be run outside nix develop (uses system toolchain)
swift-build:
cd swift && swift build -c release
rust-build:
cargo build
rust-build-release:
cargo build --release
# ── Install ───────────────────────────────────────────────────────────────────
# Copy release binaries to ~/.local/bin.
# Both binaries land as siblings so remtodo finds reminders-helper
# without relying on CWD or REMINDERS_HELPER env var.
install: rust-build-release
@test -f swift/.build/release/reminders-helper || \
(echo "Error: Swift binary not found. Run outside nix develop first:" && \
echo " cd swift && swift build -c release" && exit 1)
mkdir -p ~/.local/bin
cp target/release/remtodo ~/.local/bin/remtodo
cp swift/.build/release/reminders-helper ~/.local/bin/reminders-helper
@echo "Installed remtodo and reminders-helper to ~/.local/bin"
# ── Smoke test ───────────────────────────────────────────────────────────────
smoke-test: build-release
REMINDERS_HELPER=swift/.build/release/reminders-helper \
RUST_LOG=info \
./target/release/remtodo sync --dry-run
# ── Test ─────────────────────────────────────────────────────────────────────
test: rust-test
rust-test:
cargo test
# ── Lint / Format ─────────────────────────────────────────────────────────────
lint:
cargo clippy -- -D warnings
cargo fmt --check
fmt:
cargo fmt
# ── Clean ─────────────────────────────────────────────────────────────────────
clean:
cargo clean
rm -rf swift/.build