|
3 | 3 | BINARY_NAME = git-x |
4 | 4 | CARGO = cargo |
5 | 5 |
|
6 | | -.PHONY: all build ci run test coverage install uninstall fmt fmt-check lint lint-check clean publish help |
| 6 | +.PHONY: all build ci run test coverage install uninstall fmt fmt-check lint lint-check clean publish help publish-optimized analyze-size |
7 | 7 |
|
8 | 8 | ## Build and run the project (default) |
9 | 9 | all: run |
@@ -55,27 +55,45 @@ uninstall: |
55 | 55 | clean: |
56 | 56 | $(CARGO) clean |
57 | 57 |
|
58 | | -## Publish to crates.io |
| 58 | +## Analyze binary size and dependencies |
| 59 | +analyze-size: build |
| 60 | + @echo "=== Performance-Optimized Binary Analysis ===" |
| 61 | + @ls -lh target/release/$(BINARY_NAME) |
| 62 | + @echo "" |
| 63 | + @echo "=== Crate Size Breakdown ===" |
| 64 | + $(CARGO) bloat --release --crates |
| 65 | + @echo "" |
| 66 | + @echo "=== Top Functions ===" |
| 67 | + $(CARGO) bloat --release -n 10 |
| 68 | + |
| 69 | +## Publish optimized binary to crates.io |
| 70 | +publish-optimized: build test |
| 71 | + $(CARGO) publish |
| 72 | + |
| 73 | +## Publish to crates.io (standard) |
59 | 74 | publish: |
60 | 75 | $(CARGO) publish |
61 | 76 |
|
62 | 77 | ## Show this help message |
63 | 78 | help: |
64 | 79 | @echo "" |
65 | 80 | @echo "git-x Makefile — available targets:" |
66 | | - @echo " make Build and run (default)" |
67 | | - @echo " make build Build release binary" |
68 | | - @echo " make run Run binary with ARGS=\"xinfo\"" |
69 | | - @echo " make test Run tests" |
70 | | - @echo " make coverage Generate test coverage report" |
71 | | - @echo " make fmt Format code" |
72 | | - @echo " make fmt-check Check formatting" |
73 | | - @echo " make lint Lint with Clippy" |
74 | | - @echo " make lint-check Check for linting issues" |
75 | | - @echo " make install Install to ~/.cargo/bin as 'git-x'" |
76 | | - @echo " make uninstall Uninstall binary" |
77 | | - @echo " make clean Remove build artifacts" |
78 | | - @echo " make publish Publish to crates.io" |
79 | | - @echo " make help Show this help message" |
80 | | - @echo " make ci Run CI checks (formatting, linting, tests)" |
| 81 | + @echo " make Build and run (default)" |
| 82 | + @echo " make build Build release binary" |
| 83 | + @echo " make run Run binary with ARGS=\"info\"" |
| 84 | + @echo " make test Run tests" |
| 85 | + @echo " make coverage Generate test coverage report" |
| 86 | + @echo " make fmt Format code" |
| 87 | + @echo " make fmt-check Check formatting" |
| 88 | + @echo " make lint Lint with Clippy" |
| 89 | + @echo " make lint-check Check for linting issues" |
| 90 | + @echo " make install Install to ~/.cargo/bin as 'git-x'" |
| 91 | + @echo " make uninstall Uninstall binary" |
| 92 | + @echo " make clean Remove build artifacts" |
| 93 | + @echo " make ci Run CI checks (formatting, linting, tests)" |
| 94 | + @echo "" |
| 95 | + @echo "Optimization Targets:" |
| 96 | + @echo " make analyze-size Analyze binary size and dependencies" |
| 97 | + @echo " make publish-optimized Publish optimized binary to crates.io" |
| 98 | + @echo " make publish Publish to crates.io (standard)" |
81 | 99 | @echo "" |
0 commit comments