Makefile.am 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. # Copyright 2012-2013 Luke Dashjr
  2. # Copyright 2012 zefir
  3. # Copyright 2011-2013 Con Kolivas
  4. # Copyright 2013 James Z.M. Gao
  5. #
  6. # This program is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by the Free
  8. # Software Foundation; either version 3 of the License, or (at your option)
  9. # any later version. See COPYING for more details.
  10. ACLOCAL_AMFLAGS = -I m4
  11. EXTRA_DIST = \
  12. m4/gnulib-cache.m4 \
  13. linux-usb-bfgminer \
  14. windows-build.txt
  15. dist_doc_DATA = \
  16. AUTHORS COPYING HACKING NEWS README \
  17. example.conf \
  18. README.RPC
  19. rpcexamplesdir = $(docdir)/rpc-examples
  20. dist_rpcexamples_DATA = \
  21. api-example.php miner.php \
  22. api-example.c \
  23. api-example.py
  24. SUBDIRS = lib ccan.bfg
  25. # Without a redirected rule, code depending on different lib/*.h files may try to build dependencies of that in parallel, which can fail
  26. lib/%: lib_directory
  27. @test -e $@
  28. lib_directory:
  29. $(MAKE) -C lib
  30. ccan.bfg/libccan.a:
  31. $(MAKE) -C ccan.bfg $*
  32. INCLUDES = -fno-strict-aliasing
  33. bin_PROGRAMS = bfgminer
  34. if HAVE_WINDOWS
  35. else
  36. bin_SCRIPTS = start-bfgminer.sh
  37. endif
  38. bfgminer_LDFLAGS = $(PTHREAD_FLAGS)
  39. bfgminer_LDADD = $(DLOPEN_FLAGS) @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ \
  40. @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ \
  41. @UDEV_LIBS@ @LIBUSB_LIBS@ @MM_LIBS@ @RT_LIBS@ \
  42. @MATH_LIBS@ lib/libgnu.a ccan.bfg/libccan.a
  43. bfgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @LIBUSB_CFLAGS@ @LIBCURL_CFLAGS@
  44. bfgminer_CPPFLAGS += -DCGMINER_PREFIX='"$(pkgdatadir)"'
  45. bfgminer_CPPFLAGS += -I$(top_srcdir)/ccan-upstream
  46. bfgminer_CPPFLAGS += @JANSSON_CFLAGS@
  47. bfgminer_CPPFLAGS += $(PTHREAD_FLAGS)
  48. bfgminer_CPPFLAGS += $(NCURSES_CPPFLAGS)
  49. bfgminer_CPPFLAGS += $(AUTOSCAN_CPPFLAGS)
  50. bfgminer_LDADD += $(AUTOSCAN_LIBS)
  51. bfgminer_LDADD += $(libblkmaker_LIBS)
  52. bfgminer_LDFLAGS += $(libblkmaker_LDFLAGS)
  53. bfgminer_CPPFLAGS += $(libblkmaker_CFLAGS)
  54. # common sources
  55. bfgminer_SOURCES := miner.c
  56. bfgminer_SOURCES += miner.h compat.h \
  57. deviceapi.c deviceapi.h \
  58. util.c util.h logging.h \
  59. sha2.c sha2.h api.c
  60. EXTRA_bfgminer_DEPENDENCIES =
  61. SUBDIRS += $(LIBBLKMAKER_SUBDIRS)
  62. LIBBLKMAKER_SUBDIRS =
  63. if NEED_LIBBLKMAKER
  64. LIBBLKMAKER_SUBDIRS += libblkmaker
  65. EXTRA_bfgminer_DEPENDENCIES += libblkmaker_directory
  66. libblkmaker_directory:
  67. cd libblkmaker && $(MAKE)
  68. if HAVE_CYGWIN
  69. EXTRA_bfgminer_DEPENDENCIES += cygblkmaker-0.1-0.dll cygblkmaker_jansson-0.1-0.dll
  70. cyg%.dll: libblkmaker/.libs/cyg%.dll
  71. cp -p $< $@
  72. endif
  73. endif
  74. bfgminer_SOURCES += logging.c
  75. if USE_UDEVRULES
  76. dist_udevrules_DATA = 70-bfgminer.rules
  77. endif
  78. if NEED_BFG_DRIVER_PROXY
  79. bfgminer_SOURCES += driver-proxy.c driver-proxy.h
  80. endif
  81. if USE_LIBMICROHTTPD
  82. bfgminer_SOURCES += httpsrv.c httpsrv.h driver-getwork.c
  83. bfgminer_LDADD += $(libmicrohttpd_LIBS)
  84. bfgminer_LDFLAGS += $(libmicrohttpd_LDFLAGS)
  85. bfgminer_CPPFLAGS += $(libmicrohttpd_CFLAGS)
  86. endif
  87. if USE_LIBEVENT
  88. bfgminer_SOURCES += driver-stratum.c
  89. bfgminer_LDADD += $(libevent_LIBS)
  90. bfgminer_LDFLAGS += $(libevent_LDFLAGS)
  91. bfgminer_CPPFLAGS += $(libevent_CFLAGS)
  92. endif
  93. if HAVE_OPENCL
  94. bfgminer_SOURCES += driver-opencl.h driver-opencl.c
  95. bfgminer_SOURCES += ocl.c ocl.h findnonce.c findnonce.h
  96. bfgminer_SOURCES += adl.c adl.h adl_functions.h
  97. bfgminer_SOURCES += opencl/*.cl
  98. kernelsdir = $(pkgdatadir)/opencl
  99. dist_kernels_DATA = $(top_srcdir)/opencl/*.cl
  100. dist_doc_DATA += README.GPU
  101. if HAVE_SENSORS
  102. bfgminer_LDADD += $(sensors_LIBS)
  103. endif
  104. endif
  105. if HAS_SCRYPT
  106. bfgminer_SOURCES += scrypt.c scrypt.h
  107. dist_doc_DATA += README.scrypt
  108. endif
  109. if HAS_CPUMINE
  110. dist_doc_DATA += README.CPU
  111. bfgminer_SOURCES += \
  112. sha256_generic.c sha256_via.c \
  113. sha256_cryptopp.c sha256_sse2_amd64.c \
  114. sha256_sse4_amd64.c \
  115. sha256_altivec_4way.c
  116. # the CPU portion extracted from original main.c
  117. bfgminer_SOURCES += driver-cpu.h driver-cpu.c
  118. if HAVE_SSE2
  119. bfgminer_LDADD += libsse2cpuminer.a
  120. noinst_LIBRARIES = libsse2cpuminer.a
  121. libsse2cpuminer_a_SOURCES = sha256_4way.c
  122. libsse2cpuminer_a_CFLAGS = $(bfgminer_CPPFLAGS) $(SSE2_CFLAGS)
  123. endif
  124. if HAS_YASM
  125. AM_CFLAGS = -DHAS_YASM
  126. if HAVE_x86_64
  127. SUBDIRS += x86_64
  128. x86_64/libx8664.a:
  129. $(MAKE) -C x86_64 $*
  130. bfgminer_LDADD += x86_64/libx8664.a
  131. else # HAVE_x86_64
  132. SUBDIRS += x86_32
  133. x86_32/libx8632.a:
  134. $(MAKE) -C x86_32 $*
  135. bfgminer_LDADD += x86_32/libx8632.a
  136. if HAVE_SSE2
  137. libsse2cpuminer_a_SOURCES += sha256_sse2_i386.c
  138. endif
  139. endif # HAVE_x86_64
  140. endif # HAS_YASM
  141. endif # HAS_CPUMINE
  142. if NEED_BFG_LOWL_VCOM
  143. bfgminer_SOURCES += lowl-vcom.c lowl-vcom.h
  144. if HAVE_WINDOWS
  145. else
  146. bfgminer_SOURCES += iospeeds.h iospeeds_posix.h
  147. endif
  148. endif
  149. if HAVE_LIBUSB
  150. bfgminer_SOURCES += lowl-usb.c lowl-usb.h
  151. endif
  152. if NEED_BFG_BINLOADER
  153. bfgminer_SOURCES += binloader.c binloader.h
  154. endif
  155. if NEED_BFG_LOWLEVEL
  156. bfgminer_SOURCES += lowlevel.c lowlevel.h
  157. endif
  158. if NEED_DYNCLOCK
  159. bfgminer_SOURCES += dynclock.c dynclock.h
  160. endif
  161. if NEED_BFG_WORK2D
  162. bfgminer_SOURCES += work2d.c work2d.h
  163. endif
  164. if HAS_FPGA
  165. dist_doc_DATA += README.FPGA
  166. endif
  167. if HAS_ASIC
  168. dist_doc_DATA += README.ASIC
  169. endif
  170. if HAS_BITFORCE
  171. bfgminer_SOURCES += driver-bitforce.c
  172. if HAVE_WINDOWS
  173. else
  174. bin_PROGRAMS += bitforce-firmware-flash
  175. bitforce_firmware_flash_SOURCES = bitforce-firmware-flash.c
  176. endif
  177. endif
  178. if HAS_BIGPIC
  179. bfgminer_SOURCES += driver-bigpic.c driver-bigpic.h
  180. endif
  181. if USE_DRILLBIT
  182. bfgminer_SOURCES += driver-drillbit.c
  183. endif
  184. if HAS_TWINFURY
  185. bfgminer_SOURCES += driver-twinfury.c driver-twinfury.h
  186. endif
  187. if HAS_ICARUS
  188. bfgminer_SOURCES += driver-icarus.c driver-icarus.h
  189. bfgminer_SOURCES += driver-cairnsmore.c
  190. bfgminer_SOURCES += driver-erupter.c
  191. bfgminer_SOURCES += driver-antminer.c
  192. endif
  193. if USE_GC3355
  194. bfgminer_SOURCES += gc3355.c gc3355.h
  195. endif
  196. if USE_GRIDSEED
  197. bfgminer_SOURCES += driver-gridseed.c
  198. endif
  199. if USE_DUALMINER
  200. bfgminer_SOURCES += driver-dualminer.c
  201. endif
  202. if HAS_AVALON
  203. bfgminer_SOURCES += driver-avalon.c driver-avalon.h hexdump.c
  204. endif
  205. if USE_KNC
  206. bfgminer_SOURCES += driver-knc.c
  207. endif
  208. if HAS_KLONDIKE
  209. bfgminer_SOURCES += driver-klondike.c driver-klondike.h driver-hashbusteravalon.c
  210. endif
  211. if HAS_MODMINER
  212. bfgminer_SOURCES += driver-modminer.c
  213. endif
  214. if HAS_X6500
  215. bfgminer_SOURCES += driver-x6500.c jtag.c jtag.h
  216. endif
  217. if HAS_ZTEX
  218. bfgminer_SOURCES += driver-ztex.c libztex.c libztex.h
  219. endif
  220. if USE_BIFURY
  221. bfgminer_SOURCES += driver-bifury.c
  222. endif
  223. if HAS_BITFURY
  224. bfgminer_SOURCES += driver-bitfury.c driver-bitfury.h libbitfury.c libbitfury.h
  225. if HAS_BFSB
  226. bfgminer_SOURCES += driver-bfsb.c
  227. endif
  228. if USE_BFX
  229. bfgminer_SOURCES += driver-bfx.c
  230. endif
  231. if HAS_METABANK
  232. bfgminer_SOURCES += driver-metabank.c tm_i2c.h tm_i2c.c
  233. endif
  234. if HAS_LITTLEFURY
  235. bfgminer_SOURCES += driver-littlefury.c
  236. endif
  237. if HAS_NANOFURY
  238. bfgminer_SOURCES += driver-nanofury.c mcp2210.c mcp2210.h
  239. endif
  240. if USE_HASHBUSTER
  241. bfgminer_SOURCES += driver-hashbuster.c
  242. endif
  243. if USE_HASHBUSTERUSB
  244. bfgminer_SOURCES += driver-hashbusterusb.c
  245. endif
  246. endif
  247. if USE_HASHFAST
  248. bfgminer_SOURCES += driver-hashfast.c
  249. endif
  250. if USE_ROCKMINER
  251. bfgminer_SOURCES += driver-rockminer.c
  252. endif
  253. if NEED_BFG_LOWL_FTDI
  254. bfgminer_SOURCES += lowl-ftdi.c lowl-ftdi.h
  255. endif
  256. if NEED_BFG_LOWL_HID
  257. bfgminer_SOURCES += lowl-hid.c lowl-hid.h
  258. bfgminer_CPPFLAGS += $(hidapi_CFLAGS)
  259. endif
  260. if NEED_BFG_LOWL_PCI
  261. bfgminer_SOURCES += lowl-pci.c lowl-pci.h
  262. endif
  263. if NEED_BFG_LOWL_SPI
  264. bfgminer_SOURCES += lowl-spi.h lowl-spi.c
  265. endif
  266. bin_PROGRAMS += bfgminer-rpc
  267. bfgminer_rpc_SOURCES = api-example.c
  268. bfgminer_rpc_LDADD = @WS2_LIBS@