decentral1se
9b6eb613aa
All checks were successful
continuous-integration/drone/push Build is passing
50 lines
1003 B
Makefile
50 lines
1003 B
Makefile
ABRA := ./cmd/abra
|
|
KADABRA := ./cmd/kadabra
|
|
COMMIT := $(shell git rev-list -1 HEAD)
|
|
GOPATH := $(shell go env GOPATH)
|
|
LDFLAGS := "-X 'main.Commit=$(COMMIT)'"
|
|
DIST_LDFLAGS := $(LDFLAGS)" -s -w"
|
|
|
|
export GOPRIVATE=coopcloud.tech
|
|
|
|
all: format check build test
|
|
|
|
run-abra:
|
|
@go run -ldflags=$(LDFLAGS) $(ABRA)
|
|
|
|
run-kadabra:
|
|
@go run -ldflags=$(LDFLAGS) $(KADABRA)
|
|
|
|
install-abra:
|
|
@go install -ldflags=$(LDFLAGS) $(ABRA)
|
|
|
|
install-kadaabra:
|
|
@go install -ldflags=$(LDFLAGS) $(KADABRA)
|
|
|
|
build-abra:
|
|
@go build -v -ldflags=$(LDFLAGS) $(ABRA)
|
|
|
|
build-kadabra:
|
|
@go build -v -ldflags=$(LDFLAGS) $(KADABRA)
|
|
|
|
build:
|
|
@go build -v -ldflags=$(DIST_LDFLAGS) $(ABRA)
|
|
@go build -v -ldflags=$(DIST_LDFLAGS) $(KADABRA)
|
|
|
|
clean:
|
|
@rm '$(GOPATH)/bin/abra'
|
|
@rm '$(GOPATH)/bin/kadabra'
|
|
|
|
format:
|
|
@gofmt -s -w .
|
|
|
|
check:
|
|
@test -z $$(gofmt -l .) || \
|
|
(echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
|
|
|
|
test:
|
|
@go test ./... -cover -v
|
|
|
|
loc:
|
|
@find . -name "*.go" | xargs wc -l
|