-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 833 Bytes
/
Copy pathMakefile
File metadata and controls
38 lines (29 loc) · 833 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
37
38
# Define phony targets to avoid conflicts with existing files/directories
.PHONY: all build test run clean fmt vet help proto
# Default target - builds and runs the application
all: build run
# Build the application - specify output directory for multiple packages
build:
@go build -o bin/main ./...
# Run tests - customize the pattern for test files
test:
@go test ./... -coverprofile=coverage.out
# Run the application
run: build
@./bin/main
# Clean up build artifacts
clean:
@rm -rf bin coverage.out
# Code formatting
fmt:
@go fmt ./...
# Static code analysis
vet:
@go vet ./...
# Help target - displays available commands
help:
@grep -E '^[^ ]+:.*?#?\{2\}' $(MAKEFILE_LIST) | sort
proto:
@protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
proto/*.proto