Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. endif
  53. ifeq ($(CONFIG_TARGET_brcm2708_RaspberryPi),)
  54. CONFIGURE_ARGS += --without-curses
  55. endif
  56. define Build/Compile
  57. $(call Build/Compile/Default)
  58. (cd $(PKG_BUILD_DIR) && \
  59. $(TARGET_CC) -Icompat/jansson -Icompat/libusb-1.0/libusb \
  60. api-example.c -o cgminer-api;)
  61. endef
  62. define Package/cgminer/install
  63. $(INSTALL_DIR) $(1)/usr/bin
  64. $(INSTALL_DIR) $(1)/etc/init.d
  65. $(INSTALL_DIR) $(1)/etc/config
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgminer-api $(1)/usr/bin
  67. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgminer $(1)/usr/bin
  68. ifeq ($(CONFIG_CGMINER_BITMAIN),y)
  69. $(INSTALL_BIN) $(FILES_DIR)/cgminer-bitmain-monitor $(1)/usr/bin/cgminer-monitor
  70. $(INSTALL_BIN) $(FILES_DIR)/cgminer.bitmain.init $(1)/etc/init.d/cgminer
  71. $(CP) $(FILES_DIR)/cgminer.bitmain.config $(1)/etc/config/cgminer
  72. $(INSTALL_BIN) $(FILES_DIR)/mm-bitmain-upgrade $(1)/usr/bin/mmupgrade
  73. endif
  74. endef
  75. $(eval $(call BuildPackage,cgminer))