xref: /illumos-gate/usr/src/lib/libnsl/Makefile.com (revision b1d7ec75953cd517f5b7c3d9cb427ff8ec5d7d07)
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#
25
26LIBRARY= libnsl.a
27VERS=	.1
28
29# objects are listed by source directory
30
31# common utility code used in more than one directory
32COMMON=		common.o daemon_utils.o
33
34DES=		des_crypt.o des_soft.o
35
36DIAL=		dial.o
37
38IPSEC=		algs.o
39
40NETDIR=		netdir.o
41
42NSS= \
43gethostbyname_r.o gethostent.o gethostent_r.o gethostent6.o gethostby_door.o \
44getipnodeby_door.o getipnodeby.o getrpcent.o  getrpcent_r.o inet_pton.o \
45inet_ntop.o netdir_inet.o netdir_inet_sundry.o \
46parse.o getauthattr.o getprofattr.o getexecattr.o getuserattr.o getauuser.o
47
48NETSELECT= netselect.o
49
50NSL=  \
51_conn_util.o    _data2.o        _errlst.o \
52_utility.o      t_accept.o	t_alloc.o       t_bind.o        t_close.o \
53t_connect.o     t_error.o	t_free.o        t_getinfo.o     t_getname.o \
54t_getstate.o    t_listen.o	t_look.o        t_open.o        t_optmgmt.o \
55t_rcv.o         t_rcvconnect.o	t_rcvdis.o      t_rcvrel.o      t_rcvudata.o \
56t_rcvuderr.o    t_snd.o		t_snddis.o      t_sndrel.o      t_sndudata.o \
57t_sndv.o	t_sndreldata.o  t_rcvv.o 	t_rcvreldata.o  t_sysconf.o \
58t_sndvudata.o	t_rcvvudata.o   t_sync.o        t_unbind.o	t_strerror.o \
59xti_wrappers.o
60
61WRAPPERS= \
62tli_wrappers.o
63
64RPC= \
65auth_des.o	auth_none.o	auth_sys.o	auth_time.o	authdes_prot.o \
66authsys_prot.o	can_use_af.o \
67clnt_bcast.o	clnt_dg.o	clnt_door.o	clnt_generic.o	clnt_perror.o \
68clnt_raw.o	clnt_simple.o	clnt_vc.o	fdsync.o	getdname.o \
69inet_ntoa.o	key_call.o	key_prot.o	mt_misc.o \
70netname.o	netnamer.o	pmap_clnt.o	pmap_prot.o \
71rpc_callmsg.o	rpc_comdata.o	rpc_comdata1.o	rpc_generic.o	rpc_prot.o \
72rpc_sel2poll.o \
73rpc_soc.o	rpc_td.o	rpcb_clnt.o	rpcb_prot.o \
74rpcb_st_xdr.o	rpcdname.o	rpcsec_gss_if.o	rtime_tli.o	svc.o \
75svc_auth.o	svc_auth_loopb.o	svc_auth_sys.o	svc_dg.o \
76svc_door.o	svc_generic.o	svc_raw.o	svc_run.o	svc_simple.o \
77svc_vc.o	svcauth_des.o	svid_funcs.o	ti_opts.o	xdr.o \
78xdr_array.o	xdr_float.o	xdr_mem.o	xdr_rec.o	xdr_refer.o \
79xdr_sizeof.o	xdr_stdio.o
80
81SAF= checkver.o  doconfig.o
82
83YP=  \
84dbm.o           yp_all.o        yp_b_clnt.o     yp_b_xdr.o      yp_bind.o  \
85yp_enum.o       yp_master.o     yp_match.o      yp_order.o      yp_update.o \
86yperr_string.o  yp_xdr.o        ypprot_err.o    ypupd.o 	\
87yp_rsvd.o \
88yppasswd_xdr.o
89
90NIS_GEN=  \
91nis_xdr.o      nis_subr.o       nis_misc.o         \
92nis_misc_proc.o  nis_sec_mechs.o
93
94
95NIS= $(NIS_GEN)
96
97KEY= publickey.o xcrypt.o gen_dhkeys.o
98
99OBJECTS= $(COMMON) $(DES) $(DIAL) $(IPSEC) $(NETDIR) $(NSS) $(NETSELECT) \
100	 $(NSL) $(WRAPPERS) $(RPC) $(SAF) $(YP) $(NIS) $(KEY)
101
102# libnsl build rules
103pics/%.o: ../common/%.c
104	$(COMPILE.c)  -o $@ $<
105	$(POST_PROCESS_O)
106
107pics/%.o: ../des/%.c
108	$(COMPILE.c)  -o $@ $<
109	$(POST_PROCESS_O)
110
111pics/%.o: ../dial/%.c
112	$(COMPILE.c)  -o $@ $<
113	$(POST_PROCESS_O)
114
115pics/%.o: ../ipsec/%.c
116	$(COMPILE.c)  -o $@ $<
117	$(POST_PROCESS_O)
118
119pics/%.o: ../netdir/%.c
120	$(COMPILE.c)  -o $@ $<
121	$(POST_PROCESS_O)
122
123pics/%.o: ../nss/%.c
124	$(COMPILE.c)  -o $@ $<
125	$(POST_PROCESS_O)
126
127pics/%.o: ../netselect/%.c
128	$(COMPILE.c)  -o $@ $<
129	$(POST_PROCESS_O)
130
131pics/%.o: ../nsl/%.c
132	$(COMPILE.c)  -o $@ $<
133	$(POST_PROCESS_O)
134
135pics/%.o: ../rpc/%.c
136	$(COMPILE.c) -DPORTMAP -DNIS  -o $@ $<
137	$(POST_PROCESS_O)
138
139pics/%.o: ../saf/%.c
140	$(COMPILE.c)  -o $@ $<
141	$(POST_PROCESS_O)
142
143pics/%.o: ../yp/%.c
144	$(COMPILE.c)   -o $@ $<
145	$(POST_PROCESS_O)
146
147pics/%.o: ../key/%.c
148	$(COMPILE.c)   -o $@ $<
149	$(POST_PROCESS_O)
150
151pics/%.o: ../nis/gen/%.c ../nis/gen/nis_clnt.h
152	$(COMPILE.c) -o $@ $<
153	$(POST_PROCESS_O)
154
155
156pics/%.o: ../nis/gen/nis_clnt.h
157	$(COMPILE.cc) -o $@ $<
158	$(POST_PROCESS_O)
159
160# include library definitions
161include ../../Makefile.lib
162
163# install this library in the root filesystem
164include ../../Makefile.rootfs
165
166LIBS =		$(DYNLIB) $(LINTLIB)
167
168SRCDIR=		../common
169MAPFILES +=	mapfile-vers
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
187# Compile C++ code without exceptions to avoid a dependence on libC.
188NOEXCEPTIONS= -noex
189CCFLAGS += $(NOEXCEPTIONS)
190CCFLAGS64 += $(NOEXCEPTIONS)
191
192CPPFLAGS +=	-I$(SRC)/lib/common/inc -I$(SRC)/lib/libnsl/include -D_REENTRANT
193CPPFLAGS +=	-I$(SRC)/lib/libnsl/dial
194
195CFLAGS +=	$(CCVERBOSE)
196
197# Make string literals read-only to save memory.
198CFLAGS +=	$(XSTRCONST)
199CFLAGS64 +=	$(XSTRCONST)
200CCFLAGS +=	-_CC=-features=conststrings
201CCFLAGS64 +=	-_CC=-features=conststrings
202
203LIBMP =		-lmp
204lint :=		LIBMP =
205LDLIBS +=	$(LIBMP) -lmd -lc
206DYNFLAGS +=	$(ZNODELETE)
207
208$(LINTLIB):=	SRCS=$(SRCDIR)/$(LINTSRC)
209LINTFLAGS +=	-m -DPORTMAP
210LINTFLAGS64 +=	-m -DPORTMAP
211
212.KEEP_STATE:
213
214all: $(LIBS)
215
216# Don't lint WRAPPERS as they are explicitly unclean
217SRCS=	$(DES:%.o=../des/%.c)			\
218	$(DIAL:%.o=../dial/%.c)			\
219	$(IPSEC:%.o=../ipsec/%.c)		\
220	$(NETDIR:%.o=../netdir/%.c)		\
221	$(NSS:%.o=../nss/%.c)			\
222	$(NETSELECT:%.o=../netselect/%.c)	\
223	$(NSL:%.o=../nsl/%.c)			\
224	$(RPC:%.o=../rpc/%.c)			\
225	$(SAF:%.o=../saf/%.c)			\
226	$(YP:%.o=../yp/%.c)			\
227	$(NIS_GEN:%.o=../nis/gen/%.c)		\
228	$(COMMON:%.o=../common/%.c)
229
230lint:
231	@$(LINT.c) $(SRCS) $(LDLIBS)
232
233# include library targets
234include ../../Makefile.targ
235