xref: /illumos-gate/usr/src/cmd/rpcsvc/Makefile (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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# cmd/rpcsvc/Makefile
29*7c478bd9Sstevel@tonic-gate
30*7c478bd9Sstevel@tonic-gatePROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gateBINPROG= rusers rup
33*7c478bd9Sstevel@tonic-gateSBINPROG= rwall spray
34*7c478bd9Sstevel@tonic-gateRPROG= rpc.rusersd
35*7c478bd9Sstevel@tonic-gateSPROG= rpc.sprayd
36*7c478bd9Sstevel@tonic-gateWPROG= rpc.rwalld
37*7c478bd9Sstevel@tonic-gateTPROG= rpc.rstatd
38*7c478bd9Sstevel@tonic-gate
39*7c478bd9Sstevel@tonic-gatePROG= $(BINPROG) $(SBINPROG) $(RPROG) $(SPROG) $(WPROG) $(TPROG)
40*7c478bd9Sstevel@tonic-gate
41*7c478bd9Sstevel@tonic-gateMANIFEST= \
42*7c478bd9Sstevel@tonic-gate	nisplus.xml \
43*7c478bd9Sstevel@tonic-gate	rusers.xml \
44*7c478bd9Sstevel@tonic-gate	spray.xml \
45*7c478bd9Sstevel@tonic-gate	wall.xml \
46*7c478bd9Sstevel@tonic-gate	rstat.xml
47*7c478bd9Sstevel@tonic-gate
48*7c478bd9Sstevel@tonic-gateSVCMETHOD= \
49*7c478bd9Sstevel@tonic-gate	nisplus
50*7c478bd9Sstevel@tonic-gate
51*7c478bd9Sstevel@tonic-gateSCLNTOBJS= spray.o spray_clnt.o
52*7c478bd9Sstevel@tonic-gateSSVCOBJS= spray_subr.o spray_svc.o
53*7c478bd9Sstevel@tonic-gateWCLNTOBJS = rwall.o rwall_clnt.o
54*7c478bd9Sstevel@tonic-gateWSVCOBJS= rwall_subr.o rwall_svc.o
55*7c478bd9Sstevel@tonic-gateTSVCOBJS= rstat_main.o rstat_proc.o rstat_svc.o rstat_v2_svc.o rstat_v2_xdr.o
56*7c478bd9Sstevel@tonic-gate
57*7c478bd9Sstevel@tonic-gateDERIVED_FILES = rstat.x rstat.h rstat_svc.c rstat_v2.h rstat_v2_svc.c \
58*7c478bd9Sstevel@tonic-gate		rstat_v2_xdr.c spray.x spray.h spray_clnt.c spray_svc.c \
59*7c478bd9Sstevel@tonic-gate		rwall.x rwall.h rwall_svc.c rwall_clnt.c
60*7c478bd9Sstevel@tonic-gate
61*7c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
62*7c478bd9Sstevel@tonic-gate
63*7c478bd9Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
64*7c478bd9Sstevel@tonic-gate$(ROOTMANIFEST)		:= FILEMODE= 444
65*7c478bd9Sstevel@tonic-gate
66*7c478bd9Sstevel@tonic-gateCPPFLAGS= -I. $(CPPFLAGS.master)
67*7c478bd9Sstevel@tonic-gateLDLIBS += -lnsl
68*7c478bd9Sstevel@tonic-gaterusers :=	CFLAGS += -v
69*7c478bd9Sstevel@tonic-gate$(BINPROG) :=	LDLIBS += -lrpcsvc
70*7c478bd9Sstevel@tonic-gate$(RPROG) :=	LDLIBS += -lrpcsvc
71*7c478bd9Sstevel@tonic-gate$(SPROG) :=	LDLIBS += -lrpcsvc
72*7c478bd9Sstevel@tonic-gate$(TPROG) :=	LDLIBS += -lrpcsvc
73*7c478bd9Sstevel@tonic-gatespray :=	LDLIBS += -lrpcsvc
74*7c478bd9Sstevel@tonic-gate
75*7c478bd9Sstevel@tonic-gateCP=	cp
76*7c478bd9Sstevel@tonic-gate
77*7c478bd9Sstevel@tonic-gateSUBDIRS= rpc.bootparamd nis/utils nis/bin nis/cachemgr nis/rpc.nisd \
78*7c478bd9Sstevel@tonic-gate	 nis/rpc.nispasswdd
79*7c478bd9Sstevel@tonic-gateOBJS= $(SCLNTOBJS) $(SSVCOBJS) $(WCLNTOBJS) $(WSVCOBJS) $(TSVCOBJS)
80*7c478bd9Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c) rusers.c rpc.rusersd.c rup.c
81*7c478bd9Sstevel@tonic-gate
82*7c478bd9Sstevel@tonic-gateETCFILES= rpc
83*7c478bd9Sstevel@tonic-gate
84*7c478bd9Sstevel@tonic-gateTXTS= $(ETCFILES:%=net_files/%)
85*7c478bd9Sstevel@tonic-gate
86*7c478bd9Sstevel@tonic-gateNETSVC=	$(ROOTLIB)/netsvc
87*7c478bd9Sstevel@tonic-gateNIS = $(NETSVC)/nis
88*7c478bd9Sstevel@tonic-gateRWALL= $(NETSVC)/rwall
89*7c478bd9Sstevel@tonic-gateRUSERS= $(NETSVC)/rusers
90*7c478bd9Sstevel@tonic-gateSPRAY= $(NETSVC)/spray
91*7c478bd9Sstevel@tonic-gateRSTAT= $(NETSVC)/rstat
92*7c478bd9Sstevel@tonic-gateROOTVAR_NIS= $(ROOT)/var/nis
93*7c478bd9Sstevel@tonic-gate
94*7c478bd9Sstevel@tonic-gateROOTDIRS= \
95*7c478bd9Sstevel@tonic-gate		$(NETSVC) \
96*7c478bd9Sstevel@tonic-gate		$(NIS) \
97*7c478bd9Sstevel@tonic-gate		$(RWALL) \
98*7c478bd9Sstevel@tonic-gate		$(RUSERS) \
99*7c478bd9Sstevel@tonic-gate		$(SPRAY) \
100*7c478bd9Sstevel@tonic-gate		$(RSTAT) \
101*7c478bd9Sstevel@tonic-gate		$(ROOTVAR_NIS)
102*7c478bd9Sstevel@tonic-gate
103*7c478bd9Sstevel@tonic-gateIBINPROG=		$(BINPROG:%=$(ROOTBIN)/%)
104*7c478bd9Sstevel@tonic-gateISBINPROG=		$(SBINPROG:%=$(ROOTUSRSBIN)/%)
105*7c478bd9Sstevel@tonic-gateIWPROG=			$(WPROG:%=$(RWALL)/%)
106*7c478bd9Sstevel@tonic-gateISPROG=			$(SPROG:%=$(SPRAY)/%)
107*7c478bd9Sstevel@tonic-gateIRPROG=			$(RPROG:%=$(RUSERS)/%)
108*7c478bd9Sstevel@tonic-gateITPROG=			$(TPROG:%=$(RSTAT)/%)
109*7c478bd9Sstevel@tonic-gateIETCFILES=		$(ETCFILES:%=$(ROOTETC)/%)
110*7c478bd9Sstevel@tonic-gate
111*7c478bd9Sstevel@tonic-gate# non-default file attributes
112*7c478bd9Sstevel@tonic-gate$(ROOTDIRS) :=					OWNER=		root
113*7c478bd9Sstevel@tonic-gate$(ROOTDIRS) :=					GROUP=		sys
114*7c478bd9Sstevel@tonic-gate
115*7c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				FILEMODE=	0644
116*7c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				OWNER=		root
117*7c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				GROUP=		sys
118*7c478bd9Sstevel@tonic-gate
119*7c478bd9Sstevel@tonic-gateall:=		TARGET= all
120*7c478bd9Sstevel@tonic-gateinstall:=	TARGET= install
121*7c478bd9Sstevel@tonic-gateclean:=		TARGET= clean
122*7c478bd9Sstevel@tonic-gateclobber:=	TARGET= clobber
123*7c478bd9Sstevel@tonic-gatelint:=		TARGET= lint
124*7c478bd9Sstevel@tonic-gate
125*7c478bd9Sstevel@tonic-gaterpc.rstatd:=	LDLIBS += -lkstat
126*7c478bd9Sstevel@tonic-gaterwall:=		CPPFLAGS += -D_REENTRANT
127*7c478bd9Sstevel@tonic-gaterpc.rwalld:=	CPPFLAGS += -D_REENTRANT
128*7c478bd9Sstevel@tonic-gate
129*7c478bd9Sstevel@tonic-gate# install rules
130*7c478bd9Sstevel@tonic-gate
131*7c478bd9Sstevel@tonic-gate$(RWALL)/% $(SPRAY)/% $(RUSERS)/% $(RSTAT)/%: %
132*7c478bd9Sstevel@tonic-gate	$(INS.file)
133*7c478bd9Sstevel@tonic-gate
134*7c478bd9Sstevel@tonic-gate$(ROOTETC)/%: ./net_files/%
135*7c478bd9Sstevel@tonic-gate	$(INS.file)
136*7c478bd9Sstevel@tonic-gate
137*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
138*7c478bd9Sstevel@tonic-gate
139*7c478bd9Sstevel@tonic-gateall: $(PROG) $(TXTS) $(SUBDIRS)
140*7c478bd9Sstevel@tonic-gate
141*7c478bd9Sstevel@tonic-gate# multi-object targets
142*7c478bd9Sstevel@tonic-gate#
143*7c478bd9Sstevel@tonic-gatespray:	$(SCLNTOBJS)
144*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(SCLNTOBJS) -o $@ $(LDLIBS)
145*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
146*7c478bd9Sstevel@tonic-gate
147*7c478bd9Sstevel@tonic-gatespray_svc.o spray_clnt.o: spray.h
148*7c478bd9Sstevel@tonic-gate
149*7c478bd9Sstevel@tonic-gaterpc.sprayd: $(SSVCOBJS)
150*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(SSVCOBJS) -o $@ $(LDLIBS)
151*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
152*7c478bd9Sstevel@tonic-gate
153*7c478bd9Sstevel@tonic-gaterwall_svc.o rwall_clnt.o: rwall.h
154*7c478bd9Sstevel@tonic-gate
155*7c478bd9Sstevel@tonic-gaterwall: $(WCLNTOBJS)
156*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(WCLNTOBJS) -o $@ $(LDLIBS)
157*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
158*7c478bd9Sstevel@tonic-gate
159*7c478bd9Sstevel@tonic-gaterpc.rwalld: $(WSVCOBJS)
160*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(WSVCOBJS) -o $@ $(LDLIBS)
161*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
162*7c478bd9Sstevel@tonic-gate
163*7c478bd9Sstevel@tonic-gaterstat_main.o:	rstat.h rstat_v2.h
164*7c478bd9Sstevel@tonic-gate
165*7c478bd9Sstevel@tonic-gaterstat_svc.o: rstat.h
166*7c478bd9Sstevel@tonic-gate
167*7c478bd9Sstevel@tonic-gaterstat_V2_svc.o rstat_V2_xdr.o: rstat_v2.h
168*7c478bd9Sstevel@tonic-gate
169*7c478bd9Sstevel@tonic-gaterpc.rstatd: $(TSVCOBJS)
170*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(TSVCOBJS) -o $@ $(LDLIBS)
171*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
172*7c478bd9Sstevel@tonic-gate
173*7c478bd9Sstevel@tonic-gateinstall: $(PROG) $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IBINPROG) $(ISBINPROG) \
174*7c478bd9Sstevel@tonic-gate	$(IWPROG) $(ISPROG) $(IRPROG) $(ITPROG) $(IETCFILES) $(SUBDIRS) \
175*7c478bd9Sstevel@tonic-gate	$(ROOTMANIFEST) $(ROOTSVCMETHOD)
176*7c478bd9Sstevel@tonic-gate
177*7c478bd9Sstevel@tonic-gate$(ROOTDIRS):
178*7c478bd9Sstevel@tonic-gate	$(INS.dir)
179*7c478bd9Sstevel@tonic-gate
180*7c478bd9Sstevel@tonic-gate$(SUBDIRS): FRC
181*7c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
182*7c478bd9Sstevel@tonic-gate
183*7c478bd9Sstevel@tonic-gate#
184*7c478bd9Sstevel@tonic-gate# Derived files
185*7c478bd9Sstevel@tonic-gate#
186*7c478bd9Sstevel@tonic-gate
187*7c478bd9Sstevel@tonic-gaterstat.x: $(PROTOCOL_DIR)/rstat.x
188*7c478bd9Sstevel@tonic-gate	$(RM) rstat.x
189*7c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.x rstat.x
190*7c478bd9Sstevel@tonic-gate
191*7c478bd9Sstevel@tonic-gaterstat.h: $(PROTOCOL_DIR)/rstat.h
192*7c478bd9Sstevel@tonic-gate	$(RM) rstat.h
193*7c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.h rstat.h
194*7c478bd9Sstevel@tonic-gate
195*7c478bd9Sstevel@tonic-gaterstat_svc.c: rstat.x
196*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat.x > $@
197*7c478bd9Sstevel@tonic-gate
198*7c478bd9Sstevel@tonic-gaterstat_v2.h: rstat_v2.x
199*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h rstat_v2.x > $@
200*7c478bd9Sstevel@tonic-gate
201*7c478bd9Sstevel@tonic-gaterstat_v2_svc.c: rstat_v2.x
202*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat_v2.x > $@
203*7c478bd9Sstevel@tonic-gate
204*7c478bd9Sstevel@tonic-gaterstat_v2_xdr.c: rstat_v2.x
205*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -c rstat_v2.x > $@
206*7c478bd9Sstevel@tonic-gate
207*7c478bd9Sstevel@tonic-gatespray.x: $(PROTOCOL_DIR)/spray.x
208*7c478bd9Sstevel@tonic-gate	$(RM) spray.x
209*7c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.x spray.x
210*7c478bd9Sstevel@tonic-gate
211*7c478bd9Sstevel@tonic-gatespray.h: $(PROTOCOL_DIR)/spray.h
212*7c478bd9Sstevel@tonic-gate	$(RM) spray.h
213*7c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.h spray.h
214*7c478bd9Sstevel@tonic-gate
215*7c478bd9Sstevel@tonic-gatespray_svc.c: spray.x
216*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -s datagram_v -s circuit_v spray.x > $@
217*7c478bd9Sstevel@tonic-gate
218*7c478bd9Sstevel@tonic-gatespray_clnt.c: spray.x
219*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -l spray.x > $@
220*7c478bd9Sstevel@tonic-gate
221*7c478bd9Sstevel@tonic-gaterwall.x: $(PROTOCOL_DIR)/rwall.x
222*7c478bd9Sstevel@tonic-gate	$(RM) rwall.x
223*7c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.x rwall.x
224*7c478bd9Sstevel@tonic-gate
225*7c478bd9Sstevel@tonic-gaterwall.h: $(PROTOCOL_DIR)/rwall.h
226*7c478bd9Sstevel@tonic-gate	$(RM) rwall.h
227*7c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.h rwall.h
228*7c478bd9Sstevel@tonic-gate
229*7c478bd9Sstevel@tonic-gaterwall_svc.c: rwall.x
230*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -A -s datagram_v rwall.x > $@
231*7c478bd9Sstevel@tonic-gate
232*7c478bd9Sstevel@tonic-gaterwall_clnt.c: rwall.x
233*7c478bd9Sstevel@tonic-gate	$(RPCGEN) -l -M rwall.x > $@
234*7c478bd9Sstevel@tonic-gate
235*7c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
236*7c478bd9Sstevel@tonic-gate
237*7c478bd9Sstevel@tonic-gateclean: $(SUBDIRS)
238*7c478bd9Sstevel@tonic-gate	-$(RM) $(OBJS) $(DERIVED_FILES)
239*7c478bd9Sstevel@tonic-gate
240*7c478bd9Sstevel@tonic-gateclobber: clean $(SUBDIRS)
241*7c478bd9Sstevel@tonic-gate	-$(RM) $(PROG) $(CLOBBERFILES)
242*7c478bd9Sstevel@tonic-gate
243*7c478bd9Sstevel@tonic-gatelint:
244*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(WCLNTOBJS:%.o=%.c) -lnsl -lrpcsvc
245*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(WSVCOBJS:%.o=%.c) -lnsl -lrpcsvc
246*7c478bd9Sstevel@tonic-gate	$(LINT.c) rusers.c -lnsl -lrpcsvc
247*7c478bd9Sstevel@tonic-gate
248*7c478bd9Sstevel@tonic-gateFRC:
249