-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (36 loc) Β· 868 Bytes
/
Makefile
File metadata and controls
44 lines (36 loc) Β· 868 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
39
40
41
42
43
44
# Variables
BIN_DIR := bin
LINTER := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
.PHONY: all build clean setup lint fmt test
all: build
# Setup development tools
setup:
@echo "π οΈ Installing tools..."
go install $(LINTER)
@echo "β
Tools installed."
# Build binary
build:
@echo "ποΈ Building docod CLI..."
mkdir -p $(BIN_DIR)
go build -o $(BIN_DIR)/docod cmd/docod/main.go
@echo "β
Build complete. Binary in $(BIN_DIR)/docod"
# Format Code
fmt:
@echo "β¨ Formatting code..."
go fmt ./...
@echo "β
Code formatted."
# Run Lint
lint:
@echo "π Running Linter..."
golangci-lint run ./...
@echo "β
Lint passed."
# Run Tests
test:
@echo "π§ͺ Running Tests..."
go test -v ./...
@echo "β
Tests passed."
# Clean build artifacts
clean:
@echo "π§Ή Cleaning up..."
rm -rf $(BIN_DIR) docod.db
@echo "β
Cleaned."