Makefile.am 4.2 KB

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