-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
137 lines (104 loc) · 4.82 KB
/
Copy pathMakefile
File metadata and controls
137 lines (104 loc) · 4.82 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
.PHONY: help format format-backend format-ui format-check format-check-backend \
format-check-ui ui-macos clean dev dev-backend dev-ui-macos verify-docker-cli \
release-macos ui-linux ui-windows dev-ui-linux dev-ui-windows release-linux \
release-windows release package-macos package-windows package-linux package \
homebrew-cask benchmarks
help:
@echo "calf — common commands"
@echo ""
@echo " make dev-backend API daemon on :8765 (terminal 1)"
@echo " make dev-ui-macos Flutter app on macOS (terminal 2)"
@echo " make dev-ui-linux Flutter app on Linux (terminal 2)"
@echo " make dev-ui-windows Flutter app on Windows (terminal 2)"
@echo ""
@echo " make ui-macos build macOS app"
@echo " make ui-linux build Linux app"
@echo " make ui-windows build Windows app"
@echo ""
@echo " make release-macos build Go daemon + macOS app"
@echo " make release-linux build Go daemon + Linux app"
@echo " make release-windows build Go daemon + Windows app"
@echo " make release build for all platforms (macOS + Linux + Windows)"
@echo ""
@echo " make package-macos create macOS .dmg and .pkg installers"
@echo " make package-linux create Linux .deb, .rpm, and AppImage installers"
@echo " make package-windows create Windows .exe installer"
@echo ""
@echo " make format format Go + Dart sources"
@echo " make format-backend gofmt backend/"
@echo " make format-ui dart format ui/"
@echo " make format-check verify Go + Dart formatting (CI)"
@echo ""
@echo " make clean remove build artifacts"
@echo " make verify-docker-cli smoke-test docker CLI against calf"
@echo " make benchmarks run macOS performance benchmarks (see BENCHMARKS.md)"
@echo ""
@echo "Full guide: DEVELOPMENT.md"
format: format-backend format-ui
format-backend:
cd backend && gofmt -w .
format-ui:
cd ui && dart format .
format-check: format-check-backend format-check-ui
format-check-backend:
@test -z "$$(cd backend && gofmt -l .)" || (echo "Run 'make format-backend' to fix:"; cd backend && gofmt -l .; exit 1)
format-check-ui:
cd ui && dart format --output=none --set-exit-if-changed .
ui-macos:
cd ui && flutter build macos
ui-linux:
cd ui && flutter build linux
ui-windows:
cd ui && flutter build windows
release: release-macos release-linux release-windows
release-macos:
cd backend && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o calf-daemon-amd64 ./cmd/calf
cd backend && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o calf-daemon-arm64 ./cmd/calf
lipo -create -output backend/calf-daemon backend/calf-daemon-amd64 backend/calf-daemon-arm64
rm backend/calf-daemon-amd64 backend/calf-daemon-arm64
cd ui && flutter build macos
cp backend/calf-daemon ui/build/macos/Build/Products/Release/calf.app/Contents/MacOS/calf-daemon
rm backend/calf-daemon
codesign --force --sign - --identifier com.enegalan.calf.daemon ui/build/macos/Build/Products/Release/calf.app/Contents/MacOS/calf-daemon
./scripts/bundle-krunkit-macos.sh ui/build/macos/Build/Products/Release/calf.app
codesign --force --sign - --entitlements ui/macos/Runner/Release.entitlements ui/build/macos/Build/Products/Release/calf.app
codesign --verify --deep --strict ui/build/macos/Build/Products/Release/calf.app
release-linux: ui-linux
cd backend && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o calf-daemon ./cmd/calf
cp backend/calf-daemon ui/build/linux/x64/release/bundle/calf-daemon
rm backend/calf-daemon
release-windows: ui-windows
cd backend && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o calf-daemon.exe ./cmd/calf
cp backend/calf-daemon.exe ui/build/windows/x64/runner/Release/calf-daemon.exe
rm backend/calf-daemon.exe
package: package-macos package-windows package-linux
package-macos: release-macos
./scripts/package-macos.sh
homebrew-cask:
./scripts/update-homebrew.sh
package-windows: release-windows
pwsh -ExecutionPolicy Bypass -File scripts/package-windows.ps1
package-linux: release-linux
./scripts/package-linux.sh
clean:
cd ui && flutter clean
dev-backend:
cd backend && CGO_ENABLED=0 go run ./cmd/calf
dev-ui-macos:
cd ui && flutter run -d macos --dart-define=CALF_EXTERNAL_DAEMON=true
dev-ui-linux:
cd ui && flutter run -d linux
dev-ui-windows:
cd ui && flutter run -d windows
verify-docker-cli:
./scripts/verify-docker-cli.sh
benchmarks:
cd backend && CGO_ENABLED=0 go build -o calf-daemon ./cmd/calf
./scripts/benchmarks/run-all.sh
# Build/install the macOS krunkit+libkrun stack to ~/.config/calf/krunkit/ (required for release + local macOS engine).
krunkit-stack:
./scripts/spikes/install-krunkit-stack.sh
# Build a reproducible guest disk via throwaway limactl bake (see scripts/guest-image/).
guest-disk:
./scripts/guest-image/build-guest.sh --pack
dev: help