1 # Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Library General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
20 # Sub-makefile for MD5 crypt portion of the library.
28 tests
:= md5test md5c-test
30 extra-libs
:= libcrypt
31 extra-libs-others
:= $(extra-libs
)
33 md5-routines
:= crypt-entry md5-crypt md5
34 libcrypt-routines
:= $(md5-routines
)
36 onlymd5-routines
:= onlymd5-entry md5-crypt md5
37 distribute
+= onlymd5-entry.c
38 extra-objs
= $(patsubst %,onlymd5-entry
%,$(object-suffixes
))
42 rpath-dirs
+= md5-crypt
44 ifeq ($(crypt-in-libc
),yes
)
45 routines
+= $(libcrypt-routines
)
48 $(objpfx
)md5test
: $(objpfx
)md5.o
52 ifeq ($(build-shared
),yes
)
53 libdepend
= $(common-objpfx
)md5-crypt
/libcrypt.so
$(libcrypt.so-version
)
55 libdepend
= $(common-objpfx
)md5-crypt
/libcrypt.a
58 $(objpfx
)md5test
$(objpfx
)md5c-test
: $(libdepend
)
61 libmd5crypt
: $(foreach o
,$(object-suffixes
), \
62 $(addprefix $(objpfx
),$(patsubst %,$(libtype
$o),md5crypt
)))
63 ifeq ($(build-shared
),yes
)
64 libmd5crypt
: $(objpfx
)libmd5crypt.so
65 # Use the same soname as the real libcrypt, so that it can be used as a
66 # drop in replacement.
67 LDFLAGS-md5crypt.so
= -Wl
,-soname
=lib
$(libprefix
)crypt.so
$(libcrypt.so-version
)
68 # We also use the same version script.
69 libmd5crypt-map
:= $(common-objpfx
)libcrypt.map
72 define o-iterator-doit
73 $(objpfx
)$(patsubst %,$(libtype
$o),md5crypt
): \
74 $(onlymd5-routines
:%=$(objpfx
)%$o); $$(build-extra-lib
)
76 object-suffixes-left
= $(object-suffixes
)
77 include $(patsubst %,$(..
)o-iterator.mk
,$(object-suffixes
))
79 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
80 # This ensures they will load libc.so for needed symbols if loaded by
81 # a statically-linked program that hasn't already loaded it.
82 $(objpfx
)libcrypt.so
: $(common-objpfx
)libc.so
83 $(objpfx
)libmd5crypt.so
: $(common-objpfx
)libc.so