33 lines
565 B
Makefile
33 lines
565 B
Makefile
COMMIT := $(shell git rev-list -1 HEAD)
|
|
LDFLAGS := "-X 'main.Commit=$(COMMIT)'"
|
|
DIST_LDFLAGS := $(LDFLAGS)" -s -w"
|
|
|
|
.PHONY: format check clean build run loc test
|
|
|
|
DEFAULT: run
|
|
|
|
format:
|
|
@gofmt -s -w ./...
|
|
|
|
check:
|
|
@test -z $$(gofmt -l .) || \
|
|
(echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
|
|
|
|
ci:
|
|
@golangci-lint run ./...
|
|
|
|
build:
|
|
@go build -ldflags=$(DIST_LDFLAGS) ./cmd/cairde
|
|
|
|
run: build
|
|
@./cairde
|
|
|
|
loc:
|
|
@find . -name "*.go" | xargs wc -l
|
|
|
|
test:
|
|
@go test ./... -cover -v
|
|
|
|
release:
|
|
@goreleaser release --snapshot --clean
|