COMMIT = $(shell git describe --always --tags --long --dirty) RELEASE ?= $(COMMIT) LDFLAGS := -X main.version=$(RELEASE) ifdef STATIC LDFLAGS += -w -s -extldflags=-static export CGO_ENABLED=0 endif all: fmt install fmt: go fmt ./... install: go install -ldflags "${LDFLAGS}" ./...