Makefile 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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:=4.10.0
  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_INSTALL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. define Download/uthash
  19. FILE:=v1.9.8
  20. URL:=https://codeload.github.com/troydhanson/uthash/tar.gz/
  21. endef
  22. $(eval $(call Download,uthash))
  23. define Package/$(PKG_NAME)/Default
  24. MAINTAINER:="Luke Dashjr" <luke_openwrt@dashjr.org>
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. URL:=http://luke.dashjr.org/programs/$(PKG_NAME)
  28. DEPENDS:=+$(PKG_NAME)
  29. endef
  30. define Package/$(PKG_NAME)
  31. $(call Package/$(PKG_NAME)/Default)
  32. TITLE:=$(PKG_TITLE) (Bitcoin miner)
  33. 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
  34. endef
  35. define Package/$(PKG_NAME)/description
  36. Modular Bitcoin ASIC/FPGA/GPU/CPU miner in C
  37. endef
  38. define Package/$(PKG_NAME)/config
  39. config PACKAGE_$(PKG_NAME)_curses
  40. bool "Build with curses TUI support"
  41. depends on PACKAGE_$(PKG_NAME)
  42. default y
  43. config PACKAGE_$(PKG_NAME)_libevent
  44. bool "Build with stratum server support"
  45. depends on PACKAGE_$(PKG_NAME)
  46. default y
  47. config PACKAGE_$(PKG_NAME)_libmicrohttpd
  48. bool "Build with getwork server support (Block Erupter blades)"
  49. depends on PACKAGE_$(PKG_NAME)
  50. default y
  51. config PACKAGE_$(PKG_NAME)_libusb
  52. bool "Build with libusb support (X6500 & ZTEX)"
  53. depends on PACKAGE_$(PKG_NAME)
  54. default y
  55. config PACKAGE_$(PKG_NAME)_keccak
  56. bool "Build with Keccak algorithm support"
  57. depends on PACKAGE_$(PKG_NAME)
  58. default n
  59. config PACKAGE_$(PKG_NAME)_scrypt
  60. bool "Build with scrypt algorithm support"
  61. depends on PACKAGE_$(PKG_NAME)
  62. default y
  63. endef
  64. ifndef CONFIG_PACKAGE_$(PKG_NAME)_curses
  65. CONFIGURE_ARGS += --without-curses
  66. else
  67. CONFIGURE_ARGS += --with-curses=ncurses
  68. endif
  69. ifndef CONFIG_PACKAGE_$(PKG_NAME)_libevent
  70. CONFIGURE_ARGS += --without-libevent
  71. else
  72. CONFIGURE_ARGS += --with-libevent
  73. endif
  74. ifndef CONFIG_PACKAGE_$(PKG_NAME)_libmicrohttpd
  75. CONFIGURE_ARGS += --without-libmicrohttpd
  76. else
  77. CONFIGURE_ARGS += --with-libmicrohttpd
  78. endif
  79. ifndef CONFIG_PACKAGE_$(PKG_NAME)_libusb
  80. CONFIGURE_ARGS += --without-libusb
  81. endif
  82. ifdef CONFIG_PACKAGE_$(PKG_NAME)_keccak
  83. CONFIGURE_ARGS += --enable-keccak
  84. endif
  85. ifdef CONFIG_PACKAGE_$(PKG_NAME)_scrypt
  86. CONFIGURE_ARGS += --enable-scrypt
  87. endif
  88. TARGET_CFLAGS += -std=gnu99
  89. TARGET_CFLAGS += -Iuthash-1.9.8/src
  90. CONFIGURE_ARGS += --without-libudev
  91. CONFIGURE_ARGS += --without-sensors
  92. CONFIGURE_ARGS += --without-system-libbase58
  93. define Build/Prepare
  94. $(call Build/Prepare/Default)
  95. gzip -dc $(DL_DIR)/v1.9.8 | $(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
  96. endef
  97. define Build/Configure
  98. # Need to remake configure etc to pick up on cross-compiler libtool
  99. ( cd $(PKG_BUILD_DIR); NOSUBMODULES=1 ./autogen.sh; )
  100. $(call Build/Configure/Default)
  101. endef
  102. define Package/$(PKG_NAME)/install
  103. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
  104. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin
  105. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)-rpc $(1)/usr/bin
  106. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libblkmaker*.so* $(1)/usr/lib
  107. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libbase58*.so* $(1)/usr/lib
  108. endef
  109. ALL_$(PKG_NAME)_PACKAGES += $(PKG_NAME)
  110. $(foreach bitstream,$(ALL_$(PKG_NAME)_PACKAGES),$(eval $(call BuildPackage,$(bitstream))))