-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (73 loc) · 1.91 KB
/
Makefile
File metadata and controls
90 lines (73 loc) · 1.91 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
85
86
87
88
89
90
.PHONY: build test clean install run fmt lint check help
# Default target
.DEFAULT_GOAL := help
# Project configuration
PROJECT_NAME := rusty-dns
CARGO := cargo
INSTALL_PATH := /usr/local/bin
## Build the project in release mode
build:
@echo "Building $(PROJECT_NAME)..."
$(CARGO) build --release
## Build in debug mode
build-debug:
@echo "Building $(PROJECT_NAME) in debug mode..."
$(CARGO) build
## Run all tests
test:
@echo "Running tests..."
$(CARGO) test
## Run tests with output
test-verbose:
@echo "Running tests (verbose)..."
$(CARGO) test -- --nocapture
## Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
$(CARGO) clean
@rm -rf target/
## Install dependencies (Rust doesn't need this, but kept for consistency)
install:
@echo "Checking Rust toolchain..."
@rustc --version
@cargo --version
## Install the binary to system
install-bin: build
@echo "Installing $(PROJECT_NAME) to $(INSTALL_PATH)..."
@cp target/release/rusty-dns $(INSTALL_PATH)/
@echo "Installed successfully!"
## Run the server (help command)
run:
@echo "Running $(PROJECT_NAME)..."
$(CARGO) run -- --help
## Format code
fmt:
@echo "Formatting code..."
$(CARGO) fmt --all
## Check formatting without making changes
fmt-check:
@echo "Checking code formatting..."
$(CARGO) fmt --all -- --check
## Run clippy for linting
lint:
@echo "Running clippy..."
$(CARGO) clippy --all-targets --all-features -- -D warnings
## Run all checks (fmt, lint, test)
check: fmt-check lint test
@echo "All checks passed!"
## Run cargo check (fast compile check)
check-build:
@echo "Checking build..."
$(CARGO) check --all-targets
## Build documentation
doc:
@echo "Building documentation..."
$(CARGO) doc --no-deps --open
## Show this help message
help:
@echo "$(PROJECT_NAME) - Dynamic DNS with MCP support"
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Available targets:"
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /'