-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (54 loc) · 1.66 KB
/
Copy pathMakefile
File metadata and controls
69 lines (54 loc) · 1.66 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
.PHONY: build run test clean setup install help docker docker-run
# Default target
help:
@echo "KataGo Server - Available targets:"
@echo " make setup - Download KataGo and models, create configs"
@echo " make build - Build the server in release mode"
@echo " make run - Run the server"
@echo " make dev - Run the server in development mode with logging"
@echo " make test - Run unit tests"
@echo " make test-api - Test the API endpoints (requires server running)"
@echo " make clean - Clean build artifacts"
@echo " make install - Install as systemd service"
@echo " make docker - Build Docker image"
@echo " make docker-run - Run with Docker Compose"
@echo " make fmt - Format code"
@echo " make clippy - Run clippy linter"
setup:
@echo "Running setup script..."
./setup.sh
build:
cargo build --release
run: build
./target/release/katago-server
dev:
RUST_LOG=debug cargo run
test:
cargo test
test-api:
@echo "Testing API endpoints..."
./test.sh
clean:
cargo clean
rm -f katago katago_* *.bin.gz
install: build
@echo "Installing systemd service..."
@echo "Copying binary to /usr/local/bin..."
sudo cp target/release/katago-server /usr/local/bin/
@echo "Installing service file..."
sudo cp katago-server.service /etc/systemd/system/
@echo "Reloading systemd..."
sudo systemctl daemon-reload
@echo "Installation complete. Enable with: sudo systemctl enable katago-server"
docker:
docker build -t katago-server:latest .
docker-run:
docker-compose up -d
docker-stop:
docker-compose down
fmt:
cargo fmt
clippy:
cargo clippy -- -D warnings
watch:
cargo watch -x run