You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
990 B

GOPATH := $(shell go env GOPATH)
export PATH := $(PATH):$(GOPATH)/bin
PROTOC_GEN_GO := $(GOPATH)/bin/protoc-gen-go
ARCH := $(shell uname -m)
VERSION := $(shell git describe --always --dirty=-dirty)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildarch=$(ARCH)
GOFLAGS := -ldflags "$(GOLDFLAGS)"
default: run
run: ./mfer
./$< gen
test -e $(PROTOC_GEN_GO) || go install -v
which gofumpt || go install -v
which golangci-lint || go install -v
mfer: $(PROTOC_GEN_GO) src/*.go cmd/*/*.go
protoc --version
cd src && go generate .
cd cmd/mfer && go build -o ../../mfer $(GOFLAGS) .
rm -rfv src/*.pb.go ./mfer
fmt: prereqs
gofumpt -l -w src cmd
golangci-lint run --fix
prettier -w *.json *.md
golangci-lint run
sh -c 'test -z "$$(gofmt -l .)"'
docker build .