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
49 $(DM_DIR
)/.configured
: $(DM_DIR
)/.unpacked
50 (cd
$(DM_DIR
); rm -rf config.cache
; \
51 $(TARGET_CONFIGURE_OPTS
) \
52 $(TARGET_CONFIGURE_ARGS
) \
53 ac_cv_have_decl_malloc
=yes \
54 gl_cv_func_malloc_0_nonnull
=yes \
55 ac_cv_func_malloc_0_nonnull
=yes \
56 ac_cv_func_calloc_0_nonnull
=yes \
57 ac_cv_func_realloc_0_nonnull
=yes \
58 ac_cv_func_lstat_dereferences_slashed_symlink
=yes \
60 --target
=$(GNU_TARGET_NAME
) \
61 --host
=$(GNU_TARGET_NAME
) \
62 --build
=$(GNU_HOST_NAME
) \
68 --libexecdir
=/usr
/lib \
70 --datadir=/usr
/share \
71 --localstatedir
=/var \
72 --includedir=/usr
/include \
73 --mandir=/usr
/share
/man \
74 --infodir=/usr
/share
/info \
76 $(DISABLE_LARGEFILE
) \
77 --with-user
=$(shell id
-un
) --with-group
=$(shell id
-gn
) \
81 $(DM_DIR
)/$(DM_BINARY
): dm-build
82 $(DM_DIR
)/$(DM_LIBRARY
): dm-build
84 $(DM_STAGING_BINARY
) $(DM_STAGING_LIBRARY
): $(DM_DIR
)/.configured
85 $(MAKE
) CC
=$(TARGET_CC
) -C
$(DM_DIR
)
86 $(MAKE
) DESTDIR
=$(STAGING_DIR
) -C
$(DM_DIR
) install
88 # Install dmsetup from staging to target
89 $(DM_TARGET_BINARY
): $(DM_STAGING_BINARY
)
90 $(INSTALL
) -m
0755 $?
$@
91 -$(STRIPCMD
) $(DM_TARGET_BINARY
)
94 # Install libdevmapper.so.1.00 from staging to target
95 $(DM_TARGET_LIBRARY
).
$(DM_BASEVER
): $(DM_STAGING_LIBRARY
)
96 $(INSTALL
) -m
0644 $?
$@
100 # Makes libdevmapper.so a symlink to libdevmapper.so.1.00
101 $(DM_TARGET_LIBRARY
): $(DM_TARGET_LIBRARY
).
$(DM_BASEVER
)
106 # Install header file
107 $(DM_TARGET_HEADER
): $(DM_TARGET_LIBRARY
)
109 mkdir
-p
$(STAGING_DIR
)/usr
/include
110 $(INSTALL
) -m
0644 $(STAGING_DIR
)/usr
/include/libdevmapper.h
$@
112 dm
: uclibc
$(DM_TARGET_BINARY
) $(DM_TARGET_LIBRARY
) #$(DM_TARGET_HEADER)
114 dm-source
: $(DL_DIR
)/$(DM_SOURCE
)
117 rm $(DM_TARGET_BINARY
) $(DM_TARGET_LIBRARY
) \
118 $(DM_TARGET_LIBRARY
).
$(DM_BASEVER
) $(DM_TARGET_HEADER
)
119 -$(MAKE
) -C
$(DM_DIR
) clean
124 #############################################################
126 # Toplevel Makefile options
128 #############################################################
129 ifeq ($(BR2_PACKAGE_DM
),y
)