-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (69 loc) · 1.82 KB
/
Makefile
File metadata and controls
84 lines (69 loc) · 1.82 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.PHONY: build test clean install help
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
BINARY_NAME=aws-resources
BINARY_PATH=bin/$(BINARY_NAME)
# Build the application
build:
$(GOBUILD) -o $(BINARY_PATH) ./cmd/$(BINARY_NAME)
# Build using script (with version info)
build-script:
./scripts/build.sh
# Run tests
test:
$(GOTEST) -v ./...
# Clean build artifacts
clean:
$(GOCLEAN)
rm -f $(BINARY_PATH)
# Install dependencies
deps:
$(GOMOD) download
$(GOMOD) tidy
# Install binary to GOPATH/bin
install: build
cp $(BINARY_PATH) $(GOPATH)/bin/
# Development build with race detection
dev:
$(GOBUILD) -race -o $(BINARY_PATH) ./cmd/$(BINARY_NAME)
# Run tests with coverage
test-coverage:
$(GOTEST) -v -cover ./...
# Run tests using script (with coverage report)
test-script:
./scripts/test.sh
# Format code
fmt:
$(GOCMD) fmt ./...
# Vet code
vet:
$(GOCMD) vet ./...
# Run all checks
check: fmt vet test
# Run linting using script
lint-script:
./scripts/lint.sh
# Show help
help:
@echo "Available commands:"
@echo " build - Build the application"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage"
@echo " clean - Clean build artifacts"
@echo " deps - Install/update dependencies"
@echo " install - Install binary to GOPATH/bin"
@echo " dev - Build with race detection"
@echo " fmt - Format code"
@echo " vet - Vet code"
@echo " check - Run format, vet, and test"
@echo " help - Show this help"
@echo ""
@echo "Script-based commands:"
@echo " build-script - Build with version info using script"
@echo " test-script - Run tests with coverage report using script"
@echo " lint-script - Run linting using script"