-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (35 loc) · 922 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
42
43
44
45
GOCMD = go
GOBUILD = $(GOCMD) build
GOCLEAN = $(GOCMD) clean
GOTEST = $(GOCMD) test
GOFMT = $(GOCMD) fmt
GOVET = $(GOCMD) vet
GOGET = $(GOCMD) get
GOMOD = $(GOCMD) mod
BASENAME=dpg-jobs-ws
build: darwin
all: darwin linux
darwin:
GOOS=darwin GOARCH=amd64 $(GOBUILD) -a -o bin/$(BASENAME).darwin cmd/*.go
cp -r templates/ bin/templates
cp -r assets/ bin/assets
linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -a -installsuffix cgo -o bin/$(BASENAME).linux cmd/*.go
cp -r templates/ bin/templates
cp -r assets/ bin/assets
clean:
$(GOCLEAN) cmd/
rm -rf bin
fmt:
cd cmd; $(GOFMT)
vet:
cd cmd; $(GOVET)
dep:
$(GOGET) -u ./cmd/...
$(GOMOD) tidy
$(GOMOD) verify
check:
go install honnef.co/go/tools/cmd/staticcheck
$(HOME)/go/bin/staticcheck -checks all,-S1002,-ST1003 cmd/*.go
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
$(GOVET) -vettool=$(HOME)/go/bin/shadow ./cmd/...