chiark / gitweb /
Apply https://sourceware.org/git/?p=glibc.git;a=commit;h=d5dd6189d506068ed11c8bfa1e1e...
[eglibc.git] / nis / Makefile
1 # Copyright (C) 1996,1997,1998,2001,2004,2006 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
3
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8
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 # Lesser General Public License for more details.
13
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 # 02111-1307 USA.
18
19 #
20 #       Makefile for NIS/NIS+ part.
21 #
22 include ../option-groups.mak
23
24 subdir  := nis
25
26 aux                     := nis_hash
27
28 headers                 := $(wildcard rpcsvc/*.[hx])
29 distribute              := nss-nis.h nss-nisplus.h nis_intern.h Banner \
30                            nisplus-parser.h nis_xdr.h nss
31
32 # These are the databases available for the nis (and perhaps later nisplus)
33 # service.  This must be a superset of the services in nss.
34 databases-y             := proto service hosts network grp pwd rpc ethers \
35                            spwd netgrp publickey
36 databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
37
38 # Specify rules for the nss_* modules.
39 # The 'compat' module includes nis support, and the 'nss' directory
40 # includes a bare-bones "files" library, so we'll include 'compat' in
41 # OPTION_EGLIBC_NIS.
42 services-y              :=
43 services-$(OPTION_EGLIBC_NIS) += nis nisplus compat
44
45 extra-libs-$(OPTION_EGLIBC_NIS) += libnsl
46 extra-libs-y            += $(services-y:%=libnss_%)
47
48 # These libraries will be built in the `others' pass rather than
49 # the `lib' pass, because they depend on libc.so being built already.
50 extra-libs-others-y     += $(extra-libs-y)
51
52 # The sources are found in the appropriate subdir.
53 subdir-dirs = $(services-y:%=nss_%)
54 vpath %.c $(subdir-dirs)
55
56 libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
57                   nis_subr nis_local_names nis_free nis_file \
58                   nis_print nis_error nis_call nis_lookup\
59                   nis_table nis_xdr nis_server nis_ping \
60                   nis_checkpoint nis_mkdir nis_rmdir nis_getservlist\
61                   nis_verifygroup nis_ismember nis_addmember nis_util\
62                   nis_removemember nis_creategroup nis_destroygroup\
63                   nis_print_group_entry nis_domain_of nis_domain_of_r\
64                   nis_modify nis_remove nis_add nis_defaults\
65                   nis_findserv nis_callback nis_clone_dir nis_clone_obj\
66                   nis_clone_res nss-default
67
68 libnss_compat-routines  := $(addprefix compat-,grp pwd spwd initgroups)
69 libnss_compat-inhibit-o = $(filter-out .os,$(object-suffixes))
70
71 libnss_nis-routines     := $(addprefix nis-,$(databases-y)) nis-initgroups \
72                            nss-nis
73 libnss_nis-inhibit-o    = $(filter-out .os,$(object-suffixes))
74
75 libnss_nisplus-routines := $(addprefix nisplus-,$(databases-y)) nisplus-parser \
76                            nss-nisplus nisplus-initgroups
77 libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))
78
79 include ../Rules
80
81
82 $(objpfx)libnss_compat.so: $(objpfx)libnsl.so$(libnsl.so-version)
83 $(objpfx)libnss_nis.so: $(objpfx)libnsl.so$(libnsl.so-version) \
84                         $(common-objpfx)nss/libnss_files.so
85 $(objpfx)libnss_nisplus.so: $(objpfx)libnsl.so$(libnsl.so-version)
86
87 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
88 # This ensures they will load libc.so for needed symbols if loaded by
89 # a statically-linked program that hasn't already loaded it.
90 $(services-y:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \
91         $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
92
93
94 ifeq ($(build-shared),yes)
95 $(others-y:%=$(objpfx)%): $(objpfx)libnsl.so$(libnsl.so-version)
96 else
97 $(others-y:%=$(objpfx)%): $(objpfx)libnsl.a
98 endif