-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 1.09 KB
/
Makefile
File metadata and controls
59 lines (47 loc) · 1.09 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.PHONY: build test clean docker run lint help
# Binary name
BINARY=clamav-rest
# Build the binary
build:
go build -o $(BINARY) .
# Run tests
test:
go test -v ./...
# Run tests with coverage
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Clean build artifacts
clean:
rm -f $(BINARY) coverage.out coverage.html
# Build Docker image
docker:
docker build -t $(BINARY) .
# Run locally (requires clamd)
run: build
./$(BINARY)
# Run linter (requires golangci-lint)
lint:
golangci-lint run
# Format code
fmt:
go fmt ./...
# Check for issues
vet:
go vet ./...
# Default target
.DEFAULT_GOAL := help
# Show help
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " build Build the binary"
@echo " test Run tests"
@echo " coverage Run tests with coverage report"
@echo " clean Remove build artifacts"
@echo " docker Build Docker image"
@echo " run Build and run locally (requires clamd)"
@echo " lint Run golangci-lint"
@echo " fmt Format code"
@echo " vet Check for issues"