lvm2.mk 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #############################################################
  2. #
  3. # lvm2
  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. LVM2_BASEVER=2.02
  26. LVM2_PATCH=28
  27. LVM2_VERSION=$(LVM2_BASEVER).$(LVM2_PATCH)
  28. LVM2_SOURCE:=LVM2.$(LVM2_VERSION).tgz
  29. LVM2_SITE:=ftp://sources.redhat.com/pub/lvm2
  30. LVM2_CAT:=$(ZCAT)
  31. LVM2_DIR:=$(BUILD_DIR)/LVM2.$(LVM2_VERSION)
  32. LVM2_SBIN:=lvchange lvcreate lvdisplay lvextend lvm lvmchange lvmdiskscan lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit
  33. LVM2_TARGET_SBINS=$(foreach lvm2sbin, $(LVM2_SBIN), $(TARGET_DIR)/sbin/$(lvm2sbin))
  34. $(DL_DIR)/$(LVM2_SOURCE):
  35. $(WGET) -P $(DL_DIR) $(LVM2_SITE)/$(LVM2_SOURCE)
  36. lvm2-source: $(DL_DIR)/$(LVM2_SOURCE)
  37. $(LVM2_DIR)/.unpacked: $(DL_DIR)/$(LVM2_SOURCE)
  38. $(LVM2_CAT) $(DL_DIR)/$(LVM2_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  39. touch $(LVM2_DIR)/.unpacked
  40. $(LVM2_DIR)/.configured: $(LVM2_DIR)/.unpacked
  41. (cd $(LVM2_DIR); rm -rf config.cache; \
  42. $(TARGET_CONFIGURE_OPTS) \
  43. $(TARGET_CONFIGURE_ARGS) \
  44. ac_cv_have_decl_malloc=yes \
  45. gl_cv_func_malloc_0_nonnull=yes \
  46. ac_cv_func_malloc_0_nonnull=yes \
  47. ac_cv_func_calloc_0_nonnull=yes \
  48. ac_cv_func_realloc_0_nonnull=yes \
  49. ./configure \
  50. --target=$(GNU_TARGET_NAME) \
  51. --host=$(GNU_TARGET_NAME) \
  52. --build=$(GNU_HOST_NAME) \
  53. $(DISABLE_NLS) \
  54. $(DISABLE_LARGEFILE) \
  55. --with-user=$(shell id -un) --with-group=$(shell id -gn) \
  56. )
  57. touch $(LVM2_DIR)/.configured
  58. $(LVM2_TARGET_SBINS): $(LVM2_DIR)/.configured
  59. $(MAKE) CC=$(TARGET_CC) -C $(LVM2_DIR) DESTDIR=$(STAGING_DIR)
  60. $(MAKE) CC=$(TARGET_CC) -C $(LVM2_DIR) DESTDIR=$(STAGING_DIR) install
  61. for binary in $(LVM2_SBIN); do echo $$binary; cp -a $(STAGING_DIR)/sbin/$$binary $(TARGET_DIR)/sbin; done
  62. lvm2: uclibc dm $(LVM2_TARGET_SBINS)
  63. lvm2-clean:
  64. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(LVM2_DIR) uninstall
  65. -$(MAKE) -C $(LVM2_DIR) clean
  66. lvm2-dirclean:
  67. rm -rf $(LVM2_DIR)
  68. #############################################################
  69. #
  70. # Toplevel Makefile options
  71. #
  72. #############################################################
  73. ifeq ($(strip $(BR2_PACKAGE_LVM2)),y)
  74. TARGETS+=lvm2
  75. endif