abra/Makefile

49 lines
999 B
Makefile
Raw Permalink 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
# NOTE(d1): default `make` optimised for Abra hacking
all: format check build-abra 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)
install-kadabra:
2023-09-07 16:50:25 +00:00
@go install -ldflags=$(LDFLAGS) $(KADABRA)
build-abra:
@go build -v -ldflags=$(DIST_LDFLAGS) $(ABRA)
build-kadabra:
@go build -v -ldflags=$(DIST_LDFLAGS) $(KADABRA)
build: build-abra build-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