-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (40 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
56 lines (40 loc) · 1.54 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
export CGO_ENABLED := 0
.PHONY: all build test lint lint-install doctor e2e caddy-test smoke-test qa-test check-imports check-todos systemd-check clean
all: lint check-imports check-todos test build
build:
go build -trimpath -ldflags="-s -w" ./...
test:
CGO_ENABLED=1 go test -race -count=1 ./...
lint:
go vet ./...
golangci-lint run ./...
# staticcheck v0.6.0, golangci-lint v1.64.8
lint-install:
go install honnef.co/go/tools/cmd/staticcheck@v0.6.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
doctor:
@echo "Checking prerequisites..."
@go version | grep -q 'go1\.\(2[2-9]\|[3-9][0-9]\)' || { echo "FAIL: Go >= 1.22 required"; exit 1; }
@command -v golangci-lint >/dev/null 2>&1 || { echo "FAIL: golangci-lint not found (run: make lint-install)"; exit 1; }
@command -v staticcheck >/dev/null 2>&1 || { echo "FAIL: staticcheck not found (run: make lint-install)"; exit 1; }
@echo "All prerequisites OK."
e2e: build
@sh test/e2e/roundtrip.sh
caddy-test:
@sh test/caddy/prefix_strip_test.sh
smoke-test: build
@sh test/smoke/10x_10mib.sh
qa-test: build
@sh test/smoke/qa-roundtrip.sh
check-imports:
@sh scripts/check_imports.sh
check-todos:
@sh scripts/check_todos.sh
systemd-check:
@command -v systemd-analyze >/dev/null 2>&1 || { echo "SKIP: systemd-analyze not found"; exit 0; }
systemd-analyze verify deploy/systemd/deaddrop-relay.service
test-derive: ## TEST-ONLY: build the local-laptop derivation wrapper
go build -trimpath -o ./tools/test-derive/test-derive ./tools/test-derive
clean:
go clean ./...
rm -rf bin/