Files
aisys/tailnew/Makefile
T
kyleandClaude Opus 5.5 f445675292 Add tailnew: follow the newest log file in a directory
tailnew tails the most recently started file in a directory and switches
to each new one as it appears, for watching harnesses such as boxmaker's
run-plan.sh that write one log per task. A file counts as new when its
name is new, when the name points at a different file, or when it has
shrunk (a rerun truncating its old log).

Three front ends share one follower: plain tail -f style output, a
ratatui terminal view with scrollback, and an egui window with a folder
dialog and a Recursive checkbox. The Makefile provides build, gate and a
per-user install that also installs a desktop entry for the window.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 20:57:26 -07:00

32 lines
994 B
Makefile

# Per-user install: the binary and the desktop entry for the window.
PREFIX ?= $(HOME)/.local
BINDIR := $(PREFIX)/bin
APPDIR := $(or $(XDG_DATA_HOME),$(HOME)/.local/share)/applications
.PHONY: build gate install uninstall
build:
cargo build --release
# Formatting, lints with and without the window, tests, and the desktop entry. Offline once
# dependencies are fetched.
gate:
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --no-default-features -- -D warnings
cargo test
desktop-file-validate dist/tailnew.desktop
@echo "gate: ok"
# dist/tailnew.desktop carries an @BINDIR@ placeholder so it points wherever PREFIX put the binary.
install: build
install -Dm755 target/release/tailnew $(BINDIR)/tailnew
install -d $(APPDIR)
sed 's|@BINDIR@|$(BINDIR)|' dist/tailnew.desktop > $(APPDIR)/tailnew.desktop
-update-desktop-database $(APPDIR)
uninstall:
rm -f $(BINDIR)/tailnew $(APPDIR)/tailnew.desktop
-update-desktop-database $(APPDIR)