forked from JeanLucPons/VanitySearch
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
94 lines (73 loc) · 2.68 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
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
#---------------------------------------------------------------------
# Makefile for VanitySearch
#
# Author : Jean-Luc PONS
SRC = Base58.cpp IntGroup.cpp main.cpp Random.cpp \
Timer.cpp Int.cpp IntMod.cpp Point.cpp SECP256K1.cpp \
Vanity.cpp GPU/GPUGenerate.cpp hash/ripemd160.cpp \
hash/sha256.cpp hash/sha512.cpp hash/ripemd160_sse.cpp \
hash/sha256_sse.cpp Bech32.cpp Wildcard.cpp
OBJDIR = obj
ifdef gpu
OBJET = $(addprefix $(OBJDIR)/, \
Base58.o IntGroup.o main.o Random.o Timer.o Int.o \
IntMod.o Point.o SECP256K1.o Vanity.o GPU/GPUGenerate.o \
hash/ripemd160.o hash/sha256.o hash/sha512.o \
hash/ripemd160_sse.o hash/sha256_sse.o \
GPU/GPUEngine.o Bech32.o Wildcard.o)
else
OBJET = $(addprefix $(OBJDIR)/, \
Base58.o IntGroup.o main.o Random.o Timer.o Int.o \
IntMod.o Point.o SECP256K1.o Vanity.o GPU/GPUGenerate.o \
hash/ripemd160.o hash/sha256.o hash/sha512.o \
hash/ripemd160_sse.o hash/sha256_sse.o Bech32.o Wildcard.o)
endif
CXX = g++
CUDA = /usr/local/cuda-8.0
CXXCUDA = g++
NVCC = nvcc
# nvcc requires joint notation w/o dot, i.e. "5.2" -> "52"
ccap = 61
ifdef gpu
ifdef debug
CXXFLAGS = -DWITHGPU -m64 -mssse3 -Wno-write-strings -g -I. -I$(CUDA)/include
else
CXXFLAGS = -DWITHGPU -m64 -mssse3 -Wno-write-strings -O2 -I. -I$(CUDA)/include
endif
LFLAGS = -lpthread -L$(CUDA)/lib64 -lcudart
else
ifdef debug
CXXFLAGS = -m64 -mssse3 -Wno-write-strings -g -I. -I$(CUDA)/include
else
CXXFLAGS = -m64 -mssse3 -Wno-write-strings -O2 -I. -I$(CUDA)/include
endif
LFLAGS = -lpthread
endif
#--------------------------------------------------------------------
ifdef gpu
ifdef debug
$(OBJDIR)/GPU/GPUEngine.o: GPU/GPUEngine.cu
$(NVCC) -G -maxrregcount=0 --ptxas-options=-v --compile --compiler-options -fPIC -ccbin $(CXXCUDA) -m64 -g -I$(CUDA)/include -gencode=arch=compute_$(ccap),code=sm_$(ccap) -o $(OBJDIR)/GPU/GPUEngine.o -c GPU/GPUEngine.cu
else
$(OBJDIR)/GPU/GPUEngine.o: GPU/GPUEngine.cu
$(NVCC) -maxrregcount=0 --ptxas-options=-v --compile --compiler-options -fPIC -ccbin $(CXXCUDA) -m64 -O2 -I$(CUDA)/include -gencode=arch=compute_$(ccap),code=sm_$(ccap) -o $(OBJDIR)/GPU/GPUEngine.o -c GPU/GPUEngine.cu
endif
endif
$(OBJDIR)/%.o : %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
all: VanitySearch
VanitySearch: $(OBJET)
@echo Making VanitySearch...
$(CXX) $(OBJET) $(LFLAGS) -o VanitySearch
$(OBJET): | $(OBJDIR) $(OBJDIR)/GPU $(OBJDIR)/hash
$(OBJDIR):
mkdir -p $(OBJDIR)
$(OBJDIR)/GPU: $(OBJDIR)
cd $(OBJDIR) && mkdir -p GPU
$(OBJDIR)/hash: $(OBJDIR)
cd $(OBJDIR) && mkdir -p hash
clean:
@echo Cleaning...
@rm -f obj/*.o
@rm -f obj/GPU/*.o
@rm -f obj/hash/*.o