Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #
  2. # Copyright 2013-2014 Luke Dashjr
  3. #
  4. # This program is free software; you can redistribute it and/or modify it
  5. # under the terms of the GNU General Public License as published by the Free
  6. # Software Foundation; either version 3 of the License, or (at your option)
  7. # any later version. See COPYING for more details.
  8. #
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=bfgminer
  11. PKG_TITLE:=BFGMiner
  12. PKG_VERSION:=5.4.2
  13. PKG_RELEASE:=1
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).txz
  15. PKG_SOURCE_URL:=http://luke.dashjr.org/programs/bitcoin/files/$(PKG_NAME)/$(PKG_VERSION)/
  16. PKG_MAINTAINER:=Luke Dashjr <luke-jr+bfgminer@utopios.org>
  17. PKG_LICENSE:=GPL-3.0+
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Download/uthash
  22. FILE:=v1.9.8
  23. URL:=https://codeload.github.com/troydhanson/uthash/tar.gz/
  24. endef
  25. $(eval $(call Download,uthash))
  26. define Package/$(PKG_NAME)/Default
  27. MAINTAINER:="Luke Dashjr" <luke_openwrt@dashjr.org>
  28. SECTION:=utils
  29. CATEGORY:=Utilities
  30. URL:=http://luke.dashjr.org/programs/$(PKG_NAME)
  31. DEPENDS:=+$(PKG_NAME)
  32. endef
  33. define Package/$(PKG_NAME)
  34. $(call Package/$(PKG_NAME)/Default)
  35. TITLE:=$(PKG_TITLE) (Bitcoin miner)
  36. DEPENDS:=+libc +libcurl +libpthread +jansson +PACKAGE_$(PKG_NAME)_libevent:libevent2 +PACKAGE_$(PKG_NAME)_curses:libncurses +PACKAGE_$(PKG_NAME)_libmicrohttpd:libmicrohttpd +PACKAGE_$(PKG_NAME)_libusb:libusb-1.0
  37. endef
  38. define Package/$(PKG_NAME)/description
  39. Modular Bitcoin ASIC/FPGA/GPU/CPU miner in C
  40. endef
  41. define Package/$(PKG_NAME)/config
  42. config PACKAGE_$(PKG_NAME)_curses
  43. bool "Build with curses TUI support"
  44. depends on PACKAGE_$(PKG_NAME)
  45. default y
  46. config PACKAGE_$(PKG_NAME)_libevent
  47. bool "Build with stratum server support"
  48. depends on PACKAGE_$(PKG_NAME)
  49. default y
  50. config PACKAGE_$(PKG_NAME)_libmicrohttpd
  51. bool "Build with getwork server support (Block Erupter blades)"
  52. depends on PACKAGE_$(PKG_NAME)
  53. default y
  54. config PACKAGE_$(PKG_NAME)_libusb
  55. bool "Build with libusb support (Cointerra, HashBuster Micro, Klondike, X6500 & ZTEX)"
  56. depends on PACKAGE_$(PKG_NAME)
  57. default y
  58. config PACKAGE_$(PKG_NAME)_bitmain
  59. bool "Build with bitmain driver (only for S* series miners)"
  60. depends on PACKAGE_$(PKG_NAME)
  61. default n
  62. config PACKAGE_$(PKG_NAME)_keccak
  63. bool "Build with Keccak algorithm support"
  64. depends on PACKAGE_$(PKG_NAME)
  65. default n
  66. config PACKAGE_$(PKG_NAME)_scrypt
  67. bool "Build with scrypt algorithm support"
  68. depends on PACKAGE_$(PKG_NAME)
  69. default y
  70. endef
  71. ifndef CONFIG_PACKAGE_$(PKG_NAME)_curses
  72. CONFIGURE_ARGS += --without-curses
  73. else
  74. CONFIGURE_ARGS += --with-curses=ncurses
  75. endif
  76. ifndef CONFIG_PACKAGE_$(PKG_NAME)_libevent
  77. CONFIGURE_ARGS += --without-libevent
  78. else
  79. CONFIGURE_ARGS += --with-libevent
  80. endif
  81. ifndef CONFIG_PACKAGE_$(PKG_NAME)_libmicrohttpd
  82. CONFIGURE_ARGS += --without-libmicrohttpd
  83. else
  84. CONFIGURE_ARGS += --with-libmicrohttpd
  85. endif
  86. ifndef CONFIG_PACKAGE_$(PKG_NAME)_libusb
  87. CONFIGURE_ARGS += --without-libusb
  88. endif
  89. ifdef CONFIG_PACKAGE_$(PKG_NAME)_bitmain
  90. CONFIGURE_ARGS += --enable-bitmain
  91. endif
  92. ifdef CONFIG_PACKAGE_$(PKG_NAME)_keccak
  93. CONFIGURE_ARGS += --enable-keccak
  94. endif
  95. ifdef CONFIG_PACKAGE_$(PKG_NAME)_scrypt
  96. CONFIGURE_ARGS += --enable-scrypt
  97. endif
  98. TARGET_CFLAGS += -std=gnu99
  99. TARGET_CFLAGS += -Iuthash-1.9.8/src
  100. CONFIGURE_ARGS += --without-libudev
  101. CONFIGURE_ARGS += --without-sensors
  102. CONFIGURE_ARGS += --without-system-libbase58
  103. define Build/Prepare
  104. $(call Build/Prepare/Default)
  105. gzip -dc $(DL_DIR)/v1.9.8 | $(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  106. endef
  107. define Build/Configure
  108. # Need to remake configure etc to pick up on cross-compiler libtool
  109. ( cd $(PKG_BUILD_DIR); NOSUBMODULES=1 ./autogen.sh; )
  110. $(call Build/Configure/Default)
  111. endef
  112. define Package/$(PKG_NAME)/install
  113. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
  114. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin
  115. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)-rpc $(1)/usr/bin
  116. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libblkmaker*.so* $(1)/usr/lib
  117. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libbase58*.so* $(1)/usr/lib
  118. endef
  119. ALL_$(PKG_NAME)_PACKAGES += $(PKG_NAME)
  120. $(foreach bitstream,$(ALL_$(PKG_NAME)_PACKAGES),$(eval $(call BuildPackage,$(bitstream))))