Makefile.am 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 = example.conf m4/gnulib-cache.m4 linux-usb-bfgminer \
  12. api-example.php miner.php \
  13. api-example.c windows-build.txt \
  14. bitstreams/*.bi? bitstreams/COPYING_* README.FPGA README.RPC README.scrypt \
  15. api-example.py
  16. SUBDIRS = lib ccan
  17. # Without a redirected rule, code depending on different lib/*.h files may try to build dependencies of that in parallel, which can fail
  18. lib/%: lib_directory
  19. @test -e $@
  20. lib_directory:
  21. $(MAKE) -C lib
  22. ccan/libccan.a:
  23. $(MAKE) -C ccan $*
  24. INCLUDES = -fno-strict-aliasing
  25. bin_PROGRAMS = bfgminer
  26. bin_SCRIPTS = *.cl
  27. bfgminer_LDFLAGS = $(PTHREAD_FLAGS)
  28. bfgminer_LDADD = $(DLOPEN_FLAGS) @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ \
  29. @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ \
  30. @UDEV_LIBS@ @LIBUSB_LIBS@ \
  31. @MATH_LIBS@ lib/libgnu.a ccan/libccan.a
  32. bfgminer_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @LIBUSB_CFLAGS@ @LIBCURL_CFLAGS@
  33. bfgminer_CPPFLAGS += @JANSSON_CFLAGS@
  34. bfgminer_CPPFLAGS += $(PTHREAD_FLAGS)
  35. bfgminer_CPPFLAGS += $(NCURSES_CPPFLAGS)
  36. bfgminer_LDADD += $(libblkmaker_LIBS)
  37. bfgminer_LDFLAGS += $(libblkmaker_LDFLAGS)
  38. bfgminer_CPPFLAGS += $(libblkmaker_CFLAGS)
  39. # common sources
  40. bfgminer_SOURCES := miner.c
  41. bfgminer_SOURCES += elist.h miner.h compat.h bench_block.h \
  42. deviceapi.c deviceapi.h \
  43. util.c util.h uthash.h logging.h \
  44. sha2.c sha2.h api.c
  45. EXTRA_bfgminer_DEPENDENCIES =
  46. if NEED_LIBBLKMAKER
  47. SUBDIRS += libblkmaker
  48. EXTRA_bfgminer_DEPENDENCIES += libblkmaker_directory
  49. libblkmaker_directory:
  50. cd libblkmaker && $(MAKE)
  51. if HAVE_CYGWIN
  52. EXTRA_bfgminer_DEPENDENCIES += cygblkmaker-0.1-0.dll cygblkmaker_jansson-0.1-0.dll
  53. cyg%.dll: libblkmaker/.libs/cyg%.dll
  54. cp -p $< $@
  55. endif
  56. endif
  57. bfgminer_SOURCES += logging.c
  58. # GPU sources, TODO: make them selectable
  59. # the GPU portion extracted from original main.c
  60. bfgminer_SOURCES += driver-opencl.h driver-opencl.c
  61. # the original GPU related sources, unchanged
  62. bfgminer_SOURCES += ocl.c ocl.h findnonce.c findnonce.h
  63. bfgminer_SOURCES += adl.c adl.h adl_functions.h
  64. bfgminer_SOURCES += *.cl
  65. if HAS_SCRYPT
  66. bfgminer_SOURCES += scrypt.c scrypt.h
  67. endif
  68. if HAS_CPUMINE
  69. # original CPU related sources, unchanged
  70. bfgminer_SOURCES += \
  71. sha256_generic.c sha256_4way.c sha256_via.c \
  72. sha256_cryptopp.c sha256_sse2_amd64.c \
  73. sha256_sse4_amd64.c sha256_sse2_i386.c \
  74. sha256_altivec_4way.c
  75. # the CPU portion extracted from original main.c
  76. bfgminer_SOURCES += driver-cpu.h driver-cpu.c
  77. if HAS_YASM
  78. AM_CFLAGS = -DHAS_YASM
  79. if HAVE_x86_64
  80. SUBDIRS += x86_64
  81. x86_64/libx8664.a:
  82. $(MAKE) -C x86_64 $*
  83. bfgminer_LDADD += x86_64/libx8664.a
  84. else # HAVE_x86_64
  85. SUBDIRS += x86_32
  86. x86_32/libx8632.a:
  87. $(MAKE) -C x86_32 $*
  88. bfgminer_LDADD += x86_32/libx8632.a
  89. endif # HAVE_x86_64
  90. endif # HAS_YASM
  91. endif # HAS_CPUMINE
  92. if NEED_FPGAUTILS
  93. bfgminer_SOURCES += fpgautils.c fpgautils.h
  94. endif
  95. if NEED_DYNCLOCK
  96. bfgminer_SOURCES += dynclock.c dynclock.h
  97. endif
  98. if HAS_BITFORCE
  99. bfgminer_SOURCES += driver-bitforce.c
  100. if HAVE_WINDOWS
  101. else
  102. bin_PROGRAMS += bitforce-firmware-flash
  103. bitforce_firmware_flash_SOURCES = bitforce-firmware-flash.c
  104. endif
  105. endif
  106. if HAS_ICARUS
  107. bfgminer_SOURCES += driver-icarus.c icarus-common.h
  108. bfgminer_SOURCES += driver-cairnsmore.c
  109. endif
  110. if HAS_AVALON
  111. bfgminer_SOURCES += driver-avalon.c driver-avalon.h hexdump.c
  112. endif
  113. if HAS_MODMINER
  114. bfgminer_SOURCES += driver-modminer.c
  115. bitstreamsdir = $(bindir)/bitstreams
  116. dist_bitstreams_DATA = bitstreams/*.bi? bitstreams/COPYING_*
  117. endif
  118. if HAS_X6500
  119. bfgminer_SOURCES += driver-x6500.c ft232r.c ft232r.h jtag.c jtag.h
  120. bitstreamsdir = $(bindir)/bitstreams
  121. dist_bitstreams_DATA = bitstreams/*.bi? bitstreams/COPYING_*
  122. endif
  123. if HAS_ZTEX
  124. bfgminer_SOURCES += driver-ztex.c libztex.c libztex.h
  125. bitstreamsdir = $(bindir)/bitstreams
  126. dist_bitstreams_DATA = bitstreams/*.bi? bitstreams/COPYING_*
  127. endif
  128. bin_PROGRAMS += bfgminer-rpc
  129. bfgminer_rpc_SOURCES = api-example.c
  130. bfgminer_rpc_LDADD = @WS2_LIBS@