-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (53 loc) · 1.36 KB
/
Copy pathMakefile
File metadata and controls
65 lines (53 loc) · 1.36 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
.PHONY: build run test clean
# Build the application
build:
cd src && go build -o ../bin/nexus-mind
# Run the application
run: build
./bin/nexus-mind
# Run all tests
test:
cd src && go test -v ./...
# Run tests with race detection
test-race:
cd src && go test -race -v ./...
# Run benchmarks
bench:
cd src && go test -bench=. -benchmem ./...
# Clean build artifacts
clean:
rm -rf bin/
rm -f src/nexus-mind
# Create directories if they don't exist
dirs:
mkdir -p bin
mkdir -p data
# Run tests for a specific package
test-pkg:
@if [ -z "$(PKG)" ]; then \
echo "Usage: make test-pkg PKG=vector/index"; \
exit 1; \
fi
cd src && go test -v ./$(PKG)
# Format code
fmt:
cd src && go fmt ./...
# Check for lint issues
lint:
cd src && go vet ./...
# Initialize the project
init: dirs
# Help
help:
@echo "Available targets:"
@echo " build - Build the application"
@echo " run - Run the application"
@echo " test - Run all tests"
@echo " test-race - Run tests with race detection"
@echo " bench - Run benchmarks"
@echo " clean - Clean build artifacts"
@echo " dirs - Create necessary directories"
@echo " test-pkg - Run tests for a specific package (e.g., make test-pkg PKG=vector/index)"
@echo " fmt - Format code"
@echo " lint - Check for lint issues"
@echo " init - Initialize the project"