1
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
undocker/Makefile

30 lines
742 B
Makefile

2 years ago
SCRIPTS = $(shell awk '/#!\/bin\/(ba)?sh/&&FNR==1{print FILENAME}' $(shell git ls-files))
GODEPS = $(shell git ls-files '*.go' go.mod go.sum)
2 years ago
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
3 years ago
.PHONY: lint
2 years ago
lint:
3 years ago
go vet ./...
$(shell go env GOPATH)/bin/staticcheck -f stylish ./...
2 years ago
shellcheck $(SCRIPTS)
.INTERMEDIATE: coverage.out
coverage.out: $(GODEPS)
go test -race -cover -coverprofile $@ ./...
coverage.html: coverage.out
go tool cover -html=$< -o $@
3 years ago
.PHONY: clean
clean:
rm -f undocker coverage.html