libsysfs.mk 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #############################################################
  2. #
  3. # libsysfs
  4. #
  5. #############################################################
  6. # Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
  7. # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Library General Public License as
  11. # published by the Free Software Foundation; either version 2 of the
  12. # License, or (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. # Library General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Library General Public
  20. # License along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  22. # USA
  23. LIBSYSFS_VERSION:=2.1.0
  24. LIBSYSFS_DIR:=$(BUILD_DIR)/sysfsutils-$(LIBSYSFS_VERSION)
  25. LIBSYSFS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/linux-diag
  26. LIBSYSFS_SOURCE:=sysfsutils-$(LIBSYSFS_VERSION).tar.gz
  27. LIBSYSFS_CAT:=$(ZCAT)
  28. $(DL_DIR)/$(LIBSYSFS_SOURCE):
  29. $(call DOWNLOAD,$(LIBSYSFS_SITE),$(LIBSYSFS_SOURCE))
  30. libsysfs-source: $(DL_DIR)/$(LIBSYSFS_SOURCE)
  31. $(LIBSYSFS_DIR)/.unpacked: $(DL_DIR)/$(LIBSYSFS_SOURCE)
  32. $(LIBSYSFS_CAT) $(DL_DIR)/$(LIBSYSFS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  33. $(CONFIG_UPDATE) $(@D)
  34. touch $@
  35. $(LIBSYSFS_DIR)/.configured: $(LIBSYSFS_DIR)/.unpacked
  36. (cd $(LIBSYSFS_DIR); rm -rf config.cache; \
  37. $(TARGET_CONFIGURE_OPTS) \
  38. $(TARGET_CONFIGURE_ARGS) \
  39. ./configure \
  40. --target=$(GNU_TARGET_NAME) \
  41. --host=$(GNU_TARGET_NAME) \
  42. --build=$(GNU_HOST_NAME) \
  43. --prefix=/usr \
  44. --sysconfdir=/etc \
  45. )
  46. touch $@
  47. $(LIBSYSFS_DIR)/.compiled: $(LIBSYSFS_DIR)/.configured
  48. $(MAKE) -C $(LIBSYSFS_DIR)
  49. touch $@
  50. $(STAGING_DIR)/usr/lib/libsysfs.so: $(LIBSYSFS_DIR)/.compiled
  51. $(MAKE) -C $(LIBSYSFS_DIR) DESTDIR=$(STAGING_DIR) install
  52. $(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" \
  53. $(STAGING_DIR)/usr/lib/libsysfs.la
  54. touch -c $@
  55. $(TARGET_DIR)/usr/lib/libsysfs.so: $(STAGING_DIR)/usr/lib/libsysfs.so
  56. cp -dpf $(STAGING_DIR)/usr/lib/libsysfs.so* $(TARGET_DIR)/usr/lib/
  57. -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libsysfs.so
  58. libsysfs: uclibc $(TARGET_DIR)/usr/lib/libsysfs.so
  59. libsysfs-clean:
  60. -$(MAKE) -C $(LIBSYSFS_DIR) clean
  61. -$(MAKE) -C $(LIBSYSFS_DIR) DESTDIR=$(STAGING_DIR) uninstall
  62. rm -f $(TARGET_DIR)/usr/lib/libsysfs.so*
  63. libsysfs-dirclean:
  64. rm -rf $(LIBSYSFS_DIR)
  65. #############################################################
  66. #
  67. # Toplevel Makefile options
  68. #
  69. #############################################################
  70. ifeq ($(BR2_PACKAGE_LIBSYSFS),y)
  71. TARGETS+=libsysfs
  72. endif