-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 942 Bytes
/
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
GOCMD = go
GOBUILD = $(GOCMD) build
GOCLEAN = $(GOCMD) clean
GOTEST = $(GOCMD) test
GOGET = $(GOCMD) get
GOMOD = $(GOCMD) mod
GOFMT = $(GOCMD) fmt
GOVET = $(GOCMD) vet
PACKAGENAME=virgo4-cache-verify
BINNAME=$(PACKAGENAME)
build: darwin
all: darwin linux
darwin:
#GOOS=darwin GOARCH=amd64 $(GOBUILD) -a -o bin/$(BINNAME).darwin cmd/$(PACKAGENAME)/*.go
# see https://github.com/golang/go/issues/41572
GOOS=darwin GOARCH=amd64 $(GOBUILD) -a -race -o bin/$(BINNAME).darwin cmd/$(PACKAGENAME)/*.go
linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -a -installsuffix cgo -o bin/$(BINNAME).linux cmd/$(PACKAGENAME)/*.go
clean:
$(GOCLEAN) cmd/
rm -rf bin
dep:
cd cmd/$(PACKAGENAME); $(GOGET) -u
$(GOMOD) tidy
$(GOMOD) verify
fmt:
cd cmd/$(PACKAGENAME); $(GOFMT)
vet:
cd cmd/$(PACKAGENAME); $(GOVET)
check:
go get honnef.co/go/tools/cmd/staticcheck
~/go/bin/staticcheck -checks all,-S1002,-ST1003 cmd/$(PACKAGENAME)/*.go