-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (45 loc) · 1.41 KB
/
Makefile
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
.PHONY: all build release debug clean run test check profile bench
# Compiler flags
RUSTFLAGS_RELEASE := -C target-cpu=native -C codegen-units=1 -C opt-level=3
CARGO_FLAGS := --jobs $(shell nproc)
# Default target
all: release
# Production optimized build
release:
RUSTFLAGS="$(RUSTFLAGS_RELEASE)" cargo build --release $(CARGO_FLAGS)
strip target/release/vanity-pgp-miner
# Debug build
debug:
cargo build $(CARGO_FLAGS)
# Clean build artifacts
clean:
cargo clean
rm -rf gpg_export/
# Run the miner
run:
@if [ -z "$(name)" ] || [ -z "$(email)" ]; then \
echo "Usage: make run name=\"Your Name\" email=\"[email protected]\" [total=2000000]"; \
exit 1; \
fi
./target/release/vanity-pgp-miner "$(name)" "$(email)" "$(total)"
# Build and run optimized version
mine: release
@if [ -z "$(name)" ] || [ -z "$(email)" ]; then \
echo "Usage: make mine name=\"Your Name\" email=\"[email protected]\" [total=2000000]"; \
exit 1; \
fi
./target/release/vanity-pgp-miner "$(name)" "$(email)" "$(total)"
# Show help
help:
@echo "Vanity PGP Key Miner Makefile"
@echo ""
@echo "Usage:"
@echo " make mine name=\"Your Name\" email=\"[email protected]\""
@echo ""
@echo "Targets:"
@echo " all - Build release version (default)"
@echo " release - Build with optimizations"
@echo " debug - Build debug version"
@echo " clean - Remove build artifacts"
@echo " run - Run existing build"
@echo " mine - Build and run"