agent/Makefile
Snider dba621c108 feat(update): version injection via ldflags, park update command
- var version set by build ldflags (-X dappco.re/go/agent.version=X)
- Channel detection (stable/prerelease/dev) from version string
- Update command parked until version moves to module root
- Add Makefile with build/install/test targets + VERSION support

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-23 16:50:54 +00:00

36 lines
821 B
Makefile

# ── core-agent binary ──────────────────────────────────
BINARY_NAME=core-agent
CMD_PATH=./cmd/core-agent
MODULE_PATH=dappco.re/go/agent
# Default LDFLAGS to empty
LDFLAGS = ""
# If VERSION is set, inject into binary
ifdef VERSION
LDFLAGS = -ldflags "-X '$(MODULE_PATH).version=$(VERSION)'"
endif
.PHONY: build install agent-dev test coverage
build:
@echo "Building $(BINARY_NAME)..."
@go build $(LDFLAGS) -o $(BINARY_NAME) $(CMD_PATH)
install:
@echo "Installing $(BINARY_NAME)..."
@go install $(LDFLAGS) $(CMD_PATH)
agent-dev: build
@./$(BINARY_NAME) version
test:
@echo "Running tests..."
@go test ./...
coverage:
@echo "Generating coverage report..."
@go test -coverprofile=coverage.out ./...
@echo "Coverage: coverage.out"