Makefile.am 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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
  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/libccan.a:
  31. $(MAKE) -C ccan $*
  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/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 += @JANSSON_CFLAGS@
  42. bfgminer_CPPFLAGS += $(PTHREAD_FLAGS)
  43. bfgminer_CPPFLAGS += $(NCURSES_CPPFLAGS)
  44. bfgminer_LDADD += $(libblkmaker_LIBS)
  45. bfgminer_LDFLAGS += $(libblkmaker_LDFLAGS)
  46. bfgminer_CPPFLAGS += $(libblkmaker_CFLAGS)
  47. # common sources
  48. bfgminer_SOURCES := miner.c
  49. bfgminer_SOURCES += miner.h compat.h bench_block.h \
  50. deviceapi.c deviceapi.h \
  51. util.c util.h logging.h \
  52. sha2.c sha2.h api.c
  53. EXTRA_bfgminer_DEPENDENCIES =
  54. if NEED_LIBBLKMAKER
  55. SUBDIRS += libblkmaker
  56. EXTRA_bfgminer_DEPENDENCIES += libblkmaker_directory
  57. libblkmaker_directory:
  58. cd libblkmaker && $(MAKE)
  59. if HAVE_CYGWIN
  60. EXTRA_bfgminer_DEPENDENCIES += cygblkmaker-0.1-0.dll cygblkmaker_jansson-0.1-0.dll
  61. cyg%.dll: libblkmaker/.libs/cyg%.dll
  62. cp -p $< $@
  63. endif
  64. endif
  65. bfgminer_SOURCES += logging.c
  66. if NEED_BFG_DRIVER_PROXY
  67. bfgminer_SOURCES += driver-proxy.c driver-proxy.h
  68. endif
  69. if USE_LIBMICROHTTPD
  70. bfgminer_SOURCES += httpsrv.c httpsrv.h driver-getwork.c
  71. bfgminer_LDADD += $(libmicrohttpd_LIBS)
  72. bfgminer_LDFLAGS += $(libmicrohttpd_LDFLAGS)
  73. bfgminer_CPPFLAGS += $(libmicrohttpd_CFLAGS)
  74. endif
  75. # GPU sources, TODO: make them selectable
  76. # the GPU portion extracted from original main.c
  77. bfgminer_SOURCES += driver-opencl.h driver-opencl.c
  78. if HAVE_OPENCL
  79. # the original GPU related sources, unchanged
  80. bfgminer_SOURCES += ocl.c ocl.h findnonce.c findnonce.h
  81. bfgminer_SOURCES += adl.c adl.h adl_functions.h
  82. bfgminer_SOURCES += *.cl
  83. kernelsdir = $(pkgdatadir)/opencl
  84. dist_kernels_DATA = $(top_srcdir)/*.cl
  85. dist_doc_DATA += README.GPU
  86. if HAVE_SENSORS
  87. bfgminer_LDADD += $(sensors_LIBS)
  88. endif
  89. endif
  90. if HAS_SCRYPT
  91. bfgminer_SOURCES += scrypt.c scrypt.h
  92. dist_doc_DATA += README.scrypt
  93. endif
  94. if HAS_CPUMINE
  95. bfgminer_SOURCES += \
  96. sha256_generic.c sha256_via.c \
  97. sha256_cryptopp.c sha256_sse2_amd64.c \
  98. sha256_sse4_amd64.c \
  99. sha256_altivec_4way.c
  100. # the CPU portion extracted from original main.c
  101. bfgminer_SOURCES += driver-cpu.h driver-cpu.c
  102. if HAVE_SSE2
  103. bfgminer_LDADD += libsse2cpuminer.a
  104. noinst_LIBRARIES = libsse2cpuminer.a
  105. libsse2cpuminer_a_SOURCES = sha256_4way.c
  106. libsse2cpuminer_a_CFLAGS = $(bfgminer_CPPFLAGS) $(SSE2_CFLAGS)
  107. endif
  108. if HAS_YASM
  109. AM_CFLAGS = -DHAS_YASM
  110. if HAVE_x86_64
  111. SUBDIRS += x86_64
  112. x86_64/libx8664.a:
  113. $(MAKE) -C x86_64 $*
  114. bfgminer_LDADD += x86_64/libx8664.a
  115. else # HAVE_x86_64
  116. SUBDIRS += x86_32
  117. x86_32/libx8632.a:
  118. $(MAKE) -C x86_32 $*
  119. bfgminer_LDADD += x86_32/libx8632.a
  120. if HAVE_SSE2
  121. libsse2cpuminer_a_SOURCES += sha256_sse2_i386.c
  122. endif
  123. endif # HAVE_x86_64
  124. endif # HAS_YASM
  125. endif # HAS_CPUMINE
  126. if NEED_FPGAUTILS
  127. bfgminer_SOURCES += fpgautils.c fpgautils.h
  128. if HAVE_WINDOWS
  129. else
  130. bfgminer_SOURCES += iospeeds.h iospeeds_posix.h
  131. endif
  132. endif
  133. if NEED_DYNCLOCK
  134. bfgminer_SOURCES += dynclock.c dynclock.h
  135. endif
  136. if HAS_FPGA
  137. dist_doc_DATA += README.FPGA
  138. endif
  139. if HAS_ASIC
  140. dist_doc_DATA += README.ASIC
  141. endif
  142. if HAS_BITFORCE
  143. bfgminer_SOURCES += driver-bitforce.c
  144. if HAVE_WINDOWS
  145. else
  146. bin_PROGRAMS += bitforce-firmware-flash
  147. bitforce_firmware_flash_SOURCES = bitforce-firmware-flash.c
  148. endif
  149. endif
  150. if HAS_ICARUS
  151. bfgminer_SOURCES += driver-icarus.c icarus-common.h
  152. bfgminer_SOURCES += driver-cairnsmore.c
  153. bfgminer_SOURCES += driver-erupter.c
  154. endif
  155. if HAS_AVALON
  156. bfgminer_SOURCES += driver-avalon.c driver-avalon.h hexdump.c
  157. endif
  158. if HAS_MODMINER
  159. bfgminer_SOURCES += driver-modminer.c
  160. endif
  161. if HAS_X6500
  162. bfgminer_SOURCES += driver-x6500.c ft232r.c ft232r.h jtag.c jtag.h
  163. endif
  164. if HAS_ZTEX
  165. bfgminer_SOURCES += driver-ztex.c libztex.c libztex.h
  166. endif
  167. bin_PROGRAMS += bfgminer-rpc
  168. bfgminer_rpc_SOURCES = api-example.c
  169. bfgminer_rpc_LDADD = @WS2_LIBS@