-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 891 Bytes
/
Makefile
File metadata and controls
43 lines (31 loc) · 891 Bytes
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
.PHONY: build test run clean lint fmt vet build-full generate_screenshots
BINARY_NAME=lattice
build:
go build -o $(BINARY_NAME) .
build-full:
@echo "Building with version information..."
@VERSION=$$(git describe --tags --abbrev=0 2>/dev/null || echo "dev"); \
COMMIT=$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown"); \
DATE=$$(date +%Y-%m-%d); \
echo "Version: $$VERSION"; \
echo "Commit: $$COMMIT"; \
echo "Date: $$DATE"; \
go build -ldflags="-X 'main.version=$$VERSION' -X 'main.commit=$$COMMIT' -X 'main.date=$$DATE'" -o $(BINARY_NAME)-full .;
run:
go run .
test:
go test ./...
test-verbose:
go test -v ./...
test-coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
clean:
rm -rf $(BUILD_DIR)
rm -f coverage.out coverage.html
fmt:
go fmt ./...
vet:
go vet ./...
lint: fmt vet
all: lint test build