undocker/Makefile
Motiejus Jakštys 0ff72b99d9 remove unnecessary support for prebuilt binaries
the users will know how to build the binaries themselves.
2021-09-29 14:30:18 +03:00

30 lines
747 B
Makefile

SCRIPTS = $(shell awk '/#!\/bin\/(ba)?sh/&&FNR==1{print FILENAME}' $(shell git ls-files))
GODEPS = $(shell git ls-files '*.go' go.mod go.sum)
VSN ?= $(shell git describe --dirty)
VSNHASH = $(shell git rev-parse --verify HEAD)
LDFLAGS = -ldflags "-X main.Version=$(VSN) -X main.VersionHash=$(VSNHASH)"
undocker: ## builds binary for the current architecture
go build $(LDFLAGS) -o $@
.PHONY: test
test: coverage.out
.PHONY: lint
lint:
go vet ./...
$(shell go env GOPATH)/bin/staticcheck -f stylish ./...
shellcheck $(SCRIPTS)
.INTERMEDIATE: coverage.out
coverage.out: $(GODEPS)
go test -race -cover -coverprofile $@ ./...
coverage.html: coverage.out
go tool cover -html=$< -o $@
.PHONY: clean
clean:
rm -f undocker-*-v* coverage.html