-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (55 loc) · 1.5 KB
/
Makefile
File metadata and controls
72 lines (55 loc) · 1.5 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
.PHONY: build build-db build-server clean test fmt vet lint run-db run-server help
BINARY_DB=bin/db
BINARY_SERVER=bin/scrappah
CMD_DB=./cmd/db
CMD_SERVER=./cmd/scrappah
help:
@echo "Available targets:"
@echo " build - Build both executables"
@echo " build-db - Build database helper tool"
@echo " build-server - Build main server"
@echo " run-db - Run database helper (pass args with ARGS=...)"
@echo " run-server - Run main server"
@echo " test-proxy - Test IP address through first SOCKS5 proxy (port 8001)"
@echo " test - Run all tests"
@echo " fmt - Format Go code"
@echo " vet - Run go vet"
@echo " lint - Run golangci-lint (if available)"
@echo " clean - Remove built binaries"
build: build-db build-server
build-db:
@mkdir -p bin
go build -o $(BINARY_DB) $(CMD_DB)
build-server:
@mkdir -p bin
go build -o $(BINARY_SERVER) $(CMD_SERVER)
run-db: build-db
$(BINARY_DB) $(ARGS)
run-server: build-server
$(BINARY_SERVER)
test-proxy:
@echo "Testing IP through SOCKS5 proxy (port 8001)..."
curl --socks5 localhost:8001 https://api.ipify.org
test:
go test ./...
test-verbose:
go test -v ./...
test-coverage:
go test -cover ./...
fmt:
go fmt ./...
vet:
go vet ./...
lint:
@if command -v golangci-lint >/dev/null 2>&1; then \
golangci-lint run; \
else \
echo "golangci-lint not installed, running go vet instead"; \
go vet ./...; \
fi
clean:
rm -rf bin/
dev-setup:
go mod tidy
go mod download
.DEFAULT_GOAL := help