Makefile (1401B)
1 # 2 # Copyright (C) 2015 OpenWrt.org 3 # 4 # This is free software, licensed under the GNU General Public License v2. 5 # See /LICENSE for more information. 6 # 7 8 include $(TOPDIR)/rules.mk 9 10 PKG_NAME:=hub-ctrl 11 PKG_VERSION:=1.0 12 PKG_RELEASE:=1 13 14 PKG_SOURCE_PROTO:=git 15 PKG_SOURCE_URL:=https://github.com/codazoda/hub-ctrl.c.git 16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 17 PKG_SOURCE_VERSION:=3eef0240fac90067d081551e9f73dfa741d94a9e 18 PKG_LICENSE:=GPL-2.0+ 19 20 PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org> 21 22 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 23 PKG_BUILD_PARALLEL:=1 24 25 include $(INCLUDE_DIR)/package.mk 26 27 define Package/hub-ctrl 28 SECTION:=utils 29 CATEGORY:=Utilities 30 TITLE:=Control USB power on a port by port basis 31 URL:=https://github.com/codazoda/hub-ctrl.c 32 DEPENDS:=+libusb-compat 33 endef 34 35 define Package/hub-ctrl/description 36 Control USB power on a port by port basis on some USB hubs. 37 This only works on USB hubs that have the hardware necessary 38 to allow software controlled power switching. 39 Most hubs DO NOT include the hardware. 40 endef 41 42 define Build/Compile 43 $(TARGET_CC) $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include \ 44 -L$(STAGING_DIR)/usr/lib -lusb \ 45 -o $(PKG_BUILD_DIR)/hub-ctrl $(PKG_BUILD_DIR)/hub-ctrl.c 46 endef 47 48 define Package/hub-ctrl/install 49 $(INSTALL_DIR) $(1)/usr/sbin 50 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hub-ctrl $(1)/usr/sbin/ 51 endef 52 53 $(eval $(call BuildPackage,hub-ctrl))