Files
ratatoskr-go/Makefile
Hermes 44ac7d73bb
All checks were successful
CI / test (push) Successful in 47s
CI / build-and-package (amd64, darwin) (push) Successful in 40s
CI / build-and-package (amd64, linux) (push) Successful in 40s
CI / build-and-package (amd64, windows) (push) Successful in 39s
CI / build-and-package (arm64, darwin) (push) Successful in 40s
CI / build-and-package (arm64, linux) (push) Successful in 40s
feat: автообновление бинаря из Gitea Packages (/update, /status, авто-уведомление)
2026-08-16 11:50:23 +05:00

41 lines
1.0 KiB
Makefile

.PHONY: all build test vet clean run fmt
APP := ratatoskr
CMD_DIR := ./cmd/ratatoskr
GO ?= go
GOPATH := $(shell $(GO) env GOPATH)
GIT_SHA := $(shell git rev-parse --short HEAD 2>/dev/null || echo dev)
GOFLAGS ?= -ldflags="-s -w -X main.version=commit-$(GIT_SHA)"
all: test build
build:
$(GO) build $(GOFLAGS) -o $(APP) $(CMD_DIR)
test:
$(GO) test ./... -v -count=1 -timeout 120s
vet:
$(GO) vet ./...
fmt:
$(GO) fmt ./...
run: build
./$(APP) -config config.yaml
clean:
rm -f $(APP)
rm -rf /tmp/ratatoskr-*
.PHONY: bench
bench:
$(GO) test ./... -bench=. -benchmem -count=1 -timeout 120s
.PHONY: cross
cross:
GOOS=linux GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(APP)-linux-amd64 $(CMD_DIR)
GOOS=linux GOARCH=arm64 $(GO) build $(GOFLAGS) -o $(APP)-linux-arm64 $(CMD_DIR)
GOOS=darwin GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(APP)-darwin-amd64 $(CMD_DIR)
GOOS=darwin GOARCH=arm64 $(GO) build $(GOFLAGS) -o $(APP)-darwin-arm64 $(CMD_DIR)
GOOS=windows GOARCH=amd64 $(GO) build $(GOFLAGS) -o $(APP)-windows-amd64.exe $(CMD_DIR)