-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
142 lines (129 loc) · 5.99 KB
/
Makefile
File metadata and controls
142 lines (129 loc) · 5.99 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# 🚀 NekoCode 5-Binary Toolchain - Modern Makefile
# Unix Philosophy: "Do One Thing and Do It Well" + Instant Usability
.PHONY: all build debug release update-binaries setup test clean clean-all help install quick-test
# 🎯 Default target: Full 5-binary build + setup
all: release
# 🔧 Debug build (5 binaries)
debug:
@echo "🔧 Building NekoCode 5-binary toolchain (debug)..."
@cd nekocode-workspace && cargo build
@echo "✅ Debug build complete!"
# 🏗️ Core build step for 5 binaries
build:
@echo "🚀 Building NekoCode 5-binary toolchain (release)..."
@cd nekocode-workspace && cargo build --release
@echo "✅ Release build complete!"
# 🎊 Full release: build + copy + setup
release: build update-binaries setup
@echo "🎊 NekoCode 5-binary release complete!"
@echo "📋 Available commands:"
@echo " ./bin/nekocode - Core analysis engine (16MB)"
@echo " ./bin/nekorefactor - Smart refactoring + strip-comments (2.8MB)"
@echo " ./bin/nekoimpact - Change impact analysis (2.8MB)"
@echo " ./bin/nekoinc - Incremental analysis (3.1MB)"
@echo " ./bin/nekomcp - MCP integration (3.6MB)"
# 📦 Copy all 5 binaries to user-friendly locations
update-binaries: build
@echo "📦 Copying 5 binaries to bin/ and releases/..."
@mkdir -p bin/ releases/
@cp nekocode-workspace/target/release/nekocode bin/
@cp nekocode-workspace/target/release/nekorefactor bin/
@cp nekocode-workspace/target/release/nekoimpact bin/
@cp nekocode-workspace/target/release/nekoinc bin/
@cp nekocode-workspace/target/release/nekomcp bin/
@cp nekocode-workspace/target/release/nekocode releases/
@cp nekocode-workspace/target/release/nekorefactor releases/
@cp nekocode-workspace/target/release/nekoimpact releases/
@cp nekocode-workspace/target/release/nekoinc releases/
@cp nekocode-workspace/target/release/nekomcp releases/
@chmod +x bin/* releases/*
@echo "✅ 5 binaries copied and made executable"
@echo "📊 Sizes:"
@du -h bin/neko* | sed 's/^/ /'
# 🛠️ Setup scripts for immediate usability
setup:
@echo "🛠️ Creating setup scripts..."
@echo '#!/bin/bash' > bin/quick-setup.sh
@echo 'echo "🐱 NekoCode 5-Binary Toolchain Setup"' >> bin/quick-setup.sh
@echo 'echo "================================="' >> bin/quick-setup.sh
@echo 'echo ""' >> bin/quick-setup.sh
@echo 'echo "📋 Available Commands:"' >> bin/quick-setup.sh
@echo 'echo " ./bin/nekocode session-create /path/to/project"' >> bin/quick-setup.sh
@echo 'echo " ./bin/nekorefactor strip-comments file.js"' >> bin/quick-setup.sh
@echo 'echo " ./bin/nekoimpact analyze SESSION_ID"' >> bin/quick-setup.sh
@echo 'echo ""' >> bin/quick-setup.sh
@echo 'echo "🔌 MCP Integration (Claude Code):"' >> bin/quick-setup.sh
@echo 'echo " Add to settings: mcp-nekocode-server/mcp_server_real.py"' >> bin/quick-setup.sh
@echo 'echo ""' >> bin/quick-setup.sh
@echo 'echo "✅ Ready to use! Run any command with --help for details"' >> bin/quick-setup.sh
@chmod +x bin/quick-setup.sh
@echo "✅ Setup script created: bin/quick-setup.sh"
# 🧪 Run all tests
test:
@echo "🧪 Running workspace tests..."
@cd nekocode-workspace && cargo test
# 🚀 Quick functionality test of all 5 binaries
quick-test: release
@echo "⚡ Testing 5-binary functionality..."
@echo "Testing nekocode..."
@./bin/nekocode --help >/dev/null && echo " ✅ nekocode OK" || echo " ❌ nekocode failed"
@echo "Testing nekorefactor (with strip-comments)..."
@./bin/nekorefactor strip-comments --help >/dev/null && echo " ✅ strip-comments available" || echo " ❌ strip-comments missing"
@echo "Testing nekoimpact..."
@./bin/nekoimpact --help >/dev/null && echo " ✅ nekoimpact OK" || echo " ❌ nekoimpact failed"
@echo "Testing nekoinc..."
@./bin/nekoinc --help >/dev/null && echo " ✅ nekoinc OK" || echo " ❌ nekoinc failed"
@echo "Testing nekomcp..."
@./bin/nekomcp --help >/dev/null && echo " ✅ nekomcp OK" || echo " ❌ nekomcp failed"
@echo "🎯 All binaries tested!"
# 🧹 Clean build artifacts (keep bin/ for usability)
clean:
@echo "🧹 Cleaning build artifacts..."
@cd nekocode-workspace && cargo clean
# 🧹🔥 Clean everything including bin/ and releases/
clean-all: clean
@echo "🧹🔥 Cleaning bin/ and releases/ directories..."
@rm -rf bin/* releases/*
@echo "✅ Complete cleanup done!"
# 📥 Install all 5 binaries to ~/.local/bin
install: release
@echo "📥 Installing 5 binaries to ~/.local/bin/..."
@mkdir -p ~/.local/bin
@ln -sf $$(pwd)/bin/nekocode ~/.local/bin/nekocode
@ln -sf $$(pwd)/bin/nekorefactor ~/.local/bin/nekorefactor
@ln -sf $$(pwd)/bin/nekoimpact ~/.local/bin/nekoimpact
@ln -sf $$(pwd)/bin/nekoinc ~/.local/bin/nekoinc
@ln -sf $$(pwd)/bin/nekomcp ~/.local/bin/nekomcp
@echo "✅ Installed! Available commands:"
@echo " nekocode --help"
@echo " nekorefactor strip-comments --help"
@echo " nekoimpact --help"
@echo " nekoinc --help"
@echo " nekomcp --help"
# 📖 Help
help:
@echo "🚀 NekoCode 5-Binary Toolchain - Build Commands"
@echo ""
@echo "🎯 Main targets:"
@echo " make - Build all 5 binaries + setup (default)"
@echo " make release - Full release build with setup"
@echo " make quick-test - Build and test all binaries"
@echo ""
@echo "🔧 Development:"
@echo " make debug - Debug build"
@echo " make build - Release build only"
@echo " make update-binaries - Copy binaries to bin/"
@echo " make setup - Create setup scripts"
@echo " make test - Run unit tests"
@echo ""
@echo "🧹 Cleanup:"
@echo " make clean - Clean build artifacts (keep bin/)"
@echo " make clean-all - Clean everything including bin/"
@echo ""
@echo "📥 Installation:"
@echo " make install - Install to ~/.local/bin/"
@echo ""
@echo "🎊 After 'make', use:"
@echo " ./bin/nekocode --help"
@echo " ./bin/nekorefactor strip-comments --help"
@echo " ./bin/quick-setup.sh"