2022-09-28 03:12:21 +02:00
|
|
|
TARGETOS ?= linux
|
|
|
|
TARGETARCH ?= amd64
|
|
|
|
LDFLAGS := -s -w -extldflags "-static"
|
|
|
|
|
2024-01-15 08:06:52 +01:00
|
|
|
.PHONY: build
|
2022-09-28 03:12:21 +02:00
|
|
|
build:
|
2022-10-08 00:58:57 +02:00
|
|
|
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags '${LDFLAGS}' -v -a -tags netgo -o plugin-docker-buildx ./cmd/docker-buildx
|
2024-01-15 08:06:52 +01:00
|
|
|
|
|
|
|
format: install-tools
|
|
|
|
gofumpt -extra -w .
|
|
|
|
|
|
|
|
formatcheck: install-tools
|
|
|
|
@([ -z "$(shell gofumpt -d . | head)" ]) || (echo "Source is unformatted"; exit 1)
|
|
|
|
|
|
|
|
install-tools: ## Install development tools
|
|
|
|
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
|
|
go install mvdan.cc/gofumpt@latest; \
|
|
|
|
fi
|