-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (67 loc) · 3.42 KB
/
Makefile
File metadata and controls
82 lines (67 loc) · 3.42 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
# flashpaste — top-level make targets.
#
# Useful targets:
# make deb build .deb package into dist/
# make rpm build .rpm package into dist/
# make install run install.sh
# make doctor run environment check
# make uninstall remove symlinks (best-effort)
# make clean remove dist/
# make release-deb tag VERSION + build .deb + (manual) gh release upload
REPO_ROOT := $(shell pwd)
VERSION ?= $(shell git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')
VERSION := $(if $(VERSION),$(VERSION),0.1.0)
.PHONY: deb rpm install doctor uninstall clean release-deb help bench bench-tier1 bench-tier3 bench-markdown
help:
@echo "flashpaste — make targets:"
@echo " make deb build .deb (VERSION=$(VERSION))"
@echo " make rpm build .rpm (VERSION=$(VERSION))"
@echo " make install run install.sh (symlinks into ~/.local/bin)"
@echo " make doctor environment check"
@echo " make uninstall remove symlinks"
@echo " make clean delete dist/"
@echo " make release-deb build .deb ready for GitHub Releases"
@echo " make bench dispatch latency benchmark (all tiers)"
@echo " make bench-tier1 bench Tier 1 only"
@echo " make bench-tier3 bench Tier 3 only"
@echo " make bench-markdown bench all tiers, markdown table output"
deb:
VERSION=$(VERSION) bash packaging/build-deb.sh
rpm:
VERSION=$(VERSION) bash packaging/build-rpm.sh
install:
bash install.sh
doctor:
bash bin/flashpaste-doctor.sh
uninstall:
@echo "Removing flashpaste symlinks from ~/.local/bin and ~/.local/share/applications"
@for f in tmux-paste-dispatch.sh clipboard-set.sh clipboard-janitor.sh \
get-clipboard-text.sh clip-pipeline-log.sh screenshot-to-clipboard \
flashpaste-screenshot-preload.sh flashpaste-doctor.sh \
flashpaste-trace.sh wl-paste tmux-paste-dispatch flashpaste-overlayd flashpaste-overlay; do \
[ -L "$$HOME/.local/bin/$$f" ] && rm "$$HOME/.local/bin/$$f" && echo " removed ~/.local/bin/$$f" || true; \
done
@for f in wl-clipboard.desktop wl-paste.desktop wl-copy.desktop; do \
[ -L "$$HOME/.local/share/applications/$$f" ] && rm "$$HOME/.local/share/applications/$$f" && echo " removed ~/.local/share/applications/$$f" || true; \
done
@[ -L "$$HOME/paste_image.sh" ] && rm "$$HOME/paste_image.sh" && echo " removed ~/paste_image.sh" || true
@systemctl --user disable --now clipboard-janitor.service flashpaste-screenshot-watcher.path flashpaste-overlayd.service 2>/dev/null || true
@echo "uninstall done"
clean:
rm -rf dist/
release-deb: deb
@echo "release-deb produced: dist/flashpaste_$(VERSION)_all.deb"
@echo "stable alias produced: dist/flashpaste_all.deb"
@echo "Upload to GitHub Releases:"
@echo " gh release create v$(VERSION) dist/flashpaste_$(VERSION)_all.deb dist/flashpaste_all.deb --title 'flashpaste v$(VERSION)' --generate-notes"
# ---------------------------------------------------------------------------
# Benchmarks
# ---------------------------------------------------------------------------
bench: ## Run the dispatch latency benchmark (100 iterations, all tiers)
@bash bin/flashpaste-bench.sh
bench-tier1: ## Bench Tier 1 only (bash hot path)
@bash bin/flashpaste-bench.sh --tier 1
bench-tier3: ## Bench Tier 3 only (daemon + trigger)
@bash bin/flashpaste-bench.sh --tier 3
bench-markdown: ## Bench all tiers, emit a markdown table
@bash bin/flashpaste-bench.sh --format markdown