xref: /illumos-gate/usr/src/lib/libnsl/Makefile.com (revision 294baf98ae09b8aa1fd82c7ab53f8d8299c6d226)
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# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
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_pton.o \
47inet_ntop.o netdir_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 \
71inet_ntoa.o	key_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_comdata1.o	rpc_generic.o	rpc_prot.o \
74rpc_sel2poll.o \
75rpc_soc.o	rpc_td.o	rpcb_clnt.o	rpcb_prot.o \
76rpcb_st_xdr.o	rpcdname.o	rpcsec_gss_if.o	rtime_tli.o	svc.o \
77svc_auth.o	svc_auth_loopb.o	svc_auth_sys.o	svc_dg.o \
78svc_door.o	svc_generic.o	svc_raw.o	svc_run.o	svc_simple.o \
79svc_vc.o	svcauth_des.o	svid_funcs.o	ti_opts.o	xdr.o \
80xdr_array.o	xdr_float.o	xdr_mem.o	xdr_rec.o	xdr_refer.o \
81xdr_sizeof.o	xdr_stdio.o
82
83SAF= checkver.o  doconfig.o
84
85YP=  \
86dbm.o           yp_all.o        yp_b_clnt.o     yp_b_xdr.o      yp_bind.o  \
87yp_enum.o       yp_master.o     yp_match.o      yp_order.o      yp_update.o \
88yperr_string.o  yp_xdr.o        ypprot_err.o    ypupd.o 	\
89yp_rsvd.o \
90yppasswd_xdr.o
91
92NIS_GEN=  \
93nislib.o          nis_callback.o   nis_xdr.o      nis_subr.o     nis_names.o  \
94nis_cback_xdr.o   print_obj.o      nis_perror.o   nis_groups.o   nis_tags.o   \
95nis_misc.o        nis_lookup.o     nis_rpc.o      nis_clnt.o	 nis_cast.o   \
96nis_hash.o	  nis_misc_proc.o  nis_sec_mechs.o npd_lib.o
97
98NIS_CACHE=  cache.o cache_api.o cold_start.o local_cache.o \
99	mapped_cache.o client_cache.o mgr_cache.o \
100	nis_cache_clnt.o nis_cache_xdr.o
101
102NIS= $(NIS_GEN) $(NIS_CACHE)
103
104KEY= publickey.o xcrypt.o gen_dhkeys.o
105
106OBJECTS= $(COMMON) $(DES) $(DIAL) $(IPSEC) $(NETDIR) $(NSS) $(NETSELECT) \
107	 $(NSL) $(WRAPPERS) $(RPC) $(SAF) $(YP) $(NIS) $(KEY)
108
109# libnsl build rules
110pics/%.o: ../common/%.c
111	$(COMPILE.c)  -o $@ $<
112	$(POST_PROCESS_O)
113
114pics/%.o: ../des/%.c
115	$(COMPILE.c)  -o $@ $<
116	$(POST_PROCESS_O)
117
118pics/%.o: ../dial/%.c
119	$(COMPILE.c)  -o $@ $<
120	$(POST_PROCESS_O)
121
122pics/%.o: ../ipsec/%.c
123	$(COMPILE.c)  -o $@ $<
124	$(POST_PROCESS_O)
125
126pics/%.o: ../netdir/%.c
127	$(COMPILE.c)  -o $@ $<
128	$(POST_PROCESS_O)
129
130pics/%.o: ../nss/%.c
131	$(COMPILE.c)  -o $@ $<
132	$(POST_PROCESS_O)
133
134pics/%.o: ../netselect/%.c
135	$(COMPILE.c)  -o $@ $<
136	$(POST_PROCESS_O)
137
138pics/%.o: ../nsl/%.c
139	$(COMPILE.c)  -o $@ $<
140	$(POST_PROCESS_O)
141
142pics/%.o: ../rpc/%.c
143	$(COMPILE.c) -DPORTMAP -DNIS  -o $@ $<
144	$(POST_PROCESS_O)
145
146pics/%.o: ../saf/%.c
147	$(COMPILE.c)  -o $@ $<
148	$(POST_PROCESS_O)
149
150pics/%.o: ../yp/%.c
151	$(COMPILE.c)   -o $@ $<
152	$(POST_PROCESS_O)
153
154pics/%.o: ../key/%.c
155	$(COMPILE.c)   -o $@ $<
156	$(POST_PROCESS_O)
157
158pics/%.o: ../nis/gen/%.c ../nis/gen/nis_clnt.h
159	$(COMPILE.c) -o $@ $<
160	$(POST_PROCESS_O)
161
162pics/%.o: ../nis/cache/%.c ../nis/cache/nis_clnt.h
163	$(COMPILE.c) -o $@ $<
164	$(POST_PROCESS_O)
165
166pics/%.o: ../nis/cache/%.cc ../nis/gen/nis_clnt.h \
167	../nis/cache/nis_clnt.h ../nis/cache/nis_cache.h
168	$(COMPILE.cc) -o $@ $<
169	$(POST_PROCESS_O)
170
171# include library definitions
172include ../../Makefile.lib
173
174# install this library in the root filesystem
175include ../../Makefile.rootfs
176
177LIBS =		$(DYNLIB) $(LINTLIB)
178
179SRCDIR=		../common
180MAPFILES +=	mapfile-vers
181
182# Override the position-independent code generation flags.
183#
184# These files are particularly rich with references to global things.
185# Ordering is by number of got references per file of files that have
186# non-performance sensitive code in them.
187#
188# If you need to add more files and the GOT overflows with "pic" items,
189# then use the environment variable LD_OPTIONS=-Dgot,detail to have the
190# linker print out the list of GOT hogs..
191
192GOTHOGS =	dial.o print_obj.o clnt_perror.o nsl_stdio_prv.o netdir.o \
193		algs.o netselect.o
194BIGPICS =	$(GOTHOGS:%=pics/%)
195$(BIGPICS) :=	sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
196$(BIGPICS) :=	i386_C_PICFLAGS = $(C_BIGPICFLAGS)
197
198# Compile C++ code without exceptions to avoid a dependence on libC.
199NOEXCEPTIONS= -noex
200CCFLAGS += $(NOEXCEPTIONS)
201CCFLAGS64 += $(NOEXCEPTIONS)
202
203CPPFLAGS +=	-I$(SRC)/lib/common/inc -I$(SRC)/lib/libnsl/include -D_REENTRANT
204CPPFLAGS +=	-I$(SRC)/lib/libnsl/dial
205
206CFLAGS +=	$(CCVERBOSE)
207LIBMP =		-lmp
208lint :=		LIBMP =
209LDLIBS +=	$(LIBMP) -lmd -lscf -lc
210
211$(LINTLIB):=	SRCS=$(SRCDIR)/$(LINTSRC)
212LINTFLAGS +=	-m -DPORTMAP
213LINTFLAGS64 +=	-m -DPORTMAP
214
215.KEEP_STATE:
216
217all: $(LIBS)
218
219# Don't lint WRAPPERS as they are explicitly unclean
220SRCS=	$(DES:%.o=../des/%.c)			\
221	$(DIAL:%.o=../dial/%.c)			\
222	$(IPSEC:%.o=../ipsec/%.c)		\
223	$(NETDIR:%.o=../netdir/%.c)		\
224	$(NSS:%.o=../nss/%.c)			\
225	$(NETSELECT:%.o=../netselect/%.c)	\
226	$(NSL:%.o=../nsl/%.c)			\
227	$(RPC:%.o=../rpc/%.c)			\
228	$(SAF:%.o=../saf/%.c)			\
229	$(YP:%.o=../yp/%.c)			\
230	$(NIS_GEN:%.o=../nis/gen/%.c)		\
231	$(COMMON:%.o=../common/%.c)
232
233lint:
234	@$(LINT.c) $(SRCS) $(LDLIBS)
235
236# include library targets
237include ../../Makefile.targ
238