dm.mk 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #############################################################
  2. #
  3. # dm
  4. #
  5. #############################################################
  6. # Copyright (C) 2005 by Richard Downer <rdowner@gmail.com>
  7. # Derived from work
  8. # Copyright (C) 2001-2005 by Erik Andersen <andersen@codepoet.org>
  9. # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU Library General Public License as
  13. # published by the Free Software Foundation; either version 2 of the
  14. # License, or (at your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. # Library General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU Library General Public
  22. # License along with this program; if not, write to the Free Software
  23. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  24. # USA
  25. DM_BASEVER=1.00
  26. DM_PATCH=21
  27. DM_VERSION=$(DM_BASEVER).$(DM_PATCH)
  28. DM_SOURCE:=device-mapper.$(DM_VERSION).tgz
  29. DM_SITE:=ftp://sources.redhat.com/pub/dm
  30. DM_CAT:=zcat
  31. DM_DIR:=$(BUILD_DIR)/device-mapper.$(DM_VERSION)
  32. DM_STAGING_BINARY:=$(STAGING_DIR)/sbin/dmsetup
  33. DM_TARGET_BINARY:=$(TARGET_DIR)/usr/sbin/dmsetup
  34. DM_STAGING_LIBRARY:=$(STAGING_DIR)/lib/libdevmapper.so
  35. DM_TARGET_LIBRARY:=$(TARGET_DIR)/usr/lib/libdevmapper.so
  36. $(DL_DIR)/$(DM_SOURCE):
  37. $(WGET) -P $(DL_DIR) $(DM_SITE)/$(DM_SOURCE)
  38. $(DM_DIR)/.unpacked: $(DL_DIR)/$(DM_SOURCE)
  39. $(DM_CAT) $(DL_DIR)/$(DM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  40. touch $(DM_DIR)/.unpacked
  41. $(DM_DIR)/.configured: $(DM_DIR)/.unpacked
  42. (cd $(DM_DIR); rm -rf config.cache; \
  43. $(TARGET_CONFIGURE_OPTS) \
  44. CFLAGS="$(TARGET_CFLAGS)" \
  45. ./configure \
  46. --target=$(GNU_TARGET_NAME) \
  47. --host=$(GNU_TARGET_NAME) \
  48. --build=$(GNU_HOST_NAME) \
  49. --prefix=/usr \
  50. $(DISABLE_NLS) \
  51. $(DISABLE_LARGEFILE) \
  52. --with-kernel-dir=/work/richard/xen/linux-2.6.10-xen0 \
  53. --with-user=$(shell id -un) --with-group=$(shell id -gn) \
  54. );
  55. touch $(DM_DIR)/.configured
  56. $(DM_DIR)/$(DM_BINARY): dm-build
  57. $(DM_DIR)/$(DM_LIBRARY): dm-build
  58. $(DM_STAGING_BINARY) $(DM_STAGING_LIBRARY): $(DM_DIR)/.configured
  59. $(MAKE) CC=$(TARGET_CC) -C $(DM_DIR)
  60. $(MAKE) -C $(DM_DIR) install prefix=$(STAGING_DIR)
  61. # Install dmsetup from staging to target
  62. $(DM_TARGET_BINARY): $(DM_STAGING_BINARY)
  63. $(INSTALL) -m 0755 $? $@
  64. # Install libdevmapper.so.1.00 from staging to target
  65. $(DM_TARGET_LIBRARY).$(DM_BASEVER): $(DM_STAGING_LIBRARY)
  66. $(INSTALL) -m 0644 $? $@
  67. # Makes libdevmapper.so a symlink to libdevmapper.so.1.00
  68. $(DM_TARGET_LIBRARY): $(DM_TARGET_LIBRARY).$(DM_BASEVER)
  69. rm $@
  70. ln -s $(<F) $@
  71. dm: uclibc $(DM_TARGET_BINARY) $(DM_TARGET_LIBRARY)
  72. dm-clean:
  73. rm $(DM_TARGET_BINARY) $(DM_TARGET_LIBRARY) $(DM_TARGET_LIBRARY).$(DM_BASEVER)
  74. $(MAKE) -C $(DM_DIR) clean
  75. dm-dirclean:
  76. rm -rf $(DM_DIR)
  77. #############################################################
  78. #
  79. # Toplevel Makefile options
  80. #
  81. #############################################################
  82. ifeq ($(strip $(BR2_PACKAGE_DM)),y)
  83. TARGETS+=dm
  84. endif