pass HOST_ variables, not BUILD_
[buildroot.git] / package / libsysfs / libsysfs.mk
blobe6eda62a0b32a912dc0358943a1f3811666cc45b
1 #############################################################
3 # libsysfs
5 #############################################################
6 # Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
7 # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
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.
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.
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
24 LIBSYSFS_VERSION:=2.1.0
25 LIBSYSFS_DIR:=$(BUILD_DIR)/sysfsutils-$(LIBSYSFS_VERSION)
26 LIBSYSFS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/linux-diag
27 LIBSYSFS_SOURCE:=sysfsutils-$(LIBSYSFS_VERSION).tar.gz
28 LIBSYSFS_CAT:=$(ZCAT)
30 $(DL_DIR)/$(LIBSYSFS_SOURCE):
31 $(WGET) -P $(DL_DIR) $(LIBSYSFS_SITE)/$(LIBSYSFS_SOURCE)
33 libsysfs-source: $(DL_DIR)/$(LIBSYSFS_SOURCE)
35 $(LIBSYSFS_DIR)/.unpacked: $(DL_DIR)/$(LIBSYSFS_SOURCE)
36 $(LIBSYSFS_CAT) $(DL_DIR)/$(LIBSYSFS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
37 toolchain/patch-kernel.sh $(LIBSYSFS_DIR) package/libsysfs/ \*.patch
38 $(CONFIG_UPDATE) $(@D)
39 # hmz
40 touch -c $(LIBSYSFS_DIR)/config.h.in
41 touch $@
43 $(LIBSYSFS_DIR)/.configured: $(LIBSYSFS_DIR)/.unpacked
44 (cd $(LIBSYSFS_DIR); rm -rf config.cache; \
45 $(AUTO_CONFIGURE_TARGET) \
46 --prefix=/usr \
47 --sysconfdir=/etc \
49 touch $@
51 $(LIBSYSFS_DIR)/.compiled: $(LIBSYSFS_DIR)/.configured
52 $(MAKE) -C $(LIBSYSFS_DIR)
53 touch $@
55 $(STAGING_DIR)/usr/lib/libsysfs.so: $(LIBSYSFS_DIR)/.compiled
56 $(MAKE) -C $(LIBSYSFS_DIR) DESTDIR=$(STAGING_DIR) install
57 $(SED) "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" \
58 $(STAGING_DIR)/usr/lib/libsysfs.la
59 touch -c $@
61 $(TARGET_DIR)/usr/lib/libsysfs.so: $(STAGING_DIR)/usr/lib/libsysfs.so
62 $(INSTALL) -d $(TARGET_DIR)/usr/lib/
63 $(INSTALL) -m 0755 $(STAGING_DIR)/usr/lib/libsysfs.so* $(TARGET_DIR)/usr/lib/
64 -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libsysfs.so
66 libsysfs: $(TARGET_DIR)/usr/lib/libsysfs.so
68 libsysfs-clean:
69 -$(MAKE) -C $(LIBSYSFS_DIR) clean
70 -$(MAKE) -C $(LIBSYSFS_DIR) DESTDIR=$(STAGING_DIR) uninstall
71 rm -f $(TARGET_DIR)/usr/lib/libsysfs.so*
73 libsysfs-dirclean:
74 rm -rf $(LIBSYSFS_DIR)
76 #############################################################
78 # Toplevel Makefile options
80 #############################################################
81 ifeq ($(BR2_PACKAGE_LIBSYSFS),y)
82 TARGETS+=libsysfs
83 endif