Correct handling of sysdep files.
[glibc/history.git] / md5-crypt / Makefile
blobe948fb0491951e58c20dfc08bc7296399f197262
1 # Copyright (C) 1996, 1997 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.
22 subdir := md5-crypt
24 headers := crypt.h
26 distribute := md5.h
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)
35 libcrypt-map := libcrypt.map
37 onlymd5-routines := onlymd5-entry md5-crypt md5
38 distribute += onlymd5-entry.c
39 extra-objs = $(patsubst %,onlymd5-entry%,$(object-suffixes))
41 include ../Makeconfig
43 rpath-link := $(common-objpfx)md5-crypt:$(rpath-link)
45 ifeq ($(crypt-in-libc),yes)
46 routines += $(libcrypt-routines)
47 endif
49 $(objpfx)md5test: $(objpfx)md5.o
51 include ../Rules
53 ifeq ($(build-shared),yes)
54 libdepend = $(common-objpfx)md5-crypt/libcrypt.so$(libcrypt.so-version)
55 else
56 libdepend = $(common-objpfx)md5-crypt/libcrypt.a
57 endif
59 $(objpfx)md5test $(objpfx)md5c-test: $(libdepend)
61 .PHONY: libmd5crypt
62 libmd5crypt: $(foreach o,$(object-suffixes), \
63 $(addprefix $(objpfx),$(patsubst %,$(libtype$o),md5crypt)))
64 ifeq ($(build-shared),yes)
65 libmd5crypt: $(objpfx)libmd5crypt.so
66 # Use the same soname as the real libcrypt, so that it can be used as a
67 # drop in replacement.
68 LDFLAGS-md5crypt.so = -Wl,-soname=lib$(libprefix)crypt.so$(libcrypt.so-version)
69 # We also use the same version script.
70 libmd5crypt-map := libcrypt.map
71 endif
73 define o-iterator-doit
74 $(objpfx)$(patsubst %,$(libtype$o),md5crypt): \
75 $(onlymd5-routines:%=$(objpfx)%$o); $$(build-extra-lib)
76 endef
77 object-suffixes-left = $(object-suffixes)
78 include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes))
80 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
81 # This ensures they will load libc.so for needed symbols if loaded by
82 # a statically-linked program that hasn't already loaded it.
83 $(objpfx)libcrypt.so: $(common-objpfx)libc.so
84 $(objpfx)libmd5crypt.so: $(common-objpfx)libc.so