2005-12-13 06:00:18 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# libusb
|
|
|
|
#
|
|
|
|
#############################################################
|
2007-07-11 16:06:06 +02:00
|
|
|
LIBUSB_VERSION:=0.1.12
|
2008-12-05 11:22:52 +01:00
|
|
|
LIBUSB_PATCH_FILE:=libusb_$(LIBUSB_VERSION)-10.diff.gz
|
2007-08-21 20:30:54 +02:00
|
|
|
LIBUSB_SOURCE:=libusb_$(LIBUSB_VERSION).orig.tar.gz
|
2008-12-05 11:22:52 +01:00
|
|
|
LIBUSB_SITE:=http://snapshot.debian.net/archive/2008/04/27/debian/pool/main/libu/libusb
|
2007-07-11 16:06:06 +02:00
|
|
|
LIBUSB_DIR:=$(BUILD_DIR)/libusb-$(LIBUSB_VERSION)
|
2006-10-01 17:17:52 +02:00
|
|
|
LIBUSB_CAT:=$(ZCAT)
|
2007-05-07 06:00:11 +02:00
|
|
|
LIBUSB_BINARY:=usr/lib/libusb.so
|
2005-12-13 06:00:18 +01:00
|
|
|
|
2007-08-21 20:30:54 +02:00
|
|
|
ifneq ($(LIBUSB_PATCH_FILE),)
|
|
|
|
LIBUSB_PATCH=$(DL_DIR)/$(LIBUSB_PATCH_FILE)
|
|
|
|
$(LIBUSB_PATCH):
|
2009-01-16 12:42:52 +01:00
|
|
|
$(call DOWNLOAD,$(LIBUSB_SITE),$(LIBUSB_PATCH_FILE))
|
2007-08-21 20:30:54 +02:00
|
|
|
endif
|
|
|
|
$(DL_DIR)/$(LIBUSB_SOURCE): $(LIBUSB_PATCH)
|
2009-01-16 12:42:52 +01:00
|
|
|
$(call DOWNLOAD,$(LIBUSB_SITE),$(LIBUSB_SOURCE))
|
2007-08-31 14:04:00 +02:00
|
|
|
touch -c $@
|
2005-12-13 06:00:18 +01:00
|
|
|
|
2007-08-21 20:30:54 +02:00
|
|
|
libusb-source: $(DL_DIR)/$(LIBUSB_SOURCE) $(LIBUSB_PATCH)
|
2007-01-03 14:44:01 +01:00
|
|
|
|
2008-05-28 04:12:52 +02:00
|
|
|
libusb-unpacked: $(LIBUSB_DIR)/.unpacked
|
2009-12-20 22:22:46 +01:00
|
|
|
$(LIBUSB_DIR)/.unpacked: $(DL_DIR)/$(LIBUSB_SOURCE)
|
2005-12-13 06:00:18 +01:00
|
|
|
$(LIBUSB_CAT) $(DL_DIR)/$(LIBUSB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2007-08-21 20:30:54 +02:00
|
|
|
ifneq ($(LIBUSB_PATCH_FILE),)
|
|
|
|
(cd $(LIBUSB_DIR) && $(LIBUSB_CAT) $(LIBUSB_PATCH) | patch -p1)
|
|
|
|
endif
|
2007-09-25 14:54:48 +02:00
|
|
|
toolchain/patch-kernel.sh $(LIBUSB_DIR) package/libusb/ libusb-$(LIBUSB_VERSION)\*.patch*
|
|
|
|
$(SED) 's,^all:.*,all:,g' $(LIBUSB_DIR)/tests/Makefile.in
|
|
|
|
$(SED) 's,^install:.*,install:,g' $(LIBUSB_DIR)/tests/Makefile.in
|
2007-11-09 10:30:08 +01:00
|
|
|
$(CONFIG_UPDATE) $(LIBUSB_DIR)
|
|
|
|
cd $(LIBUSB_DIR) && $(AUTORECONF)
|
2007-08-21 20:30:54 +02:00
|
|
|
touch $@
|
2005-12-13 06:00:18 +01:00
|
|
|
|
|
|
|
$(LIBUSB_DIR)/.configured: $(LIBUSB_DIR)/.unpacked
|
|
|
|
(cd $(LIBUSB_DIR); rm -rf config.cache; \
|
2007-01-14 04:52:21 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2005-12-13 06:00:18 +01:00
|
|
|
ac_cv_header_regex_h=no \
|
2009-10-01 21:24:42 +02:00
|
|
|
./configure $(QUIET) \
|
2005-12-13 06:00:18 +01:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
2008-03-27 14:00:31 +01:00
|
|
|
--prefix=$(STAGING_DIR)/usr \
|
2005-12-13 06:00:18 +01:00
|
|
|
--disable-debug \
|
|
|
|
--disable-build-docs \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2007-08-21 20:30:54 +02:00
|
|
|
touch $@
|
2005-12-13 06:00:18 +01:00
|
|
|
|
2008-03-27 14:00:31 +01:00
|
|
|
$(STAGING_DIR)/usr/lib/libusb.so: $(LIBUSB_DIR)/.configured
|
2007-08-21 20:30:54 +02:00
|
|
|
$(MAKE) -C $(LIBUSB_DIR)
|
2008-03-27 14:00:31 +01:00
|
|
|
$(MAKE) -C $(LIBUSB_DIR) install
|
2005-12-13 06:00:18 +01:00
|
|
|
|
2008-03-27 14:00:31 +01:00
|
|
|
$(TARGET_DIR)/$(LIBUSB_BINARY): $(STAGING_DIR)/usr/lib/libusb.so
|
2008-02-15 15:06:39 +01:00
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/libusb*.so* $(TARGET_DIR)/usr/lib/
|
2007-10-01 18:15:31 +02:00
|
|
|
$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libusb*.so*
|
2005-12-13 06:00:18 +01:00
|
|
|
|
2009-12-20 22:22:46 +01:00
|
|
|
libusb: host-pkg-config host-autoconf host-automake host-libtool $(TARGET_DIR)/$(LIBUSB_BINARY)
|
2005-12-13 06:00:18 +01:00
|
|
|
|
|
|
|
libusb-clean:
|
2007-05-07 06:00:11 +02:00
|
|
|
rm -f $(STAGING_DIR)/bin/libusb-config
|
2007-08-12 00:26:56 +02:00
|
|
|
rm -f $(STAGING_DIR)/usr/includes/usb*.h
|
2007-05-07 06:00:11 +02:00
|
|
|
rm -f $(STAGING_DIR)/lib/libusb*
|
|
|
|
rm -rf $(STAGING_DIR)/lib/pkgconfig
|
|
|
|
rm -f $(TARGET_DIR)/usr/lib/libusb*
|
2005-12-13 06:00:18 +01:00
|
|
|
-$(MAKE) -C $(LIBUSB_DIR) clean
|
|
|
|
|
|
|
|
libusb-dirclean:
|
|
|
|
rm -rf $(LIBUSB_DIR)
|
2007-07-16 11:45:39 +02:00
|
|
|
|
2005-12-13 06:00:18 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:27 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBUSB),y)
|
2005-12-13 06:00:18 +01:00
|
|
|
TARGETS+=libusb
|
|
|
|
endif
|