Makefile.am 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. bfgminer_LDFLAGS = $(PTHREAD_FLAGS)
  35. bfgminer_LDADD = $(DLOPEN_FLAGS) @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ \
  36. @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ \
  37. @UDEV_LIBS@ @LIBUSB_LIBS@ @MM_LIBS@ @RT_LIBS@ \
  38. @MATH_LIBS@ lib/libgnu.a ccan.bfg/libccan.a
  39. bfgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @LIBUSB_CFLAGS@ @LIBCURL_CFLAGS@
  40. bfgminer_CPPFLAGS += -DCGMINER_PREFIX='"$(pkgdatadir)"'
  41. bfgminer_CPPFLAGS += -I$(top_srcdir)/ccan-upstream
  42. bfgminer_CPPFLAGS += @JANSSON_CFLAGS@
  43. bfgminer_CPPFLAGS += $(PTHREAD_FLAGS)
  44. bfgminer_CPPFLAGS += $(NCURSES_CPPFLAGS)
  45. bfgminer_CPPFLAGS += $(AUTOSCAN_CPPFLAGS)
  46. bfgminer_LDADD += $(AUTOSCAN_LIBS)
  47. bfgminer_LDADD += $(libblkmaker_LIBS)
  48. bfgminer_LDFLAGS += $(libblkmaker_LDFLAGS)
  49. bfgminer_CPPFLAGS += $(libblkmaker_CFLAGS)
  50. # common sources
  51. bfgminer_SOURCES := miner.c
  52. bfgminer_SOURCES += miner.h compat.h \
  53. deviceapi.c deviceapi.h \
  54. util.c util.h logging.h \
  55. sha2.c sha2.h api.c
  56. EXTRA_bfgminer_DEPENDENCIES =
  57. if NEED_LIBBLKMAKER
  58. SUBDIRS += libblkmaker
  59. EXTRA_bfgminer_DEPENDENCIES += libblkmaker_directory
  60. libblkmaker_directory:
  61. cd libblkmaker && $(MAKE)
  62. if HAVE_CYGWIN
  63. EXTRA_bfgminer_DEPENDENCIES += cygblkmaker-0.1-0.dll cygblkmaker_jansson-0.1-0.dll
  64. cyg%.dll: libblkmaker/.libs/cyg%.dll
  65. cp -p $< $@
  66. endif
  67. endif
  68. bfgminer_SOURCES += logging.c
  69. if USE_UDEVRULES
  70. dist_udevrules_DATA = 70-bfgminer.rules
  71. endif
  72. if NEED_BFG_DRIVER_PROXY
  73. bfgminer_SOURCES += driver-proxy.c driver-proxy.h
  74. endif
  75. if USE_LIBMICROHTTPD
  76. bfgminer_SOURCES += httpsrv.c httpsrv.h driver-getwork.c
  77. bfgminer_LDADD += $(libmicrohttpd_LIBS)
  78. bfgminer_LDFLAGS += $(libmicrohttpd_LDFLAGS)
  79. bfgminer_CPPFLAGS += $(libmicrohttpd_CFLAGS)
  80. endif
  81. if USE_LIBEVENT
  82. bfgminer_SOURCES += driver-stratum.c
  83. bfgminer_LDADD += $(libevent_LIBS)
  84. bfgminer_LDFLAGS += $(libevent_LDFLAGS)
  85. bfgminer_CPPFLAGS += $(libevent_CFLAGS)
  86. endif
  87. if HAVE_OPENCL
  88. bfgminer_SOURCES += driver-opencl.h driver-opencl.c
  89. bfgminer_SOURCES += ocl.c ocl.h findnonce.c findnonce.h
  90. bfgminer_SOURCES += adl.c adl.h adl_functions.h
  91. bfgminer_SOURCES += *.cl
  92. kernelsdir = $(pkgdatadir)/opencl
  93. dist_kernels_DATA = $(top_srcdir)/*.cl
  94. dist_doc_DATA += README.GPU
  95. if HAVE_SENSORS
  96. bfgminer_LDADD += $(sensors_LIBS)
  97. endif
  98. endif
  99. if HAS_SCRYPT
  100. bfgminer_SOURCES += scrypt.c scrypt.h
  101. dist_doc_DATA += README.scrypt
  102. endif
  103. if HAS_CPUMINE
  104. dist_doc_DATA += README.CPU
  105. bfgminer_SOURCES += \
  106. sha256_generic.c sha256_via.c \
  107. sha256_cryptopp.c sha256_sse2_amd64.c \
  108. sha256_sse4_amd64.c \
  109. sha256_altivec_4way.c
  110. # the CPU portion extracted from original main.c
  111. bfgminer_SOURCES += driver-cpu.h driver-cpu.c
  112. bfgminer_SOURCES += bench_block.h
  113. if HAVE_SSE2
  114. bfgminer_LDADD += libsse2cpuminer.a
  115. noinst_LIBRARIES = libsse2cpuminer.a
  116. libsse2cpuminer_a_SOURCES = sha256_4way.c
  117. libsse2cpuminer_a_CFLAGS = $(bfgminer_CPPFLAGS) $(SSE2_CFLAGS)
  118. endif
  119. if HAS_YASM
  120. AM_CFLAGS = -DHAS_YASM
  121. if HAVE_x86_64
  122. SUBDIRS += x86_64
  123. x86_64/libx8664.a:
  124. $(MAKE) -C x86_64 $*
  125. bfgminer_LDADD += x86_64/libx8664.a
  126. else # HAVE_x86_64
  127. SUBDIRS += x86_32
  128. x86_32/libx8632.a:
  129. $(MAKE) -C x86_32 $*
  130. bfgminer_LDADD += x86_32/libx8632.a
  131. if HAVE_SSE2
  132. libsse2cpuminer_a_SOURCES += sha256_sse2_i386.c
  133. endif
  134. endif # HAVE_x86_64
  135. endif # HAS_YASM
  136. endif # HAS_CPUMINE
  137. if NEED_BFG_LOWL_VCOM
  138. bfgminer_SOURCES += lowl-vcom.c lowl-vcom.h
  139. if HAVE_WINDOWS
  140. else
  141. bfgminer_SOURCES += iospeeds.h iospeeds_posix.h
  142. endif
  143. endif
  144. if HAVE_LIBUSB
  145. bfgminer_SOURCES += lowl-usb.c lowl-usb.h
  146. endif
  147. if NEED_BFG_BINLOADER
  148. bfgminer_SOURCES += binloader.c binloader.h
  149. endif
  150. if NEED_BFG_LOWLEVEL
  151. bfgminer_SOURCES += lowlevel.c lowlevel.h
  152. endif
  153. if NEED_DYNCLOCK
  154. bfgminer_SOURCES += dynclock.c dynclock.h
  155. endif
  156. if HAS_FPGA
  157. dist_doc_DATA += README.FPGA
  158. endif
  159. if HAS_ASIC
  160. dist_doc_DATA += README.ASIC
  161. endif
  162. if HAS_BITFORCE
  163. bfgminer_SOURCES += driver-bitforce.c
  164. if HAVE_WINDOWS
  165. else
  166. bin_PROGRAMS += bitforce-firmware-flash
  167. bitforce_firmware_flash_SOURCES = bitforce-firmware-flash.c
  168. endif
  169. endif
  170. if HAS_BIGPIC
  171. bfgminer_SOURCES += driver-bigpic.c driver-bigpic.h
  172. endif
  173. if USE_DRILLBIT
  174. bfgminer_SOURCES += driver-drillbit.c
  175. endif
  176. if HAS_TWINFURY
  177. bfgminer_SOURCES += driver-twinfury.c driver-twinfury.h
  178. endif
  179. if HAS_ICARUS
  180. bfgminer_SOURCES += driver-icarus.c icarus-common.h
  181. bfgminer_SOURCES += driver-cairnsmore.c
  182. bfgminer_SOURCES += driver-erupter.c
  183. bfgminer_SOURCES += driver-antminer.c
  184. endif
  185. if USE_DUALMINER
  186. bfgminer_SOURCES += driver-dualminer.c gc3355.c gc3355.h
  187. endif
  188. if HAS_AVALON
  189. bfgminer_SOURCES += driver-avalon.c driver-avalon.h hexdump.c
  190. endif
  191. if USE_KNC
  192. bfgminer_SOURCES += driver-knc.c
  193. endif
  194. if HAS_KLONDIKE
  195. bfgminer_SOURCES += driver-klondike.c driver-klondike.h driver-hashbusteravalon.c
  196. endif
  197. if HAS_MODMINER
  198. bfgminer_SOURCES += driver-modminer.c
  199. endif
  200. if HAS_X6500
  201. bfgminer_SOURCES += driver-x6500.c ft232r.c ft232r.h jtag.c jtag.h
  202. endif
  203. if HAS_ZTEX
  204. bfgminer_SOURCES += driver-ztex.c libztex.c libztex.h
  205. endif
  206. if USE_BIFURY
  207. bfgminer_SOURCES += driver-bifury.c
  208. endif
  209. if HAS_BITFURY
  210. bfgminer_SOURCES += driver-bitfury.c driver-bitfury.h libbitfury.c libbitfury.h spidevc.h spidevc.c
  211. if HAS_BFSB
  212. bfgminer_SOURCES += driver-bfsb.c
  213. endif
  214. if HAS_METABANK
  215. bfgminer_SOURCES += driver-metabank.c tm_i2c.h tm_i2c.c
  216. endif
  217. if HAS_LITTLEFURY
  218. bfgminer_SOURCES += driver-littlefury.c
  219. endif
  220. if HAS_NANOFURY
  221. bfgminer_SOURCES += driver-nanofury.c mcp2210.c mcp2210.h
  222. endif
  223. if USE_HASHBUSTER
  224. bfgminer_SOURCES += driver-hashbuster.c
  225. endif
  226. if USE_HASHBUSTERUSB
  227. bfgminer_SOURCES += driver-hashbusterusb.c
  228. endif
  229. endif
  230. if USE_HASHFAST
  231. bfgminer_SOURCES += driver-hashfast.c
  232. endif
  233. if NEED_BFG_LOWL_HID
  234. bfgminer_SOURCES += lowl-hid.c lowl-hid.h
  235. bfgminer_CPPFLAGS += $(hidapi_CFLAGS)
  236. endif
  237. if NEED_BFG_LOWL_PCI
  238. bfgminer_SOURCES += lowl-pci.c lowl-pci.h
  239. endif
  240. bin_PROGRAMS += bfgminer-rpc
  241. bfgminer_rpc_SOURCES = api-example.c
  242. bfgminer_rpc_LDADD = @WS2_LIBS@