1 #############################################################
5 #############################################################
6 # Copyright (C) 2005 by Richard Downer <rdowner@gmail.com>
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
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
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
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
) \
56 $(DISABLE_LARGEFILE
) \
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)" \
68 $(DM_STAGING_BINARY
) $(DM_STAGING_LIBRARY
): $(DM_DIR
)/.configured
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
) $@
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
) $@
84 # Makes libdevmapper.so a symlink to libdevmapper.so.1.00
85 $(DM_TARGET_LIBRARY
): $(DM_TARGET_LIBRARY
).
$(DM_BASEVER
)
91 $(DM_TARGET_HEADER
): $(DM_TARGET_LIBRARY
)
93 $(INSTALL
) -D
-m
0644 $(STAGING_DIR
)/usr
/include/libdevmapper.h
$@
95 dm
: uclibc
$(DM_TARGET_BINARY
) $(DM_TARGET_LIBRARY
) \
96 $(if
$(BR2_HAVE_INCLUDES
),$(DM_TARGET_HEADER
))
98 dm-source
: $(DL_DIR
)/$(DM_SOURCE
)
101 -$(MAKE
) -C
$(DM_DIR
) clean
102 rm -f
$(DM_TARGET_BINARY
) $(DM_TARGET_LIBRARY
) \
103 $(DM_TARGET_LIBRARY
).
$(DM_BASEVER
) $(DM_TARGET_HEADER
)
108 #############################################################
110 # Toplevel Makefile options
112 #############################################################
113 ifeq ($(BR2_PACKAGE_DM
),y
)