This repository has been archived on 2021-07-16. You can view files and clone it, but cannot push or open issues or pull requests.
go-abra/Makefile
decentral1se c65ae974dd
Add experimental staticcheck into linting CI
See https://staticcheck.io for more. This is set to be ignored
on failure so that it doesn't disrupt current work flows but maybe
it is nice to add. Just drop the `ignore: ...` line and it will fail
builds.
2021-07-15 23:57:08 +02:00

29 lines
591 B
Makefile

ABRA := ./cmd/abra
COMMIT := $(shell git rev-list -1 HEAD)
GOPATH := $(shell go env GOPATH)
VERSION := $(shell cat ./version)
LDFLAGS := "-X 'main.Commit=$(COMMIT)' -X 'main.Version=$(VERSION)'"
all: run install build clean format check static
run:
@go run -ldflags=$(LDFLAGS) $(ABRA)
install:
@go install -ldflags=$(LDFLAGS) $(ABRA)
build:
@go build -ldflags=$(LDFLAGS) $(ABRA)
clean:
@rm '$(GOPATH)/bin/abra'
format:
@gofmt -s -w .
check:
@test -z $$(gofmt -l .) || (echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
static:
@staticcheck $(ABRA)