fix copy'n paste error
[buildroot.git] / package / dm / dm.mk
blob98fbc590a47c955dd446e4beea93305ca24ca1ec
1 #############################################################
3 # device-mapper
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>
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.
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.
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
26 DM_BASEVER=1.02
27 DM_PATCH=28
28 DM_VERSION=$(DM_BASEVER).$(DM_PATCH)
29 DM_SOURCE:=device-mapper.$(DM_VERSION).tgz
30 DM_SITE:=ftp://sources.redhat.com/pub/dm
31 DM_SITE_OLD:=ftp://sources.redhat.com/pub/dm/old
32 DM_CAT:=$(ZCAT)
33 DM_DIR:=$(BUILD_DIR)/device-mapper.$(DM_VERSION)
34 DM_STAGING_BINARY:=$(STAGING_DIR)/usr/sbin/dmsetup
35 DM_TARGET_BINARY:=$(TARGET_DIR)/usr/sbin/dmsetup
36 DM_STAGING_LIBRARY:=$(STAGING_DIR)/lib/libdevmapper.so
37 DM_TARGET_LIBRARY:=$(TARGET_DIR)/usr/lib/libdevmapper.so
38 DM_TARGET_HEADER:=$(TARGET_DIR)/usr/include/libdevmapper.h
40 $(DL_DIR)/$(DM_SOURCE):
41 $(WGET) -P $(DL_DIR) $(DM_SITE)/$(DM_SOURCE) || \
42 $(WGET) -P $(DL_DIR) $(DM_SITE_OLD)/$(DM_SOURCE)
44 $(DM_DIR)/.unpacked: $(DL_DIR)/$(DM_SOURCE)
45 $(DM_CAT) $(DL_DIR)/$(DM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
46 toolchain/patch-kernel.sh $(DM_DIR) package/dm/ \*.patch
47 $(CONFIG_UPDATE) $(@D)/autoconf
48 touch $@
49 dm-unp: $(DM_DIR)/.unpacked
50 $(DM_DIR)/.configured: $(DM_DIR)/.unpacked
51 (cd $(DM_DIR); rm -rf config.cache; \
52 $(AUTO_CONFIGURE_TARGET) \
53 --prefix=/usr \
54 --libdir=/lib \
55 $(DISABLE_NLS) \
56 $(DISABLE_LARGEFILE) \
57 $(DISABLE_SELINUX) \
58 --with-kernel-dir=$(LINUX_HEADERS_DIR) \
59 --with-kernel-version=$(LINUX_HEADERS_VERSION) \
60 --with-user=$(shell $(CONFIG_SHELL) -c 'id -un') \
61 --with-group=$(shell $(CONFIG_SHELL) -c 'id -gn') \
62 --with-optimisation="$(TARGET_CFLAGS)" \
63 --disable-debug \
64 --disable-compat \
66 touch $@
68 $(DM_STAGING_BINARY) $(DM_STAGING_LIBRARY): $(DM_DIR)/.configured
69 $(MAKE) -C $(DM_DIR)
70 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(DM_DIR) install
72 # Install dmsetup from staging to target
73 $(DM_TARGET_BINARY): $(DM_STAGING_BINARY)
74 $(INSTALL) -D -m 0755 $? $@
75 -$(STRIPCMD) $(STRIP_STRIP_ALL) $@
76 touch -c $@
78 # Install libdevmapper.so.1.00 from staging to target
79 $(DM_TARGET_LIBRARY).$(DM_BASEVER): $(DM_STAGING_LIBRARY)
80 $(INSTALL) -D -m 0644 $? $@
81 -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
82 touch -c $@
84 # Makes libdevmapper.so a symlink to libdevmapper.so.1.00
85 $(DM_TARGET_LIBRARY): $(DM_TARGET_LIBRARY).$(DM_BASEVER)
86 rm -f $@
87 ln -s $(<F) $@
88 touch -c $@
90 # Install header file
91 $(DM_TARGET_HEADER): $(DM_TARGET_LIBRARY)
92 rm -f $@
93 $(INSTALL) -D -m 0644 $(STAGING_DIR)/usr/include/libdevmapper.h $@
95 dm: $(DM_TARGET_BINARY) $(DM_TARGET_LIBRARY) \
96 $(if $(BR2_HAVE_INCLUDES),$(DM_TARGET_HEADER))
98 dm-source: $(DL_DIR)/$(DM_SOURCE)
100 dm-clean:
101 -$(MAKE) -C $(DM_DIR) clean
102 rm -f $(DM_TARGET_BINARY) $(DM_TARGET_LIBRARY) \
103 $(DM_TARGET_LIBRARY).$(DM_BASEVER) $(DM_TARGET_HEADER)
105 dm-dirclean:
106 rm -rf $(DM_DIR)
108 #############################################################
110 # Toplevel Makefile options
112 #############################################################
113 ifeq ($(BR2_PACKAGE_DM),y)
114 TARGETS+=dm
115 endif