makefile: Tidy up

Signed-off-by: Chris Crone <christopher.crone@docker.com>
This commit is contained in:
Chris Crone 2020-09-21 12:21:41 +02:00 committed by Guillaume Tardif
parent d42a931d67
commit c549d85505
1 changed files with 8 additions and 3 deletions

View File

@ -39,32 +39,37 @@ endif
all: cli
.PHONY: protos
protos:
protoc -I. --go_out=plugins=grpc,paths=source_relative:. ${PROTOS}
.PHONY: cli
cli:
GOOS=${GOOS} GOARCH=${GOARCH} $(GO_BUILD) $(TAGS) -o $(BINARY_WITH_EXTENSION) ./cli
.PHONY: cross
cross:
GOOS=linux GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-linux-amd64 ./cli
GOOS=darwin GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-darwin-amd64 ./cli
GOOS=windows GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-windows-amd64.exe ./cli
.PHONY: test
test:
go test $(TAGS) -cover $(shell go list ./... | grep -vE 'e2e')
.PHONY: lint
lint:
golangci-lint run --timeout 10m0s ./...
.PHONY: import-restrictions
import-restrictions:
import-restrictions --configuration import-restrictions.yaml
.PHONY: check-licese-headers
check-license-headers:
./scripts/validate/fileheader
.PHONY: check-go-mod
check-go-mod:
./scripts/validate/check-go-mod
FORCE:
.PHONY: all protos cli cross test lint