xref: /illumos-gate/usr/src/lib/libnsl/Makefile (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate#
26*7c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate# lib/libnsl/Makefile
29*7c478bd9Sstevel@tonic-gate#
30*7c478bd9Sstevel@tonic-gatePROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
31*7c478bd9Sstevel@tonic-gatePROTOCOL_SRCDIR= $(SRC)/head/rpcsvc
32*7c478bd9Sstevel@tonic-gatePROTOCOL_UTS_SRCDIR= $(SRC)/uts/common/rpc
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gateSUBDIRS = spec .WAIT $(MACH) $(BUILD64) .WAIT $(MACH64)
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gate# objects are listed by source directory
37*7c478bd9Sstevel@tonic-gate
38*7c478bd9Sstevel@tonic-gate# common utility code used in more than one directory
39*7c478bd9Sstevel@tonic-gateRPC_DERIVED_FILES= \
40*7c478bd9Sstevel@tonic-gate	rpc/key_prot.c
41*7c478bd9Sstevel@tonic-gate
42*7c478bd9Sstevel@tonic-gateGEN_DERIVED_FILES= \
43*7c478bd9Sstevel@tonic-gate	nis/gen/nis_clnt.h      \
44*7c478bd9Sstevel@tonic-gate	nis/gen/nis_clnt.c	\
45*7c478bd9Sstevel@tonic-gate	nis/gen/nis_xdr.c       \
46*7c478bd9Sstevel@tonic-gate	nis/gen/nis_cback_xdr.c
47*7c478bd9Sstevel@tonic-gate
48*7c478bd9Sstevel@tonic-gateCACHE_DERIVED_FILES= \
49*7c478bd9Sstevel@tonic-gate	nis/cache/nis_clnt.h	\
50*7c478bd9Sstevel@tonic-gate	nis/cache/nis_cache.h	\
51*7c478bd9Sstevel@tonic-gate	nis/cache/nis_cache_clnt.cc \
52*7c478bd9Sstevel@tonic-gate	nis/cache/nis_cache_xdr.cc
53*7c478bd9Sstevel@tonic-gate
54*7c478bd9Sstevel@tonic-gatePROTOCOL_FILES= \
55*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/daemon_utils.h	\
56*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis.x		\
57*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis.h		\
58*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_object.x	\
59*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_callback.x	\
60*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_callback.h	\
61*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_cache.x	\
62*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/nis_cache.h
63*7c478bd9Sstevel@tonic-gate
64*7c478bd9Sstevel@tonic-gatePROTOCOL_FILES_UTS= \
65*7c478bd9Sstevel@tonic-gate	$(PROTOCOL_DIR)/key_prot.x
66*7c478bd9Sstevel@tonic-gate
67*7c478bd9Sstevel@tonic-gateDERIVED_FILES= $(GEN_DERIVED_FILES) $(CACHE_DERIVED_FILES) $(RPC_DERIVED_FILES)
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gate#
70*7c478bd9Sstevel@tonic-gate# Make sure they get cleaned when necessary
71*7c478bd9Sstevel@tonic-gate#
72*7c478bd9Sstevel@tonic-gateCLEANFILES += $(DERIVED_FILES)
73*7c478bd9Sstevel@tonic-gate
74*7c478bd9Sstevel@tonic-gate# include library definitions
75*7c478bd9Sstevel@tonic-gateinclude ../Makefile.lib
76*7c478bd9Sstevel@tonic-gate
77*7c478bd9Sstevel@tonic-gateTXTS +=		dial/dk.h	dial/uucp.h	dial/parms.h	dial/sysfiles.h
78*7c478bd9Sstevel@tonic-gate
79*7c478bd9Sstevel@tonic-gateSED=	sed
80*7c478bd9Sstevel@tonic-gateCP=	cp
81*7c478bd9Sstevel@tonic-gateGREP=	grep
82*7c478bd9Sstevel@tonic-gate
83*7c478bd9Sstevel@tonic-gateLIBRARY= libnsl.a
84*7c478bd9Sstevel@tonic-gateTEXT_DOMAIN= SUNW_OST_NETRPC
85*7c478bd9Sstevel@tonic-gatePOFILE= $(LIBRARY:.a=.po)
86*7c478bd9Sstevel@tonic-gatePOFILES= generic.po _errlst.po
87*7c478bd9Sstevel@tonic-gate
88*7c478bd9Sstevel@tonic-gateall :=		TARGET= all
89*7c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
90*7c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
91*7c478bd9Sstevel@tonic-gatedelete :=	TARGET= delete
92*7c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
93*7c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
94*7c478bd9Sstevel@tonic-gate_msg :=		TARGET= _msg
95*7c478bd9Sstevel@tonic-gatepackage :=	TARGET= package
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gate
98*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
99*7c478bd9Sstevel@tonic-gate
100*7c478bd9Sstevel@tonic-gateall:		$(PROTOCOL_DIR) $(DERIVED_FILES) txts .WAIT $(SUBDIRS)
101*7c478bd9Sstevel@tonic-gate
102*7c478bd9Sstevel@tonic-gateheaders:	$(PROTOCOL_DIR) .WAIT $(PROTOCOL_FILES) $(PROTOCOL_FILES_UTS) \
103*7c478bd9Sstevel@tonic-gate		$(DERIVED_FILES)
104*7c478bd9Sstevel@tonic-gate
105*7c478bd9Sstevel@tonic-gatetxts:		$(TXTS)
106*7c478bd9Sstevel@tonic-gate
107*7c478bd9Sstevel@tonic-gateinstall:	all $(SUBDIRS)
108*7c478bd9Sstevel@tonic-gate
109*7c478bd9Sstevel@tonic-gateclean clobber delete lint package:	$(SUBDIRS)
110*7c478bd9Sstevel@tonic-gate
111*7c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR):
112*7c478bd9Sstevel@tonic-gate	$(INS.dir)
113*7c478bd9Sstevel@tonic-gate
114*7c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.h:	$(PROTOCOL_SRCDIR)/%.h
115*7c478bd9Sstevel@tonic-gate	$(INS.file)
116*7c478bd9Sstevel@tonic-gate
117*7c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/nis.h:	$(PROTOCOL_SRCDIR)/nis.x $(PROTOCOL_SRCDIR)/nis_object.x
118*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_SRCDIR)/nis.x > nis-tmp.h
119*7c478bd9Sstevel@tonic-gate	$(SED) -e '/EDIT_START/,$$ d' < nis-tmp.h > nis.h
120*7c478bd9Sstevel@tonic-gate	$(RM) $@
121*7c478bd9Sstevel@tonic-gate	$(INS) -s -m $(FILEMODE) -f $(@D) nis.h
122*7c478bd9Sstevel@tonic-gate	$(RM) nis.h nis-tmp.h
123*7c478bd9Sstevel@tonic-gate
124*7c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/nis_callback.h:	$(PROTOCOL_SRCDIR)/nis_callback.x
125*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_SRCDIR)/nis_callback.x -o nis_callback.h
126*7c478bd9Sstevel@tonic-gate	$(RM) $@
127*7c478bd9Sstevel@tonic-gate	$(INS) -s -m $(FILEMODE) -f $(@D) nis_callback.h
128*7c478bd9Sstevel@tonic-gate	$(RM) nis_callback.h
129*7c478bd9Sstevel@tonic-gate
130*7c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/nis_cache.h:	$(PROTOCOL_SRCDIR)/nis_cache.x
131*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_SRCDIR)/nis_cache.x -o nis_cache.h
132*7c478bd9Sstevel@tonic-gate	$(RM) $@
133*7c478bd9Sstevel@tonic-gate	$(INS) -s -m $(FILEMODE) -f $(@D) nis_cache.h
134*7c478bd9Sstevel@tonic-gate	$(RM) nis_cache.h
135*7c478bd9Sstevel@tonic-gate
136*7c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.x:	$(PROTOCOL_SRCDIR)/%.x
137*7c478bd9Sstevel@tonic-gate	$(INS.file)
138*7c478bd9Sstevel@tonic-gate
139*7c478bd9Sstevel@tonic-gate$(PROTOCOL_DIR)/%.x:	$(PROTOCOL_UTS_SRCDIR)/%.x
140*7c478bd9Sstevel@tonic-gate	$(INS.file)
141*7c478bd9Sstevel@tonic-gate
142*7c478bd9Sstevel@tonic-gate#
143*7c478bd9Sstevel@tonic-gate# Rules for building the derived files
144*7c478bd9Sstevel@tonic-gate#
145*7c478bd9Sstevel@tonic-gate# Derived header files
146*7c478bd9Sstevel@tonic-gate#
147*7c478bd9Sstevel@tonic-gatenis/gen/nis_clnt.h: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
148*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis.x > nis_clnt-gen.h
149*7c478bd9Sstevel@tonic-gate	$(SED) -n -e '/EDIT_START/,$$ p' < nis_clnt-gen.h |\
150*7c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3_svc/_svc/' |\
151*7c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3/_clnt/' > $@
152*7c478bd9Sstevel@tonic-gate	$(RM) nis_clnt-gen.h
153*7c478bd9Sstevel@tonic-gate
154*7c478bd9Sstevel@tonic-gatenis/cache/nis_clnt.h: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
155*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis.x > nis_clnt-cache.h
156*7c478bd9Sstevel@tonic-gate	$(SED) -n -e '/EDIT_START/,$$ p' < nis_clnt-cache.h |\
157*7c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3_svc/_svc/' |\
158*7c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3/_clnt/' > $@
159*7c478bd9Sstevel@tonic-gate	$(RM) nis_clnt-cache.h
160*7c478bd9Sstevel@tonic-gate
161*7c478bd9Sstevel@tonic-gate#
162*7c478bd9Sstevel@tonic-gate# Derived source files
163*7c478bd9Sstevel@tonic-gate#
164*7c478bd9Sstevel@tonic-gatenis/gen/nis_clnt.c: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
165*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -l $(PROTOCOL_DIR)/nis.x > nis_clnt-tmp.c
166*7c478bd9Sstevel@tonic-gate	$(SED) -e 's!\"$(PROTOCOL_DIR)/nis.h\"!\<rpcsvc/nis.h\>!' \
167*7c478bd9Sstevel@tonic-gate	    < nis_clnt-tmp.c |\
168*7c478bd9Sstevel@tonic-gate	$(SED) -e 's/_3/_clnt/' > $@
169*7c478bd9Sstevel@tonic-gate	$(RM) nis_clnt-tmp.c
170*7c478bd9Sstevel@tonic-gate
171*7c478bd9Sstevel@tonic-gatenis/gen/nis_xdr.c: $(PROTOCOL_DIR)/nis.x $(PROTOCOL_DIR)/nis_object.x
172*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -c $(PROTOCOL_DIR)/nis.x > nis_xdr-tmp.c
173*7c478bd9Sstevel@tonic-gate	$(SED) -e 's!\"$(PROTOCOL_DIR)/nis.h\"!\<rpcsvc/nis.h\>!' \
174*7c478bd9Sstevel@tonic-gate	    < nis_xdr-tmp.c > $@
175*7c478bd9Sstevel@tonic-gate	$(RM) nis_xdr-tmp.c
176*7c478bd9Sstevel@tonic-gate
177*7c478bd9Sstevel@tonic-gatenis/gen/nis_cback_xdr.c: $(PROTOCOL_DIR)/nis_callback.x
178*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -c $(PROTOCOL_DIR)/nis_callback.x |\
179*7c478bd9Sstevel@tonic-gate	$(SED) -e 's!\"$(PROTOCOL_DIR)/nis_callback.h\"!\<rpcsvc/nis_callback.h\>!' > $@
180*7c478bd9Sstevel@tonic-gate
181*7c478bd9Sstevel@tonic-gatenis/cache/nis_cache_xdr.cc: $(PROTOCOL_DIR)/nis_cache.x
182*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -c $(PROTOCOL_DIR)/nis_cache.x |\
183*7c478bd9Sstevel@tonic-gate        $(SED) -e 's!\"$(PROTOCOL_DIR)/nis_cache.h\"!"nis_cache.h"!' > $@
184*7c478bd9Sstevel@tonic-gate
185*7c478bd9Sstevel@tonic-gatenis/cache/nis_cache_clnt.cc: $(PROTOCOL_DIR)/nis_cache.x
186*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -l $(PROTOCOL_DIR)/nis_cache.x |\
187*7c478bd9Sstevel@tonic-gate        $(SED) -e 's!\"$(PROTOCOL_DIR)/nis_cache.h\"!"nis_cache.h"!' > $@
188*7c478bd9Sstevel@tonic-gate
189*7c478bd9Sstevel@tonic-gatenis/cache/nis_cache.h: $(PROTOCOL_DIR)/nis_cache.x
190*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h $(PROTOCOL_DIR)/nis_cache.x |\
191*7c478bd9Sstevel@tonic-gate        $(SED) -e 's!\"$(PROTOCOL_DIR)/nis_cache.h\"!"nis_cache.h"!' > $@
192*7c478bd9Sstevel@tonic-gate
193*7c478bd9Sstevel@tonic-gaterpc/key_prot.c: $(PROTOCOL_DIR)/key_prot.x
194*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -c $(PROTOCOL_DIR)/key_prot.x |\
195*7c478bd9Sstevel@tonic-gate        $(SED) -e 's!"$(PROTOCOL_DIR)/key_prot.h"!<rpc/key_prot.h>!' > $@
196*7c478bd9Sstevel@tonic-gate
197*7c478bd9Sstevel@tonic-gate# include library targets
198*7c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
199*7c478bd9Sstevel@tonic-gate
200*7c478bd9Sstevel@tonic-gate# EXPORT DELETE START
201*7c478bd9Sstevel@tonic-gate# CRYPT DELETE START
202*7c478bd9Sstevel@tonic-gate# Special target to clean up the source tree for export distribution
203*7c478bd9Sstevel@tonic-gate# Warning: This target changes the source tree
204*7c478bd9Sstevel@tonic-gateEXPORT_SRC:
205*7c478bd9Sstevel@tonic-gate	$(RM) Makefile+ des/des_crypt.c+ des/des_soft.c+ key/xcrypt.c+
206*7c478bd9Sstevel@tonic-gate	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
207*7c478bd9Sstevel@tonic-gate		< des/des_crypt.c > des/des_crypt.c+
208*7c478bd9Sstevel@tonic-gate	$(MV) des/des_crypt.c+ des/des_crypt.c
209*7c478bd9Sstevel@tonic-gate	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
210*7c478bd9Sstevel@tonic-gate		< des/des_soft.c > des/des_soft.c+
211*7c478bd9Sstevel@tonic-gate	$(MV) des/des_soft.c+ des/des_soft.c
212*7c478bd9Sstevel@tonic-gate	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
213*7c478bd9Sstevel@tonic-gate		< key/xcrypt.c > key/xcrypt.c+
214*7c478bd9Sstevel@tonic-gate	$(MV) key/xcrypt.c+ key/xcrypt.c
215*7c478bd9Sstevel@tonic-gate	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
216*7c478bd9Sstevel@tonic-gate		< Makefile > Makefile+
217*7c478bd9Sstevel@tonic-gate	$(MV) Makefile+ Makefile
218*7c478bd9Sstevel@tonic-gate	$(CHMOD) 444 Makefile des/des_crypt.c des/des_soft.c key/xcrypt.c
219*7c478bd9Sstevel@tonic-gate
220*7c478bd9Sstevel@tonic-gateCRYPT_SRC:
221*7c478bd9Sstevel@tonic-gate	$(RM) Makefile+
222*7c478bd9Sstevel@tonic-gate	$(SED) -e "/^# CRYPT DELETE START/,/^# CRYPT DELETE END/d"	\
223*7c478bd9Sstevel@tonic-gate			< Makefile 				\
224*7c478bd9Sstevel@tonic-gate	   | $(SED) -e "/EXPORT DELETE/d"				\
225*7c478bd9Sstevel@tonic-gate			> Makefile+
226*7c478bd9Sstevel@tonic-gate	$(MV) Makefile+ Makefile
227*7c478bd9Sstevel@tonic-gate	$(CHMOD) 444 Makefile
228*7c478bd9Sstevel@tonic-gate
229*7c478bd9Sstevel@tonic-gate# CRYPT DELETE END
230*7c478bd9Sstevel@tonic-gate# EXPORT DELETE END
231*7c478bd9Sstevel@tonic-gate
232*7c478bd9Sstevel@tonic-gate_msg: $(MSGDOMAIN) $(POFILE)
233*7c478bd9Sstevel@tonic-gate	$(RM) $(MSGDOMAIN)/$(POFILE)
234*7c478bd9Sstevel@tonic-gate	$(CP) $(POFILE) $(MSGDOMAIN)
235*7c478bd9Sstevel@tonic-gate
236*7c478bd9Sstevel@tonic-gate$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
237*7c478bd9Sstevel@tonic-gate	$(RM) $@
238*7c478bd9Sstevel@tonic-gate	$(CAT) $(POFILES) > $@
239*7c478bd9Sstevel@tonic-gate
240*7c478bd9Sstevel@tonic-gate_errlst.po:
241*7c478bd9Sstevel@tonic-gate	$(RM) messages.po
242*7c478bd9Sstevel@tonic-gate	$(XGETTEXT) -a nsl/_errlst.c
243*7c478bd9Sstevel@tonic-gate	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
244*7c478bd9Sstevel@tonic-gate	$(RM) messages.po
245*7c478bd9Sstevel@tonic-gate
246*7c478bd9Sstevel@tonic-gategeneric.po:
247*7c478bd9Sstevel@tonic-gate	$(RM) messages.po
248*7c478bd9Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext */*.[ch] nis/*/*.[ch]*`
249*7c478bd9Sstevel@tonic-gate	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
250*7c478bd9Sstevel@tonic-gate	$(RM) messages.po
251*7c478bd9Sstevel@tonic-gate
252*7c478bd9Sstevel@tonic-gate$(MSGDOMAIN):
253*7c478bd9Sstevel@tonic-gate	$(INS.dir)
254*7c478bd9Sstevel@tonic-gate
255*7c478bd9Sstevel@tonic-gatespec $(MACH) $(MACH64) $(SPEC) $(SPEC64):      FRC
256*7c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
257*7c478bd9Sstevel@tonic-gate
258*7c478bd9Sstevel@tonic-gateFRC:
259