ed6ad4cec8985ab6f6671f5f252a75bd7ea4f2f5
[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.12
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/libusb
17 PKG_MD5SUM:=caf182cbc7565dac0fd72155919672e6
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libusb
22 SECTION:=libs
23 CATEGORY:=Libraries
24 TITLE:=A library for accessing Linux USB devices
25 URL:=http://libusb.sourceforge.net/
26 endef
27
28 define Build/Configure
29 $(call Build/Configure/Default, \
30 --enable-shared \
31 --enable-static \
32 )
33 endef
34
35 TARGET_CFLAGS += $(FPIC)
36
37 define Build/Compile
38 $(MAKE) -C $(PKG_BUILD_DIR) \
39 DESTDIR="$(PKG_INSTALL_DIR)" \
40 all install
41 endef
42
43 define Build/InstallDev
44 mkdir -p $(1)/usr/bin
45 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libusb-config $(1)/usr/bin/
46 mkdir -p $(1)/usr/include
47 $(CP) $(PKG_INSTALL_DIR)/usr/include/usb.h $(1)/usr/include/
48 mkdir -p $(1)/usr/lib
49 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.{a,so*} $(1)/usr/lib/
50 mkdir -p $(1)/usr/lib/pkgconfig
51 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb.pc $(1)/usr/lib/pkgconfig/
52 endef
53
54 define Package/libusb/install
55 $(INSTALL_DIR) $(1)/usr/lib
56 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so.* $(1)/usr/lib/
57 endef
58
59 $(eval $(call BuildPackage,libusb))