rollup from next branch (#4)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Co-authored-by: sneak <sneak@sneak.berlin> Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
28
Makefile
28
Makefile
@@ -4,37 +4,41 @@ export PATH := $(PATH):$(GOPATH)/bin
|
||||
PROTOC_GEN_GO := $(GOPATH)/bin/protoc-gen-go
|
||||
|
||||
ARCH := $(shell uname -m)
|
||||
VERSION := $(shell git describe --always --dirty=-dirty)
|
||||
GITREV := $(shell git describe --always --dirty=-dirty)
|
||||
|
||||
GOLDFLAGS += -X main.Version=$(VERSION)
|
||||
GOLDFLAGS += -X main.Buildarch=$(ARCH)
|
||||
GOLDFLAGS += -X main.Version=0.1.0
|
||||
GOLDFLAGS += -X main.Gitrev=$(GITREV)
|
||||
GOFLAGS := -ldflags "$(GOLDFLAGS)"
|
||||
|
||||
default: run
|
||||
|
||||
run: ./mfer
|
||||
run: ./mfer.cmd
|
||||
./$<
|
||||
./$< gen
|
||||
./$< gen --ignore-dotfiles
|
||||
|
||||
$(PROTOC_GEN_GO):
|
||||
test -e $(PROTOC_GEN_GO) || go install -v google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
|
||||
fixme:
|
||||
@grep -nir fixme . | grep -v Makefile
|
||||
|
||||
devprereqs:
|
||||
which gofumpt || go install -v mvdan.cc/gofumpt@latest
|
||||
which golangci-lint || go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
|
||||
mfer: $(PROTOC_GEN_GO) src/*.go cmd/*/*.go
|
||||
mfer.cmd: $(PROTOC_GEN_GO) mfer/*.go internal/*/*.go cmd/*/*.go
|
||||
protoc --version
|
||||
cd src && go generate .
|
||||
cd cmd/mfer && go build -o ../../mfer $(GOFLAGS) .
|
||||
cd mfer && go generate .
|
||||
cd cmd/mfer && go build -tags urfave_cli_no_docs -o ../../mfer.cmd $(GOFLAGS) .
|
||||
|
||||
clean:
|
||||
rm -rfv src/*.pb.go ./mfer
|
||||
rm -rfv mfer/*.pb.go mfer.cmd cmd/mfer/mfer
|
||||
|
||||
fmt: prereqs
|
||||
gofumpt -l -w src cmd
|
||||
fmt: devprereqs
|
||||
gofumpt -l -w mfer internal cmd
|
||||
golangci-lint run --fix
|
||||
prettier -w *.json *.md
|
||||
-prettier -w *.json
|
||||
-prettier -w *.md
|
||||
|
||||
lint:
|
||||
golangci-lint run
|
||||
|
||||
Reference in New Issue
Block a user