Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #
  2. # Author: Xiangfu Liu <xiangfu@openmobilefree.net>
  3. # Address: 12h6gdGnThW385JaX1LRMA8cXKmbYRTP8Q
  4. #
  5. # This is free and unencumbered software released into the public domain.
  6. # For details see the UNLICENSE file at the root of the source tree.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=cgminer
  10. ifeq ($(CONFIG_CGMINER_BITMAIN),y)
  11. PKG_VERSION:=git-$(shell git ls-remote http://gogserver.dnsalias.com:3000/wareck/cgminer-ants3.git master | cut -f1 | cut -c1-7)
  12. PKG_REV:=master
  13. endif
  14. #PKG_VERSION:=4.10.0
  15. #PKG_REV:=764b03ada628acd2ae917daa13e8afd6af088913
  16. PKG_RELEASE:=1
  17. PKG_INSTALL:=1
  18. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.bz2
  19. ifeq ($(CONFIG_CGMINER_BITMAIN),y)
  20. PKG_SOURCE_URL:=http://gogserver.dnsalias.com:3000/wareck/cgminer-ants3.git
  21. endif
  22. PKG_SOURCE_PROTO:=git
  23. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  24. PKG_SOURCE_VERSION:=$(PKG_REV)
  25. PKG_FIXUP:=autoreconf
  26. include $(INCLUDE_DIR)/package.mk
  27. define Package/cgminer
  28. SECTION:=utils
  29. CATEGORY:=Utilities
  30. TITLE:=cgminer
  31. URL:=https://github.com/ckolivas/cgminer
  32. ifeq ($(CONFIG_TARGET_brcm2708_RaspberryPi),)
  33. DEPENDS:=+libcurl +libpthread +jansson +udev
  34. else
  35. DEPENDS:=+libcurl +libpthread +jansson +udev +libncurses
  36. endif
  37. endef
  38. define Package/cgminer/description
  39. Cgminer is a multi-threaded multi-pool GPU, FPGA and CPU miner with ATI GPU
  40. monitoring, (over)clocking and fanspeed support for bitcoin and derivative
  41. coins. Do not use on multiple block chains at the same time!
  42. endef
  43. define Package/cgminer/config
  44. menu "Configuration"
  45. depends on PACKAGE_cgminer
  46. source "$(SOURCE)/Config.in"
  47. endmenu
  48. endef
  49. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
  50. ifeq ($(CONFIG_CGMINER_BITMAIN),y)
  51. #CONFIGURE_ARGS += --without-curses --enable-ants3
  52. CONFIGURE_ARGS += --without-curses --enable-bitmain
  53. endif
  54. ifeq ($(CONFIG_TARGET_brcm2708_RaspberryPi),)
  55. CONFIGURE_ARGS += --without-curses
  56. endif
  57. define Build/Compile
  58. $(call Build/Compile/Default)
  59. (cd $(PKG_BUILD_DIR) && \
  60. $(TARGET_CC) -Icompat/jansson -Icompat/libusb-1.0/libusb \
  61. api-example.c -o cgminer-api;)
  62. endef
  63. define Package/cgminer/install
  64. $(INSTALL_DIR) $(1)/usr/bin
  65. $(INSTALL_DIR) $(1)/etc/init.d
  66. $(INSTALL_DIR) $(1)/etc/config
  67. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgminer-api $(1)/usr/bin
  68. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgminer $(1)/usr/bin
  69. ifeq ($(CONFIG_CGMINER_BITMAIN),y)
  70. $(INSTALL_BIN) $(FILES_DIR)/cgminer-bitmain-monitor $(1)/usr/bin/cgminer-monitor
  71. $(INSTALL_BIN) $(FILES_DIR)/cgminer.bitmain.init $(1)/etc/init.d/cgminer
  72. $(CP) $(FILES_DIR)/cgminer.bitmain.config $(1)/etc/config/cgminer
  73. $(INSTALL_BIN) $(FILES_DIR)/mm-bitmain-upgrade $(1)/usr/bin/mmupgrade
  74. endif
  75. endef
  76. $(eval $(call BuildPackage,cgminer))