replace lots of manual install commands with INSTALL_* variables
[openwrt/svn-archive/archive.git] / libs / libusb / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libusb
12 PKG_VERSION:=0.1.10a
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/libusb
17 PKG_MD5SUM:=c6062b29acd2cef414bcc34e0decbdd1
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libusb
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=A library for accessing Linux USB devices
29 URL:=http://libusb.sourceforge.net/
30 endef
31
32 define Build/Configure
33 $(call Build/Configure/Default, \
34 --enable-shared \
35 --enable-static \
36 )
37 endef
38
39 define Build/Compile
40 $(MAKE) -C $(PKG_BUILD_DIR) \
41 DESTDIR="$(PKG_INSTALL_DIR)" \
42 all install
43 endef
44
45 define Build/InstallDev
46 mkdir -p $(STAGING_DIR)/usr/bin
47 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libusb-config $(STAGING_DIR)/usr/bin/
48 mkdir -p $(STAGING_DIR)/usr/include
49 $(CP) $(PKG_INSTALL_DIR)/usr/include/usb.h $(STAGING_DIR)/usr/include/
50 mkdir -p $(STAGING_DIR)/usr/lib
51 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.{a,so*} $(STAGING_DIR)/usr/lib/
52 endef
53
54 define Build/UninstallDev
55 rm -rf \
56 $(STAGING_DIR)/usr/bin/libusb-config \
57 $(STAGING_DIR)/usr/include/usb.h \
58 $(STAGING_DIR)/usr/lib/libusb*.{a,so*}
59 endef
60
61 define Package/libusb/install
62 $(INSTALL_DIR) $(1)/usr/lib
63 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so.* $(1)/usr/lib/
64 endef
65
66 $(eval $(call BuildPackage,libusb))