libsysfs.mk 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_VER:=1.3.0
  24. LIBSYSFS_DIR:=$(BUILD_DIR)/sysfsutils-$(LIBSYSFS_VER)
  25. LIBSYSFS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/linux-diag
  26. LIBSYSFS_SOURCE:=sysfsutils-$(LIBSYSFS_VER).tar.gz
  27. LIBSYSFS_CAT:=zcat
  28. $(DL_DIR)/$(LIBSYSFS_SOURCE):
  29. $(WGET) -P $(DL_DIR) $(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. touch $(LIBSYSFS_DIR)/.unpacked
  34. $(LIBSYSFS_DIR)/.configured: $(LIBSYSFS_DIR)/.unpacked
  35. (cd $(LIBSYSFS_DIR); \
  36. $(TARGET_CONFIGURE_OPTS) \
  37. CFLAGS="$(TARGET_CFLAGS) " \
  38. ./configure \
  39. --target=$(GNU_TARGET_NAME) \
  40. --host=$(GNU_TARGET_NAME) \
  41. --build=$(GNU_HOST_NAME) \
  42. --prefix=/ );
  43. touch $(LIBSYSFS_DIR)/.configured
  44. $(LIBSYSFS_DIR)/.compiled: $(LIBSYSFS_DIR)/.configured
  45. $(MAKE) -C $(LIBSYSFS_DIR)
  46. touch $(LIBSYSFS_DIR)/.compiled
  47. $(STAGING_DIR)/lib/libsysfs.so: $(LIBSYSFS_DIR)/.compiled
  48. $(MAKE) -C $(LIBSYSFS_DIR) DESTDIR=$(STAGING_DIR) install
  49. touch -c $(STAGING_DIR)/lib/libsysfs.so
  50. $(TARGET_DIR)/usr/lib/libsysfs.so: $(STAGING_DIR)/lib/libsysfs.so
  51. cp -dpf $(STAGING_DIR)/lib/libsysfs.so* $(TARGET_DIR)/usr/lib/
  52. -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libsysfs.so
  53. libsysfs: uclibc $(TARGET_DIR)/usr/lib/libsysfs.so
  54. libsysfs-clean:
  55. -$(MAKE) -C $(LIBSYSFS_DIR) clean
  56. libsysfs-dirclean:
  57. rm -rf $(LIBSYSFS_DIR)
  58. #############################################################
  59. #
  60. # Toplevel Makefile options
  61. #
  62. #############################################################
  63. ifeq ($(strip $(BR2_PACKAGE_LIBSYSFS)),y)
  64. TARGETS+=libsysfs
  65. endif