abra/Makefile

50 lines
1003 B
Makefile
Raw Normal View History

2023-02-08 21:59:47 +00:00
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"
2023-02-08 21:59:47 +00:00
export GOPRIVATE=coopcloud.tech
2022-03-27 11:51:40 +00:00
all: format check build test
2023-09-07 16:50:25 +00:00
run-abra:
@go run -ldflags=$(LDFLAGS) $(ABRA)
2023-09-07 16:50:25 +00:00
run-kadabra:
@go run -ldflags=$(LDFLAGS) $(KADABRA)
install-abra:
@go install -ldflags=$(LDFLAGS) $(ABRA)
2023-09-07 16:50:25 +00:00
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:
2023-02-08 21:59:47 +00:00
@test -z $$(gofmt -l .) || \
(echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
test:
2021-11-09 10:36:24 +00:00
@go test ./... -cover -v
loc:
@find . -name "*.go" | xargs wc -l