-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.13 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.13 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
.PHONY: build run install clean test lint fmt setup help
BINARY := drift
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -s -w -X main.version=$(VERSION)
## build: compile the binary to ./drift
build:
go build -ldflags "$(LDFLAGS)" -o $(BINARY) .
## run: build and run immediately
run: build
./$(BINARY)
## install: install to GOPATH/bin
install:
go install -ldflags "$(LDFLAGS)" .
## test: run all tests with race detector
test:
go test -race -count=1 ./...
## lint: run golangci-lint
lint:
golangci-lint run ./...
## fmt: format all Go files with gofmt -s
fmt:
gofmt -s -w ./...
## clean: remove built artefacts
clean:
rm -f $(BINARY)
## setup: download dependencies and tidy go.sum
setup:
go mod download
go mod tidy
## demo: record all demo GIFs with vhs (requires: brew install vhs)
demo:
vhs demo/waveform.tape
vhs demo/constellation.tape
vhs demo/rain.tape
vhs demo/particles.tape
vhs demo/pipes.tape
vhs demo/maze.tape
vhs demo/life.tape
vhs demo/clock.tape
vhs demo/demo.tape
## help: print this help
help:
@grep -E '^## ' Makefile | sed 's/## //' | column -t -s ':'