xref: /illumos-gate/usr/src/lib/libnsl/Makefile.com (revision 05ede3db)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
24# Copyright 2018 Nexenta Systems, Inc. All rights reserved.
25# Copyright (c) 2018, Joyent, Inc.
26#
27
28LIBRARY= libnsl.a
29VERS=	.1
30
31# objects are listed by source directory
32
33# common utility code used in more than one directory
34COMMON=		common.o daemon_utils.o
35
36DES=		des_crypt.o des_soft.o
37
38DIAL=		dial.o
39
40IPSEC=		algs.o
41
42NETDIR=		netdir.o
43
44NSS= \
45gethostbyname_r.o gethostent.o gethostent_r.o gethostent6.o gethostby_door.o \
46getipnodeby_door.o getipnodeby.o getrpcent.o  getrpcent_r.o inet_matchaddr.o \
47netdir_inet.o netdir_inet_sundry.o \
48parse.o getauthattr.o getprofattr.o getexecattr.o getuserattr.o getauuser.o
49
50NETSELECT= netselect.o
51
52NSL=  \
53_conn_util.o    _data2.o        _errlst.o \
54_utility.o      t_accept.o	t_alloc.o       t_bind.o        t_close.o \
55t_connect.o     t_error.o	t_free.o        t_getinfo.o     t_getname.o \
56t_getstate.o    t_listen.o	t_look.o        t_open.o        t_optmgmt.o \
57t_rcv.o         t_rcvconnect.o	t_rcvdis.o      t_rcvrel.o      t_rcvudata.o \
58t_rcvuderr.o    t_snd.o		t_snddis.o      t_sndrel.o      t_sndudata.o \
59t_sndv.o	t_sndreldata.o	t_rcvv.o	t_rcvreldata.o	t_sysconf.o \
60t_sndvudata.o	t_rcvvudata.o   t_sync.o        t_unbind.o	t_strerror.o \
61xti_wrappers.o
62
63WRAPPERS= \
64tli_wrappers.o
65
66RPC= \
67auth_des.o	auth_none.o	auth_sys.o	auth_time.o	authdes_prot.o \
68authsys_prot.o	can_use_af.o \
69clnt_bcast.o	clnt_dg.o	clnt_door.o	clnt_generic.o	clnt_perror.o \
70clnt_raw.o	clnt_simple.o	clnt_vc.o	fdsync.o	getdname.o \
71key_call.o	key_prot.o	mt_misc.o \
72netname.o	netnamer.o	pmap_clnt.o	pmap_prot.o \
73rpc_callmsg.o	rpc_comdata.o	rpc_generic.o	rpc_prot.o rpc_sel2poll.o \
74rpc_soc.o	rpc_td.o	rpcb_clnt.o	rpcb_prot.o \
75rpcb_st_xdr.o	rpcdname.o	rpcsec_gss_if.o	rtime_tli.o	svc.o \
76svc_auth.o	svc_auth_loopb.o	svc_auth_sys.o	svc_dg.o \
77svc_door.o	svc_generic.o	svc_raw.o	svc_run.o	svc_simple.o \
78svc_vc.o	svcauth_des.o	svid_funcs.o	ti_opts.o	xdr.o \
79xdr_array.o	xdr_float.o	xdr_mem.o	xdr_rec.o	xdr_refer.o \
80xdr_sizeof.o	xdr_stdio.o
81
82SAF= checkver.o  doconfig.o
83
84YP=  \
85dbm.o           yp_all.o        yp_b_clnt.o     yp_b_xdr.o      yp_bind.o  \
86yp_enum.o       yp_master.o     yp_match.o      yp_order.o      yp_update.o \
87yperr_string.o	yp_xdr.o	ypprot_err.o	ypupd.o	\
88yp_rsvd.o \
89yppasswd_xdr.o
90
91NIS_GEN=  \
92nis_xdr.o      nis_subr.o       nis_misc.o         \
93nis_misc_proc.o  nis_sec_mechs.o
94
95
96NIS= $(NIS_GEN)
97
98KEY= publickey.o xcrypt.o gen_dhkeys.o
99
100OBJECTS= $(COMMON) $(DES) $(DIAL) $(IPSEC) $(NETDIR) $(NSS) $(NETSELECT) \
101	 $(NSL) $(WRAPPERS) $(RPC) $(SAF) $(YP) $(NIS) $(KEY)
102
103# libnsl build rules
104pics/%.o: ../common/%.c
105	$(COMPILE.c)  -o $@ $<
106	$(POST_PROCESS_O)
107
108pics/%.o: ../des/%.c
109	$(COMPILE.c)  -o $@ $<
110	$(POST_PROCESS_O)
111
112pics/%.o: ../dial/%.c
113	$(COMPILE.c)  -o $@ $<
114	$(POST_PROCESS_O)
115
116pics/%.o: ../ipsec/%.c
117	$(COMPILE.c)  -o $@ $<
118	$(POST_PROCESS_O)
119
120pics/%.o: ../netdir/%.c
121	$(COMPILE.c)  -o $@ $<
122	$(POST_PROCESS_O)
123
124pics/%.o: ../nss/%.c
125	$(COMPILE.c)  -o $@ $<
126	$(POST_PROCESS_O)
127
128pics/%.o: ../netselect/%.c
129	$(COMPILE.c)  -o $@ $<
130	$(POST_PROCESS_O)
131
132pics/%.o: ../nsl/%.c
133	$(COMPILE.c)  -o $@ $<
134	$(POST_PROCESS_O)
135
136pics/%.o: ../rpc/%.c
137	$(COMPILE.c) -DPORTMAP -DNIS  -o $@ $<
138	$(POST_PROCESS_O)
139
140pics/%.o: ../saf/%.c
141	$(COMPILE.c)  -o $@ $<
142	$(POST_PROCESS_O)
143
144pics/%.o: ../yp/%.c
145	$(COMPILE.c)   -o $@ $<
146	$(POST_PROCESS_O)
147
148pics/%.o: ../key/%.c
149	$(COMPILE.c)   -o $@ $<
150	$(POST_PROCESS_O)
151
152pics/%.o: ../nis/gen/%.c ../nis/gen/nis_clnt.h
153	$(COMPILE.c) -o $@ $<
154	$(POST_PROCESS_O)
155
156
157pics/%.o: ../nis/gen/nis_clnt.h
158	$(COMPILE.cc) -o $@ $<
159	$(POST_PROCESS_O)
160
161# include library definitions
162include ../../Makefile.lib
163
164# install this library in the root filesystem
165include ../../Makefile.rootfs
166
167LIBS =		$(DYNLIB) $(LINTLIB)
168
169SRCDIR=		../common
170
171# Override the position-independent code generation flags.
172#
173# These files are particularly rich with references to global things.
174# Ordering is by number of got references per file of files that have
175# non-performance sensitive code in them.
176#
177# If you need to add more files and the GOT overflows with "pic" items,
178# then use the environment variable LD_OPTIONS=-Dgot,detail to have the
179# linker print out the list of GOT hogs..
180
181GOTHOGS =	dial.o print_obj.o clnt_perror.o nsl_stdio_prv.o netdir.o \
182		algs.o netselect.o
183BIGPICS =	$(GOTHOGS:%=pics/%)
184$(BIGPICS) :=	sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
185$(BIGPICS) :=	i386_C_PICFLAGS = $(C_BIGPICFLAGS)
186
187CPPFLAGS +=	-I$(SRC)/lib/libnsl/include -D_REENTRANT
188CPPFLAGS +=	-I$(SRC)/lib/libnsl/dial
189
190CFLAGS +=	$(CCVERBOSE)
191
192# Make string literals read-only to save memory.
193CFLAGS +=	$(XSTRCONST)
194CFLAGS64 +=	$(XSTRCONST)
195CCFLAGS +=	-_CC=-features=conststrings
196CCFLAGS64 +=	-_CC=-features=conststrings
197
198CERRWARN +=	-_gcc=-Wno-char-subscripts
199CERRWARN +=	-_gcc=-Wno-parentheses
200CERRWARN +=	-_gcc=-Wno-uninitialized
201CERRWARN +=	-_gcc=-Wno-switch
202CERRWARN +=	-_gcc=-Wno-char-subscripts
203CERRWARN +=	-_gcc=-Wno-empty-body
204CERRWARN +=	-_gcc=-Wno-unused-variable
205CERRWARN +=	-_gcc=-Wno-clobbered
206
207# not linted
208SMATCH=off
209
210LIBMP =		-lmp
211lint :=		LIBMP =
212LDLIBS +=	$(LIBMP) -lmd -lc
213DYNFLAGS +=	$(ZNODELETE)
214
215$(LINTLIB):=	SRCS=$(SRCDIR)/$(LINTSRC)
216LINTFLAGS +=	-m -DPORTMAP
217LINTFLAGS64 +=	-m -DPORTMAP
218
219.KEEP_STATE:
220
221all: $(LIBS)
222
223# Don't lint WRAPPERS as they are explicitly unclean
224SRCS=	$(DES:%.o=../des/%.c)			\
225	$(DIAL:%.o=../dial/%.c)			\
226	$(IPSEC:%.o=../ipsec/%.c)		\
227	$(NETDIR:%.o=../netdir/%.c)		\
228	$(NSS:%.o=../nss/%.c)			\
229	$(NETSELECT:%.o=../netselect/%.c)	\
230	$(NSL:%.o=../nsl/%.c)			\
231	$(RPC:%.o=../rpc/%.c)			\
232	$(SAF:%.o=../saf/%.c)			\
233	$(YP:%.o=../yp/%.c)			\
234	$(NIS_GEN:%.o=../nis/gen/%.c)		\
235	$(COMMON:%.o=../common/%.c)
236
237lint:
238	@$(LINT.c) $(SRCS) $(LDLIBS)
239
240# include library targets
241include ../../Makefile.targ
242