Obsolete RPC implementation in libc.
[platform/upstream/glibc.git] / nss / Makefile
1 # Copyright (C) 1996-1998,2000-2002,2007,2009,2010,2011
2 # Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
4
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, write to the Free
17 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 # 02111-1307 USA.
19
20 #
21 #       Makefile for name service switch.
22 #
23 subdir  := nss
24
25 headers                 := nss.h
26 distribute              := nsswitch.h XXX-lookup.c getXXbyYY.c getXXbyYY_r.c \
27                            getXXent.c getXXent_r.c databases.def \
28                            nsswitch.conf digits_dots.c function.def
29
30 # This is the trivial part which goes into libc itself.
31 routines                = nsswitch getnssent getnssent_r digits_dots \
32                           $(addsuffix -lookup,$(databases))
33
34 # These are the databases that go through nss dispatch.
35 # Caution: if you add a database here, you must add its real name
36 # in databases.def, too.
37 databases               = proto service hosts network grp pwd rpc ethers \
38                           spwd netgrp key alias sgrp
39
40 others                  := getent
41 install-bin             := getent
42
43 tests                   = test-netdb tst-nss-test1
44 xtests                  = bug-erange
45
46 include ../Makeconfig
47
48 ifeq (yes,$(build-static-nss))
49 otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
50              $(resolvobjdir)/libresolv.a
51 endif
52
53 # Specify rules for the nss_* modules.  We have some services.
54 services                := files
55
56 extra-libs              = $(services:%=libnss_%)
57 # These libraries will be built in the `others' pass rather than
58 # the `lib' pass, because they depend on libc.so being built already.
59 extra-libs-others       = $(extra-libs)
60
61 # The sources are found in the appropriate subdir.
62 subdir-dirs = $(services:%=nss_%)
63 vpath %.c $(subdir-dirs)
64
65
66 libnss_files-routines   := $(addprefix files-,$(databases)) \
67                            files-have_o_cloexec
68 distribute              += files-XXX.c files-parse.c
69
70
71 # Build static module if requested
72 ifneq ($(build-static-nss),yes)
73 libnss_files-inhibit-o  = $(filter-out .os,$(object-suffixes))
74 endif
75
76 include ../Rules
77
78
79 ifeq (yes,$(build-static-nss))
80 $(objpfx)getent: $(objpfx)libnss_files.a
81 endif
82
83 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
84 # This ensures they will load libc.so for needed symbols if loaded by
85 # a statically-linked program that hasn't already loaded it.
86 libnss-libc = $(common-objpfx)linkobj/libc.so
87 $(services:%=$(objpfx)libnss_%.so): $(libnss-libc) \
88                                     $(common-objpfx)libc_nonshared.a
89
90
91 distribute              += nss_test1.c
92
93 CFLAGS-nss_test1.c = -DNOT_IN_libc=1
94 $(objpfx)/libnss_test1.so: $(objpfx)nss_test1.os $(common-objpfx)libc.so \
95                            $(common-objpfx)libc_nonshared.a
96         $(build-module)
97 $(objpfx)/libnss_test1.so$(libnss_test1.so-version): $(objpfx)/libnss_test1.so
98         $(make-link)
99 $(objpfx)tst-nss-test1.out: $(objpfx)/libnss_test1.so$(libnss_test1.so-version)