add quotes to TARGET_CC and TARGET_CROSS to help with distcc and ccache
[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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/libusb
18 PKG_MD5SUM:=c6062b29acd2cef414bcc34e0decbdd1
19 PKG_CAT:=zcat
20
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 DESCRIPTION:=A library for accessing Linux USB devices.
30 URL:=http://libusb.sourceforge.net/
31 endef
32
33 define Build/Configure
34 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
35 $(TARGET_CONFIGURE_OPTS) \
36 CFLAGS="$(TARGET_CFLAGS)" \
37 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
38 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
39 ac_cv_c_bigendian=no \
40 ./configure \
41 --target=$(GNU_TARGET_NAME) \
42 --host=$(GNU_TARGET_NAME) \
43 --build=$(GNU_HOST_NAME) \
44 --program-prefix="" \
45 --program-suffix="" \
46 --prefix=/usr \
47 --exec-prefix=/usr \
48 --bindir=/usr/bin \
49 --datadir=/usr/share \
50 --includedir=/usr/include \
51 --infodir=/usr/share/info \
52 --libdir=/usr/lib \
53 --libexecdir=/usr/lib \
54 --localstatedir=/var \
55 --mandir=/usr/share/man \
56 --sbindir=/usr/sbin \
57 --sysconfdir=/etc \
58 $(DISABLE_NLS) \
59 $(DISABLE_LARGEFILE) \
60 --enable-shared \
61 --enable-static \
62 );
63 endef
64
65 define Build/Compile
66 rm -rf $(PKG_INSTALL_DIR)
67 mkdir -p $(PKG_INSTALL_DIR)
68 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
69 CC="$(TARGET_CC)" LD="$(TARGET_CROSS)ld" ARCH=$(ARCH) \
70 DESTDIR="$(PKG_INSTALL_DIR)" \
71 all install
72 endef
73
74 define Package/libusb/install
75 install -m0755 -d $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so.* $(1)/usr/lib/
77 endef
78
79 define Build/InstallDev
80 mkdir -p $(STAGING_DIR)/usr/bin
81 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libusb-config $(STAGING_DIR)/usr/bin/
82 mkdir -p $(STAGING_DIR)/usr/include
83 $(CP) $(PKG_INSTALL_DIR)/usr/include/usb.h $(STAGING_DIR)/usr/include/
84 mkdir -p $(STAGING_DIR)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.{a,so*} $(STAGING_DIR)/usr/lib/
86 endef
87
88 define Build/UninstallDev
89 rm -rf \
90 $(STAGING_DIR)/usr/bin/libusb-config \
91 $(STAGING_DIR)/usr/include/usb.h \
92 $(STAGING_DIR)/usr/lib/libusb*.{a,so*}
93 endef
94
95 $(eval $(call BuildPackage,libusb))