-
Notifications
You must be signed in to change notification settings - Fork 495
/
Makefile
132 lines (102 loc) · 3.09 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
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
CUR_DIR=$(shell pwd)
DIRS=util AddressUtil CmdParse CryptoUtil KeyFinderLib CLKeySearchDevice CudaKeySearchDevice cudaMath clUtil cudaUtil secp256k1lib Logger embedcl
INCLUDE = $(foreach d, $(DIRS), -I$(CUR_DIR)/$d)
LIBDIR=$(CUR_DIR)/lib
BINDIR=$(CUR_DIR)/bin
LIBS+=-L$(LIBDIR)
# C++ options
CXX=g++
CXXFLAGS=-O2 -std=c++11
# CUDA variables
COMPUTE_CAP=30
NVCC=nvcc
NVCCFLAGS=-std=c++11 -gencode=arch=compute_${COMPUTE_CAP},code=\"sm_${COMPUTE_CAP}\" -Xptxas="-v" -Xcompiler "${CXXFLAGS}"
CUDA_HOME=/usr/local/cuda
CUDA_LIB=${CUDA_HOME}/lib64
CUDA_INCLUDE=${CUDA_HOME}/include
CUDA_MATH=$(CUR_DIR)/cudaMath
# OpenCL variables
OPENCL_LIB=${CUDA_LIB}
OPENCL_INCLUDE=${CUDA_INCLUDE}
OPENCL_VERSION=110
export INCLUDE
export LIBDIR
export BINDIR
export NVCC
export NVCCFLAGS
export LIBS
export CXX
export CXXFLAGS
export CUDA_LIB
export CUDA_INCLUDE
export CUDA_MATH
export OPENCL_LIB
export OPENCL_INCLUDE
export BUILD_OPENCL
export BUILD_CUDA
TARGETS=dir_addressutil dir_cmdparse dir_cryptoutil dir_keyfinderlib dir_keyfinder dir_secp256k1lib dir_util dir_logger dir_addrgen
ifeq ($(BUILD_CUDA),1)
TARGETS:=${TARGETS} dir_cudaKeySearchDevice dir_cudautil
endif
ifeq ($(BUILD_OPENCL),1)
TARGETS:=${TARGETS} dir_embedcl dir_clKeySearchDevice dir_clutil dir_clunittest
CXXFLAGS:=${CXXFLAGS} -DCL_TARGET_OPENCL_VERSION=${OPENCL_VERSION}
endif
all: ${TARGETS}
dir_cudaKeySearchDevice: dir_keyfinderlib dir_cudautil dir_logger
make --directory CudaKeySearchDevice
dir_clKeySearchDevice: dir_embedcl dir_keyfinderlib dir_clutil dir_logger
make --directory CLKeySearchDevice
dir_embedcl:
make --directory embedcl
dir_addressutil: dir_util dir_secp256k1lib dir_cryptoutil
make --directory AddressUtil
dir_cmdparse:
make --directory CmdParse
dir_cryptoutil:
make --directory CryptoUtil
dir_keyfinderlib: dir_util dir_secp256k1lib dir_cryptoutil dir_addressutil dir_logger
make --directory KeyFinderLib
KEYFINDER_DEPS=dir_keyfinderlib
ifeq ($(BUILD_CUDA), 1)
KEYFINDER_DEPS:=$(KEYFINDER_DEPS) dir_cudaKeySearchDevice
endif
ifeq ($(BUILD_OPENCL),1)
KEYFINDER_DEPS:=$(KEYFINDER_DEPS) dir_clKeySearchDevice
endif
dir_keyfinder: $(KEYFINDER_DEPS)
make --directory KeyFinder
dir_cudautil:
make --directory cudaUtil
dir_clutil:
make --directory clUtil
dir_secp256k1lib: dir_cryptoutil
make --directory secp256k1lib
dir_util:
make --directory util
dir_cudainfo:
make --directory cudaInfo
dir_logger:
make --directory Logger
dir_addrgen: dir_cmdparse dir_addressutil dir_secp256k1lib
make --directory AddrGen
dir_clunittest: dir_clutil
make --directory CLUnitTests
clean:
make --directory AddressUtil clean
make --directory CmdParse clean
make --directory CryptoUtil clean
make --directory KeyFinderLib clean
make --directory KeyFinder clean
make --directory cudaUtil clean
make --directory secp256k1lib clean
make --directory util clean
make --directory cudaInfo clean
make --directory Logger clean
make --directory clUtil clean
make --directory CLKeySearchDevice clean
make --directory CudaKeySearchDevice clean
make --directory embedcl clean
make --directory CLUnitTests clean
rm -rf ${LIBDIR}
rm -rf ${BINDIR}