31 lines
864 B
Makefile
31 lines
864 B
Makefile
.PHONY: format-check module-verify build vet test openspec gateway-linux verify
|
|
|
|
GO ?= go
|
|
OPENSPEC ?= openspec
|
|
DIST_DIR ?= dist
|
|
|
|
format-check:
|
|
@test -z "$$(gofmt -l $$(find gateway -type f -name '*.go' -print))"
|
|
|
|
module-verify:
|
|
$(GO) mod verify
|
|
|
|
build:
|
|
$(GO) build ./...
|
|
|
|
vet:
|
|
$(GO) vet ./...
|
|
|
|
test:
|
|
$(GO) test ./... -count=1
|
|
|
|
openspec:
|
|
$(OPENSPEC) validate --all --strict --no-interactive
|
|
|
|
gateway-linux:
|
|
mkdir -p "$(DIST_DIR)"
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOWORK=off $(GO) build -mod=readonly -trimpath -buildvcs=false -ldflags=-buildid= -o "$(DIST_DIR)/verse-gateway-linux-amd64" ./cmd/verse-gateway
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOWORK=off $(GO) build -mod=readonly -trimpath -buildvcs=false -ldflags=-buildid= -o "$(DIST_DIR)/verse-gateway-linux-arm64" ./cmd/verse-gateway
|
|
|
|
verify: format-check module-verify build vet test openspec
|