-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
44 lines (31 loc) · 1.08 KB
/
Makefile
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
VERSION=devel
ARTIFACT_NAME=shore
BUILD_CMD=go build -o $(ARTIFACT_NAME) cmd/shore/shore.go
LD_FLAGS=-ldflags="-s -w -X 'main.Version=$(VERSION)'"
setup:
go mod download
go mod vendor
go mod tidy
test:
go test ./... -race -cover -v -covermode=atomic -coverprofile=coverage_atomic.out
build: build-osx-amd build-osx-arm build-linux build-win
build-osx-amd:
GOOS=darwin GOARCH=amd64 $(BUILD_CMD)
build-osx-arm:
GOOS=darwin GOARCH=arm64 $(BUILD_CMD)
build-linux:
GOOS=linux GOARCH=amd64 $(BUILD_CMD)
build-win:
GOOS=windows GOARCH=amd64 $(BUILD_CMD)
build-release: build-release-osx build-release-linux build-release-win
build-release-osx:
GOOS=darwin GOARCH=amd64 go build $(LD_FLAGS) -o $(ARTIFACT_NAME)-osx cmd/shore/shore.go
build-release-linux:
GOOS=linux GOARCH=amd64 go build $(LD_FLAGS) -o $(ARTIFACT_NAME)-linux cmd/shore/shore.go
build-release-win:
GOOS=windows GOARCH=amd64 go build $(LD_FLAGS) -o $(ARTIFACT_NAME)-win cmd/shore/shore.go
release:
# Call latest go releaser script.
$(shell curl -sL https://git.io/goreleaser | bash)
clean:
rm -rf shore-* coverage_*.out