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