Makefile.am 5.0 KB

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