xref: /titanic_51/usr/src/lib/libnsl/Makefile.com (revision bfed486ad8de8b8ebc6345a8e10accae08bf2f45)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27LIBRARY= libnsl.a
28VERS=	.1
29
30# objects are listed by source directory
31
32# common utility code used in more than one directory
33COMMON=		common.o daemon_utils.o
34
35DES=		des_crypt.o des_soft.o
36
37DIAL=		dial.o
38
39IPSEC=		algs.o
40
41NETDIR=		netdir.o
42
43NSS= \
44gethostbyname_r.o gethostent.o gethostent_r.o gethostent6.o gethostby_door.o \
45getipnodeby_door.o getipnodeby.o getrpcent.o  getrpcent_r.o inet_pton.o \
46inet_ntop.o netdir_inet.o netdir_inet_sundry.o \
47parse.o getauthattr.o getprofattr.o getexecattr.o getuserattr.o getauuser.o
48
49NETSELECT= netselect.o
50
51NSL=  \
52_conn_util.o    _data2.o        _errlst.o \
53_utility.o      t_accept.o	t_alloc.o       t_bind.o        t_close.o \
54t_connect.o     t_error.o	t_free.o        t_getinfo.o     t_getname.o \
55t_getstate.o    t_listen.o	t_look.o        t_open.o        t_optmgmt.o \
56t_rcv.o         t_rcvconnect.o	t_rcvdis.o      t_rcvrel.o      t_rcvudata.o \
57t_rcvuderr.o    t_snd.o		t_snddis.o      t_sndrel.o      t_sndudata.o \
58t_sndv.o	t_sndreldata.o  t_rcvv.o 	t_rcvreldata.o  t_sysconf.o \
59t_sndvudata.o	t_rcvvudata.o   t_sync.o        t_unbind.o	t_strerror.o \
60xti_wrappers.o
61
62WRAPPERS= \
63tli_wrappers.o
64
65RPC= \
66auth_des.o	auth_none.o	auth_sys.o	auth_time.o	authdes_prot.o \
67authsys_prot.o	can_use_af.o \
68clnt_bcast.o	clnt_dg.o	clnt_door.o	clnt_generic.o	clnt_perror.o \
69clnt_raw.o	clnt_simple.o	clnt_vc.o	fdsync.o	getdname.o \
70inet_ntoa.o	key_call.o	key_prot.o	mt_misc.o \
71netname.o	netnamer.o	pmap_clnt.o	pmap_prot.o \
72rpc_callmsg.o	rpc_comdata.o	rpc_comdata1.o	rpc_generic.o	rpc_prot.o \
73rpc_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=  \
92nislib.o          nis_callback.o   nis_xdr.o      nis_subr.o     nis_names.o  \
93nis_cback_xdr.o   print_obj.o      nis_perror.o   nis_groups.o   nis_tags.o   \
94nis_misc.o        nis_lookup.o     nis_rpc.o      nis_clnt.o	 nis_cast.o   \
95nis_hash.o	  nis_misc_proc.o  nis_sec_mechs.o npd_lib.o
96
97NIS_CACHE=  cache.o cache_api.o cold_start.o local_cache.o \
98	mapped_cache.o client_cache.o mgr_cache.o \
99	nis_cache_clnt.o nis_cache_xdr.o
100
101NIS= $(NIS_GEN) $(NIS_CACHE)
102
103KEY= publickey.o xcrypt.o gen_dhkeys.o
104
105OBJECTS= $(COMMON) $(DES) $(DIAL) $(IPSEC) $(NETDIR) $(NSS) $(NETSELECT) \
106	 $(NSL) $(WRAPPERS) $(RPC) $(SAF) $(YP) $(NIS) $(KEY)
107
108# libnsl build rules
109pics/%.o: ../common/%.c
110	$(COMPILE.c)  -o $@ $<
111	$(POST_PROCESS_O)
112
113pics/%.o: ../des/%.c
114	$(COMPILE.c)  -o $@ $<
115	$(POST_PROCESS_O)
116
117pics/%.o: ../dial/%.c
118	$(COMPILE.c)  -o $@ $<
119	$(POST_PROCESS_O)
120
121pics/%.o: ../ipsec/%.c
122	$(COMPILE.c)  -o $@ $<
123	$(POST_PROCESS_O)
124
125pics/%.o: ../netdir/%.c
126	$(COMPILE.c)  -o $@ $<
127	$(POST_PROCESS_O)
128
129pics/%.o: ../nss/%.c
130	$(COMPILE.c)  -o $@ $<
131	$(POST_PROCESS_O)
132
133pics/%.o: ../netselect/%.c
134	$(COMPILE.c)  -o $@ $<
135	$(POST_PROCESS_O)
136
137pics/%.o: ../nsl/%.c
138	$(COMPILE.c)  -o $@ $<
139	$(POST_PROCESS_O)
140
141pics/%.o: ../rpc/%.c
142	$(COMPILE.c) -DPORTMAP -DNIS  -o $@ $<
143	$(POST_PROCESS_O)
144
145pics/%.o: ../saf/%.c
146	$(COMPILE.c)  -o $@ $<
147	$(POST_PROCESS_O)
148
149pics/%.o: ../yp/%.c
150	$(COMPILE.c)   -o $@ $<
151	$(POST_PROCESS_O)
152
153pics/%.o: ../key/%.c
154	$(COMPILE.c)   -o $@ $<
155	$(POST_PROCESS_O)
156
157pics/%.o: ../nis/gen/%.c ../nis/gen/nis_clnt.h
158	$(COMPILE.c) -o $@ $<
159	$(POST_PROCESS_O)
160
161pics/%.o: ../nis/cache/%.c ../nis/cache/nis_clnt.h
162	$(COMPILE.c) -o $@ $<
163	$(POST_PROCESS_O)
164
165pics/%.o: ../nis/cache/%.cc ../nis/gen/nis_clnt.h \
166	../nis/cache/nis_clnt.h ../nis/cache/nis_cache.h
167	$(COMPILE.cc) -o $@ $<
168	$(POST_PROCESS_O)
169
170# include library definitions
171include ../../Makefile.lib
172
173# install this library in the root filesystem
174include ../../Makefile.rootfs
175
176LIBS =		$(DYNLIB) $(LINTLIB)
177
178SRCDIR=		../common
179MAPFILES +=	mapfile-vers
180
181# Override the position-independent code generation flags.
182#
183# These files are particularly rich with references to global things.
184# Ordering is by number of got references per file of files that have
185# non-performance sensitive code in them.
186#
187# If you need to add more files and the GOT overflows with "pic" items,
188# then use the environment variable LD_OPTIONS=-Dgot,detail to have the
189# linker print out the list of GOT hogs..
190
191GOTHOGS =	dial.o print_obj.o clnt_perror.o nsl_stdio_prv.o netdir.o \
192		algs.o netselect.o
193BIGPICS =	$(GOTHOGS:%=pics/%)
194$(BIGPICS) :=	sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
195$(BIGPICS) :=	i386_C_PICFLAGS = $(C_BIGPICFLAGS)
196
197# Compile C++ code without exceptions to avoid a dependence on libC.
198NOEXCEPTIONS= -noex
199CCFLAGS += $(NOEXCEPTIONS)
200CCFLAGS64 += $(NOEXCEPTIONS)
201
202CPPFLAGS +=	-I$(SRC)/lib/common/inc -I$(SRC)/lib/libnsl/include -D_REENTRANT
203CPPFLAGS +=	-I$(SRC)/lib/libnsl/dial
204
205CFLAGS +=	$(CCVERBOSE)
206
207# Make string literals read-only to save memory.
208CFLAGS +=	$(XSTRCONST)
209CFLAGS64 +=	$(XSTRCONST)
210CCFLAGS +=	-_CC=-features=conststrings
211CCFLAGS64 +=	-_CC=-features=conststrings
212
213LIBMP =		-lmp
214lint :=		LIBMP =
215LDLIBS +=	$(LIBMP) -lmd -lscf -lc
216
217$(LINTLIB):=	SRCS=$(SRCDIR)/$(LINTSRC)
218LINTFLAGS +=	-m -DPORTMAP
219LINTFLAGS64 +=	-m -DPORTMAP
220
221.KEEP_STATE:
222
223all: $(LIBS)
224
225# Don't lint WRAPPERS as they are explicitly unclean
226SRCS=	$(DES:%.o=../des/%.c)			\
227	$(DIAL:%.o=../dial/%.c)			\
228	$(IPSEC:%.o=../ipsec/%.c)		\
229	$(NETDIR:%.o=../netdir/%.c)		\
230	$(NSS:%.o=../nss/%.c)			\
231	$(NETSELECT:%.o=../netselect/%.c)	\
232	$(NSL:%.o=../nsl/%.c)			\
233	$(RPC:%.o=../rpc/%.c)			\
234	$(SAF:%.o=../saf/%.c)			\
235	$(YP:%.o=../yp/%.c)			\
236	$(NIS_GEN:%.o=../nis/gen/%.c)		\
237	$(COMMON:%.o=../common/%.c)
238
239lint:
240	@$(LINT.c) $(SRCS) $(LDLIBS)
241
242# include library targets
243include ../../Makefile.targ
244