-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
42 lines (31 loc) · 1.55 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
prod:
GOOS=windows GOARCH=amd64 go build -o bin/unchained.windows.amd64.exe ./cmd/main.go
GOOS=darwin GOARCH=amd64 go build -o bin/unchained.darwin.amd64 ./cmd/main.go
GOOS=linux GOARCH=amd64 go build -o bin/unchained.linux.amd64 ./cmd/main.go
GOOS=windows GOARCH=arm64 go build -o bin/unchained.windows.arm64.exe ./cmd/main.go
GOOS=darwin GOARCH=arm64 go build -o bin/unchained.darwin.arm64 ./cmd/main.go
GOOS=linux GOARCH=arm64 go build -o bin/unchained.linux.arm64 ./cmd/main.go
find bin -type f -exec chmod u+x {} \;
strip:
GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o bin/unchained.windows.amd64.exe ./cmd/main.go
GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s" -o bin/unchained.darwin.amd64 ./cmd/main.go
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o bin/unchained.linux.amd64 ./cmd/main.go
GOOS=windows GOARCH=arm64 go build -ldflags "-w -s" -o bin/unchained.windows.arm64.exe ./cmd/main.go
GOOS=darwin GOARCH=arm64 go build -ldflags "-w -s" -o bin/unchained.darwin.arm64 ./cmd/main.go
GOOS=linux GOARCH=arm64 go build -ldflags "-w -s" -o bin/unchained.linux.arm64 ./cmd/main.go
find bin -type f -exec chmod u+x {} \;
tools:
go mod tidy
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b $(CURDIR)/bin v1.55.2
go get golang.org/x/tools/cmd/goimports
go install github.com/kisielk/errcheck@latest
check: errors imports fmt lint
errors:
errcheck -ignoretests -ignoregenerated -blank ./...
lint:
$(CURDIR)/bin/golangci-lint run
imports:
goimports -l -w .
fmt:
go fmt ./...