blob: 037e674d6b80d675d3b673baf2bf2619da370962 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# Copyright (C) 1996-2015 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, see
16# <http://www.gnu.org/licenses/>.
17
18#
19# Makefile for NIS/NIS+ part.
20#
21subdir := nis
22
23include ../Makeconfig
24
25aux := nis_hash
26
27ifeq ($(link-obsolete-rpc),yes)
28headers := $(wildcard rpcsvc/*.[hx])
29endif
30
31# These are the databases available for the nis (and perhaps later nisplus)
32# service. This must be a superset of the services in nss.
33databases = proto service hosts network grp pwd rpc ethers \
34 spwd netgrp alias publickey
35
36# Specify rules for the nss_* modules.
37services := nis nisplus compat
38
39extra-libs = libnsl $(services:%=libnss_%)
40# These libraries will be built in the `others' pass rather than
41# the `lib' pass, because they depend on libc.so being built already.
42extra-libs-others = $(extra-libs)
43
44# The sources are found in the appropriate subdir.
45subdir-dirs = $(services:%=nss_%)
46vpath %.c $(subdir-dirs)
47
48libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
49 nis_subr nis_local_names nis_free nis_file \
50 nis_print nis_error nis_call nis_lookup\
51 nis_table nis_xdr nis_server nis_ping \
52 nis_checkpoint nis_mkdir nis_rmdir nis_getservlist\
53 nis_verifygroup nis_ismember nis_addmember nis_util\
54 nis_removemember nis_creategroup nis_destroygroup\
55 nis_print_group_entry nis_domain_of nis_domain_of_r\
56 nis_modify nis_remove nis_add nis_defaults\
57 nis_findserv nis_callback nis_clone_dir nis_clone_obj\
58 nis_clone_res nss-default
59
60libnss_compat-routines := $(addprefix compat-,grp pwd spwd initgroups)
61libnss_compat-inhibit-o = $(filter-out .os,$(object-suffixes))
62
63libnss_nis-routines := $(addprefix nis-,$(databases)) nis-initgroups \
64 nss-nis
65libnss_nis-inhibit-o = $(filter-out .os,$(object-suffixes))
66
67libnss_nisplus-routines := $(addprefix nisplus-,$(databases)) nisplus-parser \
68 nss-nisplus nisplus-initgroups
69libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))
70
71include ../Rules
72
73
74$(objpfx)libnss_compat.so: $(objpfx)libnsl.so$(libnsl.so-version)
75$(objpfx)libnss_nis.so: $(objpfx)libnsl.so$(libnsl.so-version) \
76 $(common-objpfx)nss/libnss_files.so
77$(objpfx)libnss_nisplus.so: $(objpfx)libnsl.so$(libnsl.so-version)
78
79libnsl-libc = $(common-objpfx)linkobj/libc.so
80# Target-specific variable setting to link objects using deprecated
81# RPC interfaces with the version of libc.so that makes them available
82# for new links:
83$(services:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \
84 libc-for-link = $(libnsl-libc)
85
86
87ifeq ($(build-shared),yes)
88$(others:%=$(objpfx)%): $(objpfx)libnsl.so$(libnsl.so-version)
89else
90$(others:%=$(objpfx)%): $(objpfx)libnsl.a
91endif