Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (55 loc) · 1.55 KB
/
Copy pathMakefile
File metadata and controls
65 lines (55 loc) · 1.55 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
# Makefile for 'how' CLI tool
.PHONY: build install clean test run help
# Variables
BINARY_NAME=how
VERSION?=dev
BUILD_DIR=dist
INSTALL_PATH=/usr/local/bin
# Default target
help:
@echo "Available targets:"
@echo " build - Build the binary for current platform"
@echo " install - Install the binary to $(INSTALL_PATH)"
@echo " clean - Clean build artifacts"
@echo " test - Run tests"
@echo " run - Run the application"
@echo " cross - Build for all platforms"
@echo " help - Show this help message"
# Build for current platform
build:
@echo "🚀 Building $(BINARY_NAME)..."
@go build -ldflags="-s -w" -o $(BINARY_NAME) .
@echo "✅ Build completed: $(BINARY_NAME)"
# Install binary
install: build
@echo "📦 Installing $(BINARY_NAME) to $(INSTALL_PATH)..."
@sudo cp $(BINARY_NAME) $(INSTALL_PATH)/
@echo "✅ $(BINARY_NAME) installed successfully!"
@echo ""
@echo "Next steps:"
@echo "1. Get a free API key from https://openrouter.ai/keys"
@echo "2. Run '$(BINARY_NAME) setup' to configure your key"
@echo "3. Try: $(BINARY_NAME) list files by size"
# Cross-platform build
cross:
@chmod +x build.sh
@./build.sh $(VERSION)
# Clean build artifacts
clean:
@echo "🧹 Cleaning build artifacts..."
@rm -f $(BINARY_NAME)
@rm -rf $(BUILD_DIR)
@echo "✅ Clean completed"
# Run tests
test:
@echo "🧪 Running tests..."
@go test -v ./...
# Run the application
run:
@go run . $(ARGS)
# Download dependencies
deps:
@echo "📥 Downloading dependencies..."
@go mod download
@go mod tidy
@echo "✅ Dependencies updated"