Files

27 lines
519 B
Makefile

BINARY := agent-lib
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -s -w -X github.com/m3tam3re/agent-lib/internal/version.Version=$(VERSION)
.PHONY: build test vet lint fmt fmt-check clean
build:
go build -ldflags '$(LDFLAGS)' -o $(BINARY) .
test:
go test ./...
vet:
go vet ./...
fmt:
gofmt -w .
fmt-check:
@out=$$(gofmt -l .); if [ -n "$$out" ]; then \
echo "gofmt required on:"; echo "$$out"; exit 1; fi
lint: vet fmt-check
clean:
rm -rf $(BINARY) dist/