Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940BINARY := dipperPKG := ./cmd/dipperVERSION ?= 0.1.0-devLDFLAGS := -s -w -X main.version=$(VERSION)
# Charm deps pin a newer Go toolchain; auto keeps builds working.export GOTOOLCHAIN := auto
.PHONY: all build static run tidy vet fmt test clean install
all: build
build: go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) $(PKG)
static: CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) $(PKG) @file $(BINARY)
run: build ./$(BINARY)
tidy: go mod tidy
vet: go vet ./...
fmt: gofmt -w .
test: go test ./...
install: static install -Dm755 $(BINARY) $(HOME)/.local/bin/$(BINARY)
clean: rm -f $(BINARY)