-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakefile
More file actions
95 lines (77 loc) · 2.84 KB
/
makefile
File metadata and controls
95 lines (77 loc) · 2.84 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
default: gui
# Build with GUI (full version)
gui: check-upx
@echo "Building GUI application..."
go build -tags gui -ldflags="-s -w" -o pw.exe ./cmd/pw
upx --best --lzma pw.exe
# Build without GUI (headless/embedded version)
headless:
@echo "Building headless application..."
go build -ldflags="-s -w" -o pw-headless.exe ./cmd/pw
# Build both versions
all: gui headless
# Quick development build (no compression)
dev: cli-debug headless-debug
@echo "Development builds complete."
# Test target
test:
@echo "Running tests..."
go test -v ./...
# Test and build
test-build: test dev
# Show version information
version:
@echo "Current version info:"
@git describe --tags --always --dirty 2>nul || echo "No git tags found"
@go version
clean:
@echo "Cleaning build artifacts..."
-del /Q pw.exe pw-headless.exe pw-gui.exe 2>nul
-rmdir /S /Q dist 2>nul
-del /Q *.upx 2>nul
@echo "Clean complete."
install:
git pull
-go install -tags gui ./cmd/pw
# Build without compression (for development/debugging)
cli-debug:
go build -o pw.exe ./cmd/pw
# Build headless without compression (for development/debugging)
headless-debug:
go build -o pw-headless.exe ./cmd/pw
# Check if UPX is available
check-upx:
@upx --version >nul 2>&1 || (echo "UPX not found. Install from https://upx.github.io/" && exit 1)
# GoReleaser targets
release-test:
@echo "Validating GoReleaser configuration..."
goreleaser check
release-snapshot:
@echo "Building snapshot release..."
goreleaser build --snapshot --clean
release-dry-run:
@echo "Testing release process..."
goreleaser release --snapshot --skip-publish --clean
release:
@echo "Creating release..."
goreleaser release --clean
# Help target
help:
@echo "Available targets:"
@echo " gui - Build GUI version with UPX compression"
@echo " headless - Build headless version with UPX compression"
@echo " all - Build both versions"
@echo " dev - Quick development builds (no compression)"
@echo " test - Run tests"
@echo " test-build - Run tests then build"
@echo " version - Show version information"
@echo " cli-debug - Build GUI version without compression"
@echo " headless-debug - Build headless version without compression"
@echo " clean - Remove built binaries and artifacts"
@echo " install - Install GUI version with go install"
@echo " release-test - Validate GoReleaser configuration"
@echo " release-snapshot - Build all platforms locally"
@echo " release-dry-run - Test release without publishing"
@echo " release - Create actual release (requires git tag)"
@echo " help - Show this help message"
.PHONY: default gui headless all dev test test-build version clean install cli-debug headless-debug check-upx release-test release-snapshot release-dry-run release help