-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 821 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ── 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"