2 # Copyright (C) 2010-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/kernel.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@SF
/usbip
17 PKG_MD5SUM
:=d1094b6d4449787864f8be001639232c
19 PKG_BUILD_DEPENDS
:=glib2 sysfsutils
20 PKG_FIXUP
:=libtool autoreconf
23 include $(INCLUDE_DIR
)/package.mk
24 include $(INCLUDE_DIR
)/nls.mk
26 define Package
/usbip
/Common
28 URL
:=http
://usbip.sourceforge.net
/
30 MAINTAINER
:=Nuno Goncalves
<nunojpg@gmail.com
>
33 define Package
/usbip
/Default
34 $(call Package
/usbip
/Common
)
40 $(call Package
/usbip
/Default
)
42 DEPENDS
+= +libsysfs
+libwrap
+kmod-usbip
45 define Package
/usbip-client
46 $(call Package
/usbip
/Default
)
48 DEPENDS
+= usbip
+glib2
+kmod-usbip-client
51 define Package
/usbip-server
52 $(call Package
/usbip
/Default
)
54 DEPENDS
+= usbip
+glib2
+kmod-usbip-server
57 define KernelPackage
/usbip
/Default
58 $(call Package
/usbip
/Common
)
62 define KernelPackage
/usbip
63 $(call KernelPackage
/usbip
/Default
)
64 TITLE
+= (kernel support
)
65 DEPENDS
+= +kmod-usb-core
67 CONFIG_USB_IP_COMMON CONFIG_USB_IP_DEBUG_ENABLE
=n \
68 CONFIG_USBIP_CORE CONFIG_USBIP_DEBUG
=n
69 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.39)),1)
70 FILES
:=$(LINUX_DIR
)/drivers
/staging
/usbip
/usbip_common_mod.
$(LINUX_KMOD_SUFFIX
)
71 AUTOLOAD
:=$(call AutoLoad
,98,usbip_common_mod
)
73 FILES
:=$(LINUX_DIR
)/drivers
/staging
/usbip
/usbip-core.ko
74 AUTOLOAD
:=$(call AutoLoad
,98,usbip-core
)
78 define KernelPackage
/usbip-client
79 $(call KernelPackage
/usbip
/Default
)
80 TITLE
+= (kernel client driver
)
82 KCONFIG
:= CONFIG_USB_IP_VHCI_HCD CONFIG_USBIP_VHCI_HCD
83 FILES
:=$(LINUX_DIR
)/drivers
/staging
/usbip
/vhci-hcd.
$(LINUX_KMOD_SUFFIX
)
84 AUTOLOAD
:=$(call AutoLoad
,99,vhci-hcd
)
87 define KernelPackage
/usbip-server
88 $(call KernelPackage
/usbip
/Default
)
89 TITLE
+= (kernel host driver
)
91 KCONFIG
:= CONFIG_USB_IP_HOST CONFIG_USBIP_HOST
92 ifeq ($(strip $(call CompareKernelPatchVer
,$(KERNEL_PATCHVER
),le
,2.6.39)),1)
93 FILES
:=$(LINUX_DIR
)/drivers
/staging
/usbip
/usbip.
$(LINUX_KMOD_SUFFIX
)
94 AUTOLOAD
:=$(call AutoLoad
,99,usbip
)
96 FILES
:=$(LINUX_DIR
)/drivers
/staging
/usbip
/usbip-host.ko
97 AUTOLOAD
:=$(call AutoLoad
,99,usbip-host
)
101 include $(INCLUDE_DIR
)/kernel-defaults.mk
103 CONFIGURE_PATH
:=.
/src
107 CFLAGS
+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
109 define Build
/Compile
/kmod
110 $(MAKE
) $(KERNEL_MAKEOPTS
) \
111 SUBDIRS
="$(LINUX_DIR)/drivers/staging/usbip" \
112 CONFIG_USB_IP_COMMON
=m \
113 CONFIG_USB_IP_VHCI_HCD
=m \
114 CONFIG_USB_IP_HOST
=m \
115 CONFIG_USBIP_CORE
=m \
116 CONFIG_USBIP_VHCI_HCD
=m \
117 CONFIG_USBIP_HOST
=m \
122 $(call Build
/Compile
/Default
)
123 $(call Build
/Compile
/kmod
)
126 define Package
/usbip
/install
127 $(INSTALL_DIR
) $(1)/usr
/lib
129 $(PKG_INSTALL_DIR
)/usr
/lib
/libusbip.so.
* \
131 $(INSTALL_DIR
) $(1)/usr
/share
/usbip
133 $(PKG_INSTALL_DIR
)/usr
/share
/usbip
/usb.ids \
134 $(1)/usr
/share
/usbip
/
137 define Package
/usbip-client
/install
138 $(INSTALL_DIR
) $(1)/usr
/bin
140 $(PKG_INSTALL_DIR
)/usr
/bin
/usbip \
144 define Package
/usbip-server
/install
145 $(INSTALL_DIR
) $(1)/usr
/bin
147 $(PKG_INSTALL_DIR
)/usr
/bin
/usbipd \
150 $(PKG_INSTALL_DIR
)/usr
/bin
/bind_driver \
151 $(1)/usr
/bin
/usbip_bind_driver
154 $(eval
$(call BuildPackage
,usbip
))
155 $(eval
$(call BuildPackage
,usbip-client
))
156 $(eval
$(call BuildPackage
,usbip-server
))
157 $(eval
$(call KernelPackage
,usbip
))
158 $(eval
$(call KernelPackage
,usbip-client
))
159 $(eval
$(call KernelPackage
,usbip-server
))