source: packages/net/usbip/Makefile @ 23568

Last change on this file since 23568 was 23568, checked in by acoul, 6 years ago

net/usbip: fix SDK compile issues

File size: 3.4 KB
Line 
1#
2# Copyright (C) 2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=usbip
12PKG_VERSION:=0.1.7
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=@SF/usbip
17PKG_MD5SUM:=d1094b6d4449787864f8be001639232c
18
19PKG_FIXUP:=libtool
20PKG_INSTALL:=1
21
22include $(INCLUDE_DIR)/package.mk
23
24define Package/usbip/Common
25  TITLE:=USB-over-IP
26  URL:=http://usbip.sourceforge.net/
27  DEPENDS:=@!LINUX_2_4 @USB_SUPPORT +glib2 +sysfsutils
28  MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
29endef
30
31define Package/usbip/Default
32$(call Package/usbip/Common)
33  SECTION:=net
34  CATEGORY:=Network
35endef
36
37define Package/usbip
38$(call Package/usbip/Default)
39  TITLE+= (common)
40  DEPENDS+= +glib2 +sysfsutils +libwrap +kmod-usbip
41endef
42
43define Package/usbip-client
44$(call Package/usbip/Default)
45  TITLE+= (client)
46  DEPENDS+= usbip +kmod-usbip-client
47endef
48
49define Package/usbip-server
50$(call Package/usbip/Default)
51  TITLE+= (server)
52  DEPENDS+= usbip +kmod-usbip-server
53endef
54
55define KernelPackage/usbip/Default
56$(call Package/usbip/Common)
57  SUBMENU:=USB Support
58endef
59
60define KernelPackage/usbip
61$(call KernelPackage/usbip/Default)
62  TITLE+= (kernel support)
63  KCONFIG:= USB_IP_COMMON=m
64  FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip_common_mod.$(LINUX_KMOD_SUFFIX)
65  AUTOLOAD:=$(call AutoLoad,98,usbip_common_mod)
66endef
67
68define KernelPackage/usbip-client
69$(call KernelPackage/usbip/Default)
70  SUBMENU:=USB Support
71  TITLE+= (kernel client driver)
72  DEPENDS+= kmod-usbip
73  KCONFIG:= USB_IP_VHCI_HCD=m
74  FILES:=$(LINUX_DIR)/drivers/staging/usbip/vhci-hcd.$(LINUX_KMOD_SUFFIX)
75  AUTOLOAD:=$(call AutoLoad,99,vhci-hcd)
76endef
77
78define KernelPackage/usbip-server
79$(call KernelPackage/usbip/Default)
80  SUBMENU:=USB Support
81  TITLE+= (kernel host driver)
82  DEPENDS+= kmod-usbip
83  KCONFIG:= USB_IP_HOST=m
84  FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip.$(LINUX_KMOD_SUFFIX)
85  AUTOLOAD:=$(call AutoLoad,99,usbip)
86endef
87
88include $(INCLUDE_DIR)/kernel-defaults.mk
89
90CONFIGURE_PATH:=./src
91MAKE_PATH:=./src
92LIBTOOL_PATHS:=./src
93
94CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
95
96define Build/Prepare
97$(call Build/Prepare/Default)
98        (cd $(PKG_BUILD_DIR)/src; ./autogen.sh )
99endef
100
101define Build/Compile/kmod
102        $(MAKE) $(KERNEL_MAKEOPTS) \
103                SUBDIRS="$(LINUX_DIR)/drivers/staging/usbip" \
104                CONFIG_USB_IP_COMMON=m \
105                CONFIG_USB_IP_VHCI_HCD=m \
106                CONFIG_USB_IP_HOST=m \
107                modules
108endef
109
110define Build/Compile
111$(call Build/Compile/Default)
112$(call Build/Compile/kmod)
113endef
114
115define Package/usbip/install
116        $(INSTALL_DIR) $(1)/usr/lib
117        $(CP) \
118                $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* \
119                $(1)/usr/lib/
120        $(INSTALL_DIR) $(1)/usr/share/hwdata
121        $(CP) \
122                $(PKG_INSTALL_DIR)/usr/share/usbip/usb.ids \
123                $(1)/usr/share/hwdata/
124endef
125
126define Package/usbip-client/install
127        $(INSTALL_DIR) $(1)/usr/bin
128        $(CP) \
129                $(PKG_INSTALL_DIR)/usr/bin/usbip \
130                $(1)/usr/bin/
131endef
132
133define Package/usbip-server/install
134        $(INSTALL_DIR) $(1)/usr/bin
135        $(CP) \
136                $(PKG_INSTALL_DIR)/usr/bin/usbipd \
137                $(1)/usr/bin/
138        $(CP) \
139                $(PKG_INSTALL_DIR)/usr/bin/bind_driver \
140                $(1)/usr/bin/usbip_bind_driver
141endef
142
143$(eval $(call BuildPackage,usbip))
144$(eval $(call BuildPackage,usbip-client))
145$(eval $(call BuildPackage,usbip-server))
146$(eval $(call KernelPackage,usbip))
147$(eval $(call KernelPackage,usbip-client))
148$(eval $(call KernelPackage,usbip-server))
Note: See TracBrowser for help on using the repository browser.