add libusb and lsusb (usbutils)
[openwrt.git] / package / libusb / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=libusb
6 PKG_VERSION:=0.1.10a
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=c6062b29acd2cef414bcc34e0decbdd1
9
10 PKG_SOURCE_URL:=@SF/libusb
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15
16 PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)
18 PKG_INFO:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
19
20 $(DL_DIR)/$(PKG_SOURCE):
21 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
22
23 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
24 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
25 $(PATCH) $(PKG_BUILD_DIR) ./patches
26 touch $(PKG_BUILD_DIR)/.prepared
27
28 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
29 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
30 $(TARGET_CONFIGURE_OPTS) \
31 CFLAGS="$(TARGET_CFLAGS)" \
32 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
33 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
34 ac_cv_c_bigendian=no \
35 ./configure \
36 --target=$(GNU_TARGET_NAME) \
37 --host=$(GNU_TARGET_NAME) \
38 --build=$(GNU_HOST_NAME) \
39 --program-prefix="" \
40 --program-suffix="" \
41 --prefix=/usr \
42 --exec-prefix=/usr \
43 --bindir=/usr/bin \
44 --datadir=/usr/share \
45 --includedir=/usr/include \
46 --infodir=/usr/share/info \
47 --libdir=/usr/lib \
48 --libexecdir=/usr/lib \
49 --localstatedir=/var \
50 --mandir=/usr/share/man \
51 --sbindir=/usr/sbin \
52 --sysconfdir=/etc \
53 $(DISABLE_NLS) \
54 $(DISABLE_LARGEFILE) \
55 --enable-shared \
56 --enable-static \
57 );
58 touch $(PKG_BUILD_DIR)/.configured
59
60 $(PKG_BUILD_DIR)/.libs/libusb.so: $(PKG_BUILD_DIR)/.configured
61 $(MAKE) -C $(PKG_BUILD_DIR) -j1 \
62 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld ARCH=$(ARCH) \
63
64 $(STAGING_DIR)/usr/lib/libusb.so: $(PKG_BUILD_DIR)/.libs/libusb.so
65 mkdir -p $(STAGING_DIR)/usr/lib
66 mkdir -p $(STAGING_DIR)/usr/include
67 cp -a $(PKG_BUILD_DIR)/.libs/*.so* $(STAGING_DIR)/usr/lib/
68 cp -a $(PKG_BUILD_DIR)/usb.h $(STAGING_DIR)/usr/include/
69
70 $(PKG_IPK): $(STAGING_DIR)/usr/lib/libusb.so
71 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
72 mkdir -p $(PKG_IPK_DIR)/usr/lib
73 cp -a $(PKG_BUILD_DIR)/.libs/libusb*.so* $(PKG_IPK_DIR)/usr/lib/
74 $(STRIP) $(PKG_IPK_DIR)/usr/lib/*
75 mkdir -p $(PACKAGE_DIR)
76 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
77
78 $(PKG_INFO): $(PKG_IPK)
79 $(IPKG) install $(PKG_IPK)
80
81 source: $(DL_DIR)/$(PKG_SOURCE)
82 prepare: $(PKG_BUILD_DIR)/.prepared
83 compile: $(PKG_IPK) $(STAGING_DIR)/usr/lib/libusb.so
84 install: $(PKG_INFO)
85
86 clean:
87 rm -f $(STAGING_DIR)/usr/lib/libusb*
88 rm -f $(STAGING_DIR)/usr/include/usb.h
89 rm -rf $(PKG_BUILD_DIR) $(PKG_IPK)
This page took 0.047858 seconds and 5 git commands to generate.