2021-07-15 20:27:24 +00:00
|
|
|
ABRA := ./cmd/abra
|
2021-07-15 13:26:02 +00:00
|
|
|
COMMIT := $(shell git rev-list -1 HEAD)
|
|
|
|
GOPATH := $(shell go env GOPATH)
|
2021-07-15 20:27:24 +00:00
|
|
|
VERSION := $(shell cat ./version)
|
2021-07-20 20:45:06 +00:00
|
|
|
LDFLAGS := "-X 'main.Commit=$(COMMIT)' -X 'main.Version=$(VERSION)' -s -w"
|
2021-07-15 12:19:05 +00:00
|
|
|
|
2021-07-19 13:38:19 +00:00
|
|
|
all: run test install build clean format check static
|
2021-07-13 22:47:47 +00:00
|
|
|
|
|
|
|
run:
|
2021-07-15 21:01:31 +00:00
|
|
|
@go run -ldflags=$(LDFLAGS) $(ABRA)
|
2021-07-15 13:26:02 +00:00
|
|
|
|
2021-07-15 12:19:05 +00:00
|
|
|
install:
|
2021-07-15 21:01:31 +00:00
|
|
|
@go install -ldflags=$(LDFLAGS) $(ABRA)
|
2021-07-15 13:26:02 +00:00
|
|
|
|
|
|
|
build:
|
2021-07-15 21:01:31 +00:00
|
|
|
@go build -ldflags=$(LDFLAGS) $(ABRA)
|
2021-07-15 12:19:05 +00:00
|
|
|
|
|
|
|
clean:
|
2021-07-15 21:01:31 +00:00
|
|
|
@rm '$(GOPATH)/bin/abra'
|
2021-07-15 21:00:33 +00:00
|
|
|
|
|
|
|
format:
|
2021-07-15 21:01:31 +00:00
|
|
|
@gofmt -s -w .
|
2021-07-15 21:00:33 +00:00
|
|
|
|
|
|
|
check:
|
2021-07-15 21:01:31 +00:00
|
|
|
@test -z $$(gofmt -l .) || (echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
|
2021-07-15 21:49:58 +00:00
|
|
|
|
|
|
|
static:
|
|
|
|
@staticcheck $(ABRA)
|
2021-07-19 13:38:19 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
@go test ./config -cover
|
|
|
|
@go test ./client -cover
|