-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (64 loc) · 2.62 KB
/
Makefile
File metadata and controls
80 lines (64 loc) · 2.62 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
.PHONY: build build-gui build-extension build-extension-chrome build-extension-firefox dev test test-race test-v test-stress test-cover install uninstall clean
BINARY = bolt
# Build tags required by Wails.
# webkit2_41 is needed on systems with webkit2gtk-4.1 (Fedora 39+, etc.)
WAILS_TAGS = desktop,production,webkit2_41
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS = -X main.version=$(VERSION)
build:
cd frontend && pnpm build
CGO_ENABLED=1 go build -tags $(WAILS_TAGS) -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/bolt/
build-gui:
wails build -tags webkit2_41
dev:
wails dev -tags webkit2_41
test:
@mkdir -p frontend/dist && touch frontend/dist/.gitkeep
go test ./... -count=1 -timeout 120s
test-race:
@mkdir -p frontend/dist && touch frontend/dist/.gitkeep
go test ./... -race -count=1 -timeout 120s
test-v:
@mkdir -p frontend/dist && touch frontend/dist/.gitkeep
go test ./... -v -count=1 -timeout 120s
test-stress:
@mkdir -p frontend/dist && touch frontend/dist/.gitkeep
go test -tags=stress ./... -count=1 -timeout 300s
test-cover:
@mkdir -p frontend/dist && touch frontend/dist/.gitkeep
go test ./... -count=1 -coverprofile=coverage.out -timeout 120s
go tool cover -func=coverage.out
build-extension: build-extension-chrome build-extension-firefox
build-extension-chrome:
mkdir -p dist
cd extensions/chrome && zip -r ../../dist/bolt-capture-chrome.zip . -x ".*"
build-extension-firefox:
mkdir -p dist
cd extensions/firefox && zip -r ../../dist/bolt-capture-firefox.zip . -x ".*"
install: build
mkdir -p ~/.local/bin
cp $(BINARY) ~/.local/bin/
mkdir -p ~/.config/systemd/user
cp packaging/bolt.service ~/.config/systemd/user/
mkdir -p ~/.local/share/applications
sed 's|Exec=bolt|Exec=$(HOME)/.local/bin/bolt|' packaging/bolt.desktop > ~/.local/share/applications/bolt.desktop
mkdir -p ~/.local/share/icons/hicolor/256x256/apps
cp build/appicon.png ~/.local/share/icons/hicolor/256x256/apps/bolt.png
-gtk-update-icon-cache -f -t ~/.local/share/icons/hicolor 2>/dev/null
-update-desktop-database ~/.local/share/applications 2>/dev/null
systemctl --user daemon-reload
systemctl --user enable --now bolt
uninstall:
-systemctl --user stop bolt
-systemctl --user disable bolt
rm -f ~/.local/bin/$(BINARY)
rm -f ~/.config/systemd/user/bolt.service
rm -f ~/.local/share/applications/bolt.desktop
rm -f ~/.local/share/icons/hicolor/256x256/apps/bolt.png
-gtk-update-icon-cache -f -t ~/.local/share/icons/hicolor 2>/dev/null
-update-desktop-database ~/.local/share/applications 2>/dev/null
systemctl --user daemon-reload
clean:
rm -f $(BINARY)
rm -rf frontend/dist dist
go clean -testcache