-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (72 loc) · 2.09 KB
/
Makefile
File metadata and controls
85 lines (72 loc) · 2.09 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
.PHONY: build run clean test install help
# Default target
help:
@echo "Nexus CLI - Available targets:"
@echo " make build - Build the nexus binary"
@echo " make run - Run the TUI directly"
@echo " make clean - Remove built binaries"
@echo " make test - Run tests"
@echo " make install - Install to GOPATH/bin"
@echo " make cross-build - Build for all platforms"
@echo " make dev - Run with hot reload (requires air)"
@echo ""
@echo "CLI Commands:"
@echo " ./nexus version - Show version"
@echo " ./nexus help - Show help"
@echo " ./nexus config - View config"
# Build the binary
build:
@echo "Building nexus..."
@go build -o nexus ./cmd/nexus
@echo "✓ Build complete: ./nexus"
# Run the TUI
run: build
@./nexus
# Clean build artifacts
clean:
@echo "Cleaning..."
@rm -f nexus nexus-* *.exe
@echo "✓ Clean complete"
# Run tests
test:
@go test -v ./...
# Install to GOPATH/bin
install:
@echo "Installing to GOPATH/bin..."
@go install ./cmd/nexus
@echo "✓ Installed: $(shell go env GOPATH)/bin/nexus"
# Cross-compile for multiple platforms
cross-build:
@echo "Building for multiple platforms..."
@GOOS=darwin GOARCH=amd64 go build -o nexus-darwin-amd64 ./cmd/nexus
@GOOS=darwin GOARCH=arm64 go build -o nexus-darwin-arm64 ./cmd/nexus
@GOOS=linux GOARCH=amd64 go build -o nexus-linux-amd64 ./cmd/nexus
@GOOS=windows GOARCH=amd64 go build -o nexus.exe ./cmd/nexus
@echo "✓ Cross-build complete"
# Development with hot reload (requires air: go install github.com/cosmtrek/air@latest)
dev:
@air
# Download dependencies
deps:
@echo "Downloading dependencies..."
@go mod download
@go mod tidy
@echo "✓ Dependencies ready"
# Format code
fmt:
@go fmt ./...
@echo "✓ Code formatted"
# Lint code (requires golangci-lint)
lint:
@golangci-lint run
@echo "✓ Linting complete"
# Generate documentation
docs:
@echo "Generating documentation..."
@go doc -all ./... > DOCUMENTATION.md
@echo "✓ Documentation generated"
# Quick sanity check
check: build
@./nexus version
@./nexus help
@echo "✓ Sanity check passed"