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)'"
|
2021-07-21 07:20:17 +00:00
|
|
|
DIST_LDFLAGS := $(LDFLAGS)" -s -w"
|
2023-02-08 21:59:47 +00:00
|
|
|
|
2021-08-13 12:28:18 +00:00
|
|
|
export GOPRIVATE=coopcloud.tech
|
2021-07-15 12:19:05 +00:00
|
|
|
|
2022-03-27 11:51:40 +00:00
|
|
|
all: format check build test
|
2021-07-13 22:47:47 +00:00
|
|
|
|
2023-09-07 16:50:25 +00:00
|
|
|
run-abra:
|
2021-07-15 21:01:31 +00:00
|
|
|
@go run -ldflags=$(LDFLAGS) $(ABRA)
|
2021-07-15 13:26:02 +00:00
|
|
|
|
2023-09-07 16:50:25 +00:00
|
|
|
run-kadabra:
|
|
|
|
@go run -ldflags=$(LDFLAGS) $(KADABRA)
|
|
|
|
|
|
|
|
install-abra:
|
2021-07-15 21:01:31 +00:00
|
|
|
@go install -ldflags=$(LDFLAGS) $(ABRA)
|
2021-07-15 13:26:02 +00:00
|
|
|
|
2023-09-07 16:50:25 +00:00
|
|
|
install-kadaabra:
|
|
|
|
@go install -ldflags=$(LDFLAGS) $(KADABRA)
|
|
|
|
|
2023-09-05 09:46:18 +00:00
|
|
|
build-abra:
|
2023-02-11 22:40:47 +00:00
|
|
|
@go build -v -ldflags=$(LDFLAGS) $(ABRA)
|
2021-07-15 12:19:05 +00:00
|
|
|
|
2023-09-05 09:46:18 +00:00
|
|
|
build-kadabra:
|
|
|
|
@go build -v -ldflags=$(LDFLAGS) $(KADABRA)
|
|
|
|
|
2021-07-21 07:20:17 +00:00
|
|
|
build:
|
2023-02-11 22:40:47 +00:00
|
|
|
@go build -v -ldflags=$(DIST_LDFLAGS) $(ABRA)
|
|
|
|
@go build -v -ldflags=$(DIST_LDFLAGS) $(KADABRA)
|
2021-07-21 07:20:17 +00:00
|
|
|
|
2021-07-15 12:19:05 +00:00
|
|
|
clean:
|
2021-07-15 21:01:31 +00:00
|
|
|
@rm '$(GOPATH)/bin/abra'
|
2023-02-08 18:53:04 +00:00
|
|
|
@rm '$(GOPATH)/bin/kadabra'
|
2021-07-15 21:00:33 +00:00
|
|
|
|
|
|
|
format:
|
2021-07-15 21:01:31 +00:00
|
|
|
@gofmt -s -w .
|
2021-07-15 21:00:33 +00:00
|
|
|
|
|
|
|
check:
|
2023-02-08 21:59:47 +00:00
|
|
|
@test -z $$(gofmt -l .) || \
|
|
|
|
(echo "gofmt: formatting issue - run 'make format' to resolve" && exit 1)
|
2021-07-15 21:49:58 +00:00
|
|
|
|
2023-09-21 10:06:41 +00:00
|
|
|
test:
|
2021-11-09 10:36:24 +00:00
|
|
|
@go test ./... -cover -v
|
2021-09-04 23:57:50 +00:00
|
|
|
|
|
|
|
loc:
|
|
|
|
@find . -name "*.go" | xargs wc -l
|