distribusi-go/Makefile
decentral1se b9272e7a61
All checks were successful
continuous-integration/drone Build is passing
refactor!: v2
2024-07-23 21:40:45 +02:00

37 lines
627 B
Makefile

COMMIT := $(shell git rev-list -1 HEAD)
GCFLAGS := -gcflags="all=-l -B"
LDFLAGS := -ldflags="-X 'main.Commit=$(COMMIT)' -s -w"
ALLFLAGS := $(GCFLAGS) $(LDFLAGS)
default: build
check:
@test -z $$(gofmt -l .) || \
(echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
format:
@gofmt -s -w .
build: check
@go build $(ALLFLAGS) .
install:
@go install $(ALLFLAGS) .
test:
@go test ./... -cover -v
clean:
@rm ./distribusi
upx:
@upx --lzma ./distribusi
release:
@goreleaser release --snapshot --clean
deps:
@go get -t -u ./...
.PHONY: check format build install test clean upx release deps