Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #
  2. # Copyright 2013 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:=9999
  13. PKG_RELEASE:=1
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tbz2
  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 Package/$(PKG_NAME)/Default
  19. MAINTAINER:="Luke Dashjr" <luke_openwrt@dashjr.org>
  20. SECTION:=utils
  21. CATEGORY:=Utilities
  22. URL:=http://luke.dashjr.org/programs/$(PKG_NAME)
  23. DEPENDS:=+$(PKG_NAME)
  24. endef
  25. define Package/$(PKG_NAME)
  26. $(call Package/$(PKG_NAME)/Default)
  27. TITLE:=$(PKG_TITLE) (Bitcoin miner)
  28. DEPENDS:=+libc +libcurl +libpthread +jansson +PACKAGE_$(PKG_NAME)_curses:libncurses +PACKAGE_$(PKG_NAME)_libusb:libusb-1.0
  29. endef
  30. define Package/$(PKG_NAME)/description
  31. Modular Bitcoin CPU/GPU/FPGA miner in C
  32. endef
  33. define Package/$(PKG_NAME)/config
  34. config PACKAGE_$(PKG_NAME)_curses
  35. bool "Build with curses TUI support"
  36. depends on PACKAGE_$(PKG_NAME)
  37. default y
  38. config PACKAGE_$(PKG_NAME)_libusb
  39. bool "Build with libusb support (X6500 & ZTEX)"
  40. depends on PACKAGE_$(PKG_NAME)
  41. default y
  42. endef
  43. ifndef CONFIG_PACKAGE_$(PKG_NAME)_curses
  44. CONFIGURE_ARGS += --without-curses
  45. else
  46. CONFIGURE_ARGS += --with-curses=ncurses
  47. endif
  48. ifndef CONFIG_PACKAGE_$(PKG_NAME)_libusb
  49. CONFIGURE_ARGS += --disable-x6500 --disable-ztex
  50. endif
  51. TARGET_CFLAGS += -std=gnu99
  52. CONFIGURE_ARGS += --without-libudev
  53. CONFIGURE_ARGS += --without-sensors
  54. define Build/Configure
  55. # Need to remake configure etc to pick up on cross-compiler libtool
  56. ( cd $(PKG_BUILD_DIR); NOSUBMODULES=1 ./autogen.sh; )
  57. $(call Build/Configure/Default)
  58. endef
  59. define Package/$(PKG_NAME)/install
  60. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
  61. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin
  62. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)-rpc $(1)/usr/bin
  63. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libblkmaker*.so* $(1)/usr/lib
  64. endef
  65. ALL_$(PKG_NAME)_PACKAGES += $(PKG_NAME)
  66. #### BitForce firmware flash ####
  67. define Package/bitforce-firmware-flash
  68. $(call Package/$(PKG_NAME)/Default)
  69. TITLE:=BitForce firmware flash tool
  70. endef
  71. define Package/bitforce-firmware-flash/description
  72. BitForce firmware flash tool
  73. endef
  74. define Package/bitforce-firmware-flash/install
  75. $(INSTALL_DIR) $(1)/usr/bin
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bitforce-firmware-flash $(1)/usr/bin
  77. endef
  78. ALL_$(PKG_NAME)_PACKAGES += bitforce-firmware-flash
  79. #### Bitstreams ####
  80. define Package/$(PKG_NAME)/BitstreamTemplate
  81. define Package/$(PKG_NAME)-bitstream-$(1)
  82. $(call Package/$(PKG_NAME)/Default)
  83. TITLE:=$(2)
  84. PKGARCH:=all
  85. endef
  86. define Package/$(PKG_NAME)-bitstream-$(1)/description
  87. $(2)
  88. endef
  89. define Package/$(PKG_NAME)-bitstream-$(1)/install
  90. $(INSTALL_DIR) $$(1)/usr/share/$(PKG_NAME)/bitstreams
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bitstreams/$(subst -,_,$(1))* $$(1)/usr/share/$(PKG_NAME)/bitstreams
  92. endef
  93. ALL_$(PKG_NAME)_PACKAGES += $(PKG_NAME)-bitstream-$(1)
  94. endef
  95. define Package/$(PKG_NAME)/ZtexBitstreamTemplate
  96. $(call Package/$(PKG_NAME)/BitstreamTemplate,ztex-$(1),Ztex $(2) FPGA bitstream (for $(PKG_TITLE) w/ libusb support))
  97. endef
  98. $(eval $(call Package/$(PKG_NAME)/BitstreamTemplate,fpgaminer,ModMiner/X6500 FPGA bitstream (for $(PKG_TITLE))))
  99. $(eval $(call Package/$(PKG_NAME)/ZtexBitstreamTemplate,ufm1_15b1,1.15b))
  100. $(eval $(call Package/$(PKG_NAME)/ZtexBitstreamTemplate,ufm1_15d1,1.15d))
  101. $(eval $(call Package/$(PKG_NAME)/ZtexBitstreamTemplate,ufm1_15d3,1.15d))
  102. $(eval $(call Package/$(PKG_NAME)/ZtexBitstreamTemplate,ufm1_15d4,1.15d & 1.15x))
  103. $(eval $(call Package/$(PKG_NAME)/ZtexBitstreamTemplate,ufm1_15y1,1.15y))
  104. $(foreach bitstream,$(ALL_$(PKG_NAME)_PACKAGES),$(eval $(call BuildPackage,$(bitstream))))