forked from luke-jr/bfgminer
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.am
365 lines (282 loc) · 7.64 KB
/
Makefile.am
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# Copyright 2012-2013 Luke Dashjr
# Copyright 2012 zefir
# Copyright 2011-2013 Con Kolivas
# Copyright 2013 James Z.M. Gao
# Copyright 2013-2014 Nate Woolls
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version. See COPYING for more details.
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
m4/gnulib-cache.m4 \
linux-usb-bfgminer \
windows-build.txt
dist_doc_DATA = \
AUTHORS COPYING HACKING NEWS README \
example.conf \
README.RPC
rpcexamplesdir = $(docdir)/rpc-examples
dist_rpcexamples_DATA = \
api-example.php miner.php \
api-example.c \
api-example.py
SUBDIRS = lib ccan.bfg
# Without a redirected rule, code depending on different lib/*.h files may try to build dependencies of that in parallel, which can fail
lib/%: lib_directory
@test -e $@
lib_directory:
$(MAKE) -C lib
ccan.bfg/libccan.a:
$(MAKE) -C ccan.bfg $*
INCLUDES = -fno-strict-aliasing
bin_PROGRAMS = bfgminer
if HAVE_WINDOWS
else
bin_SCRIPTS = start-bfgminer.sh
endif
bfgminer_LDFLAGS = $(PTHREAD_FLAGS)
bfgminer_LDADD = $(DLOPEN_FLAGS) @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ \
@NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ \
@UDEV_LIBS@ @LIBUSB_LIBS@ @MM_LIBS@ @RT_LIBS@ \
@MATH_LIBS@ lib/libgnu.a ccan.bfg/libccan.a
bfgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @LIBUSB_CFLAGS@ @LIBCURL_CFLAGS@
bfgminer_CPPFLAGS += -DCGMINER_PREFIX='"$(pkgdatadir)"'
bfgminer_CPPFLAGS += -I$(top_srcdir)/ccan-upstream
bfgminer_CPPFLAGS += @JANSSON_CFLAGS@
bfgminer_CPPFLAGS += $(PTHREAD_FLAGS)
bfgminer_CPPFLAGS += $(NCURSES_CPPFLAGS)
bfgminer_CPPFLAGS += $(AUTOSCAN_CPPFLAGS)
bfgminer_LDADD += $(AUTOSCAN_LIBS)
bfgminer_LDADD += $(libblkmaker_LIBS)
bfgminer_LDFLAGS += $(libblkmaker_LDFLAGS)
bfgminer_CPPFLAGS += $(libblkmaker_CFLAGS)
# common sources
bfgminer_SOURCES := miner.c
bfgminer_SOURCES += miner.h compat.h \
deviceapi.c deviceapi.h \
util.c util.h logging.h \
sha2.c sha2.h api.c
EXTRA_bfgminer_DEPENDENCIES =
.PHONY: update-version
update-version:
./gen-version.sh >version.h.new
cmp version.h version.h.new && rm version.h.new || mv version.h.new version.h
version.h: update-version
bfgminer_SOURCES += version.h
SUBDIRS += $(LIBBLKMAKER_SUBDIRS)
LIBBLKMAKER_SUBDIRS =
if NEED_LIBBLKMAKER
LIBBLKMAKER_SUBDIRS += libblkmaker
EXTRA_bfgminer_DEPENDENCIES += libblkmaker_directory
libblkmaker_directory:
cd libblkmaker && $(MAKE)
if HAVE_CYGWIN
EXTRA_bfgminer_DEPENDENCIES += cygblkmaker-0.1-0.dll cygblkmaker_jansson-0.1-0.dll
cyg%.dll: libblkmaker/.libs/cyg%.dll
cp -p $< $@
endif
endif
bfgminer_SOURCES += logging.c
if USE_UDEVRULES
dist_udevrules_DATA = 70-bfgminer.rules
endif
if NEED_BFG_DRIVER_PROXY
bfgminer_SOURCES += driver-proxy.c driver-proxy.h
endif
if USE_LIBMICROHTTPD
bfgminer_SOURCES += httpsrv.c httpsrv.h driver-getwork.c
bfgminer_LDADD += $(libmicrohttpd_LIBS)
bfgminer_LDFLAGS += $(libmicrohttpd_LDFLAGS)
bfgminer_CPPFLAGS += $(libmicrohttpd_CFLAGS)
endif
if USE_LIBEVENT
bfgminer_SOURCES += driver-stratum.c
bfgminer_LDADD += $(libevent_LIBS)
bfgminer_LDFLAGS += $(libevent_LDFLAGS)
bfgminer_CPPFLAGS += $(libevent_CFLAGS)
endif
if HAVE_OPENCL
bfgminer_SOURCES += driver-opencl.h driver-opencl.c
bfgminer_SOURCES += ocl.c ocl.h findnonce.c findnonce.h
bfgminer_SOURCES += adl.c adl.h adl_functions.h
bfgminer_SOURCES += opencl/*.cl
kernelsdir = $(pkgdatadir)/opencl
dist_kernels_DATA = $(top_srcdir)/opencl/*.cl
dist_doc_DATA += README.GPU
if HAVE_SENSORS
bfgminer_LDADD += $(sensors_LIBS)
endif
endif
if HAS_SCRYPT
bfgminer_SOURCES += scrypt.c scrypt.h
dist_doc_DATA += README.scrypt
endif
if HAS_CPUMINE
dist_doc_DATA += README.CPU
bfgminer_SOURCES += \
sha256_generic.c sha256_via.c \
sha256_cryptopp.c sha256_sse2_amd64.c \
sha256_sse4_amd64.c \
sha256_altivec_4way.c
# the CPU portion extracted from original main.c
bfgminer_SOURCES += driver-cpu.h driver-cpu.c
if HAVE_SSE2
bfgminer_LDADD += libsse2cpuminer.a
noinst_LIBRARIES = libsse2cpuminer.a
libsse2cpuminer_a_SOURCES = sha256_4way.c
libsse2cpuminer_a_CFLAGS = $(bfgminer_CPPFLAGS) $(SSE2_CFLAGS)
endif
if HAS_YASM
AM_CFLAGS = -DHAS_YASM
if HAVE_x86_64
SUBDIRS += x86_64
x86_64/libx8664.a:
$(MAKE) -C x86_64 $*
bfgminer_LDADD += x86_64/libx8664.a
else # HAVE_x86_64
SUBDIRS += x86_32
x86_32/libx8632.a:
$(MAKE) -C x86_32 $*
bfgminer_LDADD += x86_32/libx8632.a
if HAVE_SSE2
libsse2cpuminer_a_SOURCES += sha256_sse2_i386.c
endif
endif # HAVE_x86_64
endif # HAS_YASM
endif # HAS_CPUMINE
if NEED_BFG_LOWL_VCOM
bfgminer_SOURCES += lowl-vcom.c lowl-vcom.h
if HAVE_WINDOWS
else
bfgminer_SOURCES += iospeeds.h iospeeds_posix.h
endif
endif
if HAVE_LIBUSB
bfgminer_SOURCES += lowl-usb.c lowl-usb.h
endif
if NEED_BFG_BINLOADER
bfgminer_SOURCES += binloader.c binloader.h
endif
if NEED_BFG_LOWLEVEL
bfgminer_SOURCES += lowlevel.c lowlevel.h
endif
if NEED_DYNCLOCK
bfgminer_SOURCES += dynclock.c dynclock.h
endif
if NEED_BFG_WORK2D
bfgminer_SOURCES += work2d.c work2d.h
endif
if HAS_FPGA
dist_doc_DATA += README.FPGA
endif
if HAS_ASIC
dist_doc_DATA += README.ASIC
endif
if HAS_BITFORCE
bfgminer_SOURCES += driver-bitforce.c
if HAVE_WINDOWS
else
bin_PROGRAMS += bitforce-firmware-flash
bitforce_firmware_flash_SOURCES = bitforce-firmware-flash.c
endif
endif
if HAS_BIGPIC
bfgminer_SOURCES += driver-bigpic.c driver-bigpic.h
endif
if USE_DRILLBIT
bfgminer_SOURCES += driver-drillbit.c
endif
if HAS_TWINFURY
bfgminer_SOURCES += driver-twinfury.c driver-twinfury.h
endif
if HAS_ICARUS
bfgminer_SOURCES += driver-icarus.c driver-icarus.h
bfgminer_SOURCES += driver-cairnsmore.c
bfgminer_SOURCES += driver-erupter.c
bfgminer_SOURCES += driver-antminer.c
endif
if USE_GC3355
bfgminer_SOURCES += gc3355.c gc3355.h
endif
if USE_GRIDSEED
bfgminer_SOURCES += driver-gridseed.c
endif
if USE_DUALMINER
bfgminer_SOURCES += driver-dualminer.c
endif
if USE_ZEUSMINER
bfgminer_SOURCES += driver-zeusminer.c
endif
if HAS_AVALON
bfgminer_SOURCES += driver-avalon.c driver-avalon.h hexdump.c
endif
if USE_KNC
bfgminer_SOURCES += driver-knc.c
endif
if HAS_KLONDIKE
bfgminer_SOURCES += driver-klondike.c driver-klondike.h driver-hashbusteravalon.c
endif
if HAS_MODMINER
bfgminer_SOURCES += driver-modminer.c
endif
if HAS_X6500
bfgminer_SOURCES += driver-x6500.c jtag.c jtag.h
endif
if HAS_ZTEX
bfgminer_SOURCES += driver-ztex.c libztex.c libztex.h
endif
if USE_BIFURY
bfgminer_SOURCES += driver-bifury.c
endif
if HAS_BITFURY
bfgminer_SOURCES += driver-bitfury.c driver-bitfury.h libbitfury.c libbitfury.h
if HAS_BFSB
bfgminer_SOURCES += driver-bfsb.c
endif
if USE_BFX
bfgminer_SOURCES += driver-bfx.c
endif
if HAS_METABANK
bfgminer_SOURCES += driver-metabank.c tm_i2c.h tm_i2c.c
endif
if HAS_LITTLEFURY
bfgminer_SOURCES += driver-littlefury.c
endif
if HAS_NANOFURY
bfgminer_SOURCES += driver-nanofury.c mcp2210.c mcp2210.h
endif
if USE_HASHBUSTER
bfgminer_SOURCES += driver-hashbuster.c
endif
if USE_HASHBUSTERUSB
bfgminer_SOURCES += driver-hashbusterusb.c
endif
endif
if USE_HASHFAST
bfgminer_SOURCES += driver-hashfast.c
endif
if USE_JINGTIAN
bfgminer_SOURCES += driver-aan.c driver-aan.h
bfgminer_SOURCES += driver-jingtian.c
endif
if USE_ROCKMINER
bfgminer_SOURCES += driver-rockminer.c
endif
if NEED_BFG_LOWL_FTDI
bfgminer_SOURCES += lowl-ftdi.c lowl-ftdi.h
endif
if NEED_BFG_LOWL_HID
bfgminer_SOURCES += lowl-hid.c lowl-hid.h
bfgminer_CPPFLAGS += $(hidapi_CFLAGS)
endif
if NEED_BFG_LOWL_PCI
bfgminer_SOURCES += lowl-pci.c lowl-pci.h
endif
if NEED_BFG_LOWL_SPI
bfgminer_SOURCES += lowl-spi.h lowl-spi.c
endif
bin_PROGRAMS += bfgminer-rpc
bfgminer_rpc_SOURCES = api-example.c
bfgminer_rpc_LDADD = @WS2_LIBS@