-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 740 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (23 loc) · 740 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
SHELL := bash
BUILD_GOOS ?= linux
BUILD_GOARCH ?= amd64
BINARY := bin/indexerd-$(BUILD_GOOS)-$(BUILD_GOARCH)
.PHONY: fmt fmt-check test test-race vet build verify clean
fmt:
@shopt -s globstar nullglob; files=(**/*.go); (($${#files[@]} == 0)) || gofmt -w "$${files[@]}"
fmt-check:
@shopt -s globstar nullglob; files=(**/*.go); output=$$(gofmt -l "$${files[@]}"); test -z "$$output" || \
(printf '%s\n%s\n' 'Go files require gofmt:' "$$output"; exit 1)
test:
go test -count=1 ./...
test-race:
go test -count=1 -race ./...
vet:
go vet ./...
build:
mkdir -p bin
GOOS=$(BUILD_GOOS) GOARCH=$(BUILD_GOARCH) CGO_ENABLED=0 go build -trimpath -o $(BINARY) ./cmd/indexerd
verify:
bash scripts/verify.sh
clean:
rm -rf bin coverage