-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 1.17 KB
/
Makefile
File metadata and controls
44 lines (32 loc) · 1.17 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
.DEFAULT_GOAL := build
# Build the entire project
build: build-proxy
# Run all tests
test: generate-csp test-proxy test-frontend
test-proxy:
CGO_ENABLED=1 go test -v -race -count=1 ./...
test-frontend:
cd webserver/dashboard/frontend && pnpm run test
# Run all benchmarks
bench:
go test -v -bench . -run ^$$ ./...
# Run cache performance comparison
bench-cache:
go test -v -bench BenchmarkCacheComparison -run ^$$ ./cache
# The proxy build depends on the generated CSP hashes
build-proxy: generate-csp
go build -ldflags "-X 'reservoir/version.Version=$(shell git describe --tags --always --dirty)'"
# Generating CSP hashes depends on having a fresh frontend build
generate-csp: build-frontend
go generate ./webserver/dashboard/csp
# Build the Svelte frontend
build-frontend:
cd webserver/dashboard/frontend && pnpm install && pnpm run build
# Run the Svelte frontend in development mode
dev-frontend:
cd webserver/dashboard/frontend && pnpm run dev $(ARGS)
# Remove build artifacts
clean:
rm -f reservoir.exe
rm -rf webserver/dashboard/frontend/build
.PHONY: build build-proxy generate-csp build-frontend dev-frontend test test-proxy test-frontend bench bench-cache clean