Makefile.am 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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.ASIC \
  19. README.FPGA \
  20. README.GPU \
  21. README.RPC \
  22. README.scrypt
  23. rpcexamplesdir = $(docdir)/rpc-examples
  24. dist_rpcexamples_DATA = \
  25. api-example.php miner.php \
  26. API.class API.java api-example.c \
  27. api-example.py
  28. SUBDIRS = lib ccan
  29. INCLUDES = -fno-strict-aliasing
  30. bin_PROGRAMS = bfgminer
  31. bfgminer_LDFLAGS = $(PTHREAD_FLAGS)
  32. bfgminer_LDADD = $(DLOPEN_FLAGS) @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ \
  33. @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ \
  34. @UDEV_LIBS@ @LIBUSB_LIBS@ @MM_LIBS@ \
  35. @MATH_LIBS@ lib/libgnu.a ccan/libccan.a
  36. bfgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @LIBUSB_CFLAGS@ @LIBCURL_CFLAGS@
  37. bfgminer_CPPFLAGS += -DCGMINER_PREFIX='"$(pkgdatadir)"'
  38. bfgminer_CPPFLAGS += @JANSSON_CFLAGS@
  39. bfgminer_CPPFLAGS += $(PTHREAD_FLAGS)
  40. bfgminer_CPPFLAGS += $(NCURSES_CPPFLAGS)
  41. bfgminer_LDADD += $(libblkmaker_LIBS)
  42. bfgminer_LDFLAGS += $(libblkmaker_LDFLAGS)
  43. bfgminer_CPPFLAGS += $(libblkmaker_CFLAGS)
  44. # common sources
  45. bfgminer_SOURCES := miner.c
  46. bfgminer_SOURCES += miner.h compat.h bench_block.h \
  47. deviceapi.c deviceapi.h \
  48. util.c util.h logging.h \
  49. sha2.c sha2.h api.c
  50. bfgminer_DEPENDENCIES =
  51. bitstreamsdir = $(pkgdatadir)/bitstreams
  52. dist_bitstreams_DATA =
  53. if NEED_LIBBLKMAKER
  54. SUBDIRS += libblkmaker
  55. if HAVE_CYGWIN
  56. bfgminer_DEPENDENCIES += cygblkmaker-0.1-0.dll cygblkmaker_jansson-0.1-0.dll
  57. cyg%.dll: libblkmaker/.libs/cyg%.dll
  58. cp -p $< $@
  59. endif
  60. endif
  61. bfgminer_SOURCES += logging.c
  62. # GPU sources, TODO: make them selectable
  63. # the GPU portion extracted from original main.c
  64. bfgminer_SOURCES += driver-opencl.h driver-opencl.c
  65. if HAVE_OPENCL
  66. # the original GPU related sources, unchanged
  67. bfgminer_SOURCES += ocl.c ocl.h findnonce.c findnonce.h
  68. bfgminer_SOURCES += adl.c adl.h adl_functions.h
  69. bfgminer_SOURCES += *.cl
  70. kernelsdir = $(pkgdatadir)/opencl
  71. dist_kernels_DATA = $(top_srcdir)/*.cl
  72. if HAVE_SENSORS
  73. bfgminer_LDADD += $(sensors_LIBS)
  74. endif
  75. endif
  76. if HAS_SCRYPT
  77. bfgminer_SOURCES += scrypt.c scrypt.h
  78. endif
  79. if HAS_CPUMINE
  80. bfgminer_SOURCES += \
  81. sha256_generic.c sha256_via.c \
  82. sha256_cryptopp.c sha256_sse2_amd64.c \
  83. sha256_sse4_amd64.c \
  84. sha256_altivec_4way.c
  85. # the CPU portion extracted from original main.c
  86. bfgminer_SOURCES += driver-cpu.h driver-cpu.c
  87. if HAVE_SSE2
  88. bfgminer_LDADD += libsse2cpuminer.a
  89. noinst_LIBRARIES = libsse2cpuminer.a
  90. libsse2cpuminer_a_SOURCES = sha256_4way.c
  91. libsse2cpuminer_a_CFLAGS = $(bfgminer_CPPFLAGS) $(SSE2_CFLAGS)
  92. endif
  93. if HAS_YASM
  94. AM_CFLAGS = -DHAS_YASM
  95. if HAVE_x86_64
  96. SUBDIRS += x86_64
  97. bfgminer_LDADD += x86_64/libx8664.a
  98. else # HAVE_x86_64
  99. SUBDIRS += x86_32
  100. bfgminer_LDADD += x86_32/libx8632.a
  101. if HAVE_SSE2
  102. libsse2cpuminer_a_SOURCES += sha256_sse2_i386.c
  103. endif
  104. endif # HAVE_x86_64
  105. endif # HAS_YASM
  106. endif # HAS_CPUMINE
  107. if NEED_FPGAUTILS
  108. bfgminer_SOURCES += fpgautils.c fpgautils.h
  109. endif
  110. if NEED_DYNCLOCK
  111. bfgminer_SOURCES += dynclock.c dynclock.h
  112. endif
  113. if HAS_BITFORCE
  114. bfgminer_SOURCES += driver-bitforce.c
  115. if HAVE_WINDOWS
  116. else
  117. bin_PROGRAMS += bitforce-firmware-flash
  118. bitforce_firmware_flash_SOURCES = bitforce-firmware-flash.c
  119. endif
  120. endif
  121. if HAS_ICARUS
  122. bfgminer_SOURCES += driver-icarus.c icarus-common.h
  123. bfgminer_SOURCES += driver-cairnsmore.c
  124. endif
  125. if HAS_AVALON
  126. bfgminer_SOURCES += driver-avalon.c driver-avalon.h hexdump.c
  127. endif
  128. if HAS_MODMINER
  129. bfgminer_SOURCES += driver-modminer.c
  130. endif
  131. if HAS_X6500
  132. bfgminer_SOURCES += driver-x6500.c ft232r.c ft232r.h jtag.c jtag.h
  133. endif
  134. if NEED_BITSTREAM_FPGAMINER
  135. dist_bitstreams_DATA += $(top_srcdir)/bitstreams/fpgaminer*.bit
  136. dist_doc_DATA += $(top_srcdir)/bitstreams/COPYING_fpgaminer
  137. endif
  138. if HAS_ZTEX
  139. bfgminer_SOURCES += driver-ztex.c libztex.c libztex.h
  140. dist_bitstreams_DATA += $(top_srcdir)/bitstreams/ztex_*.bi?
  141. dist_doc_DATA += $(top_srcdir)/bitstreams/COPYING_ztex
  142. endif
  143. bin_PROGRAMS += bfgminer-rpc
  144. bfgminer_rpc_SOURCES = api-example.c
  145. bfgminer_rpc_LDADD = @WS2_LIBS@