xref: /illumos-gate/usr/src/cmd/rpcsvc/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5a192e900Samaguire# Common Development and Distribution License (the "License").
6a192e900Samaguire# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
2224fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate# cmd/rpcsvc/Makefile
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gatePROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateBINPROG= rusers rup
317c478bd9Sstevel@tonic-gateSBINPROG= rwall spray
327c478bd9Sstevel@tonic-gateRPROG= rpc.rusersd
337c478bd9Sstevel@tonic-gateSPROG= rpc.sprayd
347c478bd9Sstevel@tonic-gateWPROG= rpc.rwalld
357c478bd9Sstevel@tonic-gateTPROG= rpc.rstatd
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gatePROG= $(BINPROG) $(SBINPROG) $(RPROG) $(SPROG) $(WPROG) $(TPROG)
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateMANIFEST= \
407c478bd9Sstevel@tonic-gate	rusers.xml \
417c478bd9Sstevel@tonic-gate	spray.xml \
427c478bd9Sstevel@tonic-gate	wall.xml \
437c478bd9Sstevel@tonic-gate	rstat.xml
447c478bd9Sstevel@tonic-gate
4536e852a1SRaja AndraSVCMETHOD=
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateSCLNTOBJS= spray.o spray_clnt.o
487c478bd9Sstevel@tonic-gateSSVCOBJS= spray_subr.o spray_svc.o
497c478bd9Sstevel@tonic-gateWCLNTOBJS = rwall.o rwall_clnt.o
507c478bd9Sstevel@tonic-gateWSVCOBJS= rwall_subr.o rwall_svc.o
517c478bd9Sstevel@tonic-gateTSVCOBJS= rstat_main.o rstat_proc.o rstat_svc.o rstat_v2_svc.o rstat_v2_xdr.o
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gateDERIVED_FILES = rstat.x rstat.h rstat_svc.c rstat_v2.h rstat_v2_svc.c \
547c478bd9Sstevel@tonic-gate		rstat_v2_xdr.c spray.x spray.h spray_clnt.c spray_svc.c \
557c478bd9Sstevel@tonic-gate		rwall.x rwall.h rwall_svc.c rwall_clnt.c
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gateCPPFLAGS= -I. $(CPPFLAGS.master)
62*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
63*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable
64*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
65*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-extra
66*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function
677c478bd9Sstevel@tonic-gateLDLIBS += -lnsl
68*7014882cSRichard Lowerusers :=	CFLAGS += $(CCVERBOSE)
697c478bd9Sstevel@tonic-gate$(BINPROG) :=	LDLIBS += -lrpcsvc
707c478bd9Sstevel@tonic-gate$(RPROG) :=	LDLIBS += -lrpcsvc
717c478bd9Sstevel@tonic-gate$(SPROG) :=	LDLIBS += -lrpcsvc
727c478bd9Sstevel@tonic-gate$(TPROG) :=	LDLIBS += -lrpcsvc
737c478bd9Sstevel@tonic-gatespray :=	LDLIBS += -lrpcsvc
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gate
7636e852a1SRaja AndraSUBDIRS= rpc.bootparamd
777c478bd9Sstevel@tonic-gateOBJS= $(SCLNTOBJS) $(SSVCOBJS) $(WCLNTOBJS) $(WSVCOBJS) $(TSVCOBJS)
787c478bd9Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c) rusers.c rpc.rusersd.c rup.c
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gateETCFILES= rpc
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gateTXTS= $(ETCFILES:%=net_files/%)
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gateNETSVC=	$(ROOTLIB)/netsvc
857c478bd9Sstevel@tonic-gateNIS = $(NETSVC)/nis
867c478bd9Sstevel@tonic-gateRWALL= $(NETSVC)/rwall
877c478bd9Sstevel@tonic-gateRUSERS= $(NETSVC)/rusers
887c478bd9Sstevel@tonic-gateSPRAY= $(NETSVC)/spray
897c478bd9Sstevel@tonic-gateRSTAT= $(NETSVC)/rstat
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gateROOTDIRS= \
927c478bd9Sstevel@tonic-gate		$(NETSVC) \
937c478bd9Sstevel@tonic-gate		$(NIS) \
947c478bd9Sstevel@tonic-gate		$(RWALL) \
957c478bd9Sstevel@tonic-gate		$(RUSERS) \
967c478bd9Sstevel@tonic-gate		$(SPRAY) \
9736e852a1SRaja Andra		$(RSTAT)
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gateIBINPROG=		$(BINPROG:%=$(ROOTBIN)/%)
1007c478bd9Sstevel@tonic-gateISBINPROG=		$(SBINPROG:%=$(ROOTUSRSBIN)/%)
1017c478bd9Sstevel@tonic-gateIWPROG=			$(WPROG:%=$(RWALL)/%)
1027c478bd9Sstevel@tonic-gateISPROG=			$(SPROG:%=$(SPRAY)/%)
1037c478bd9Sstevel@tonic-gateIRPROG=			$(RPROG:%=$(RUSERS)/%)
1047c478bd9Sstevel@tonic-gateITPROG=			$(TPROG:%=$(RSTAT)/%)
1057c478bd9Sstevel@tonic-gateIETCFILES=		$(ETCFILES:%=$(ROOTETC)/%)
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gate# non-default file attributes
1087c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				FILEMODE=	0644
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gateall:=		TARGET= all
1117c478bd9Sstevel@tonic-gateinstall:=	TARGET= install
1127c478bd9Sstevel@tonic-gateclean:=		TARGET= clean
1137c478bd9Sstevel@tonic-gateclobber:=	TARGET= clobber
1147c478bd9Sstevel@tonic-gatelint:=		TARGET= lint
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gaterpc.rstatd:=	LDLIBS += -lkstat
1177c478bd9Sstevel@tonic-gaterwall:=		CPPFLAGS += -D_REENTRANT
1187c478bd9Sstevel@tonic-gaterpc.rwalld:=	CPPFLAGS += -D_REENTRANT
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate# install rules
1217c478bd9Sstevel@tonic-gate
1227c478bd9Sstevel@tonic-gate$(RWALL)/% $(SPRAY)/% $(RUSERS)/% $(RSTAT)/%: %
1237c478bd9Sstevel@tonic-gate	$(INS.file)
1247c478bd9Sstevel@tonic-gate
1257c478bd9Sstevel@tonic-gate$(ROOTETC)/%: ./net_files/%
1267c478bd9Sstevel@tonic-gate	$(INS.file)
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gate.KEEP_STATE:
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gateall: $(PROG) $(TXTS) $(SUBDIRS)
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate# multi-object targets
1337c478bd9Sstevel@tonic-gate#
1347c478bd9Sstevel@tonic-gatespray:	$(SCLNTOBJS)
1357c478bd9Sstevel@tonic-gate	$(LINK.c) $(SCLNTOBJS) -o $@ $(LDLIBS)
1367c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gatespray_svc.o spray_clnt.o: spray.h
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gaterpc.sprayd: $(SSVCOBJS)
1417c478bd9Sstevel@tonic-gate	$(LINK.c) $(SSVCOBJS) -o $@ $(LDLIBS)
1427c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1437c478bd9Sstevel@tonic-gate
1447c478bd9Sstevel@tonic-gaterwall_svc.o rwall_clnt.o: rwall.h
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gaterwall: $(WCLNTOBJS)
1477c478bd9Sstevel@tonic-gate	$(LINK.c) $(WCLNTOBJS) -o $@ $(LDLIBS)
1487c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gaterpc.rwalld: $(WSVCOBJS)
1517c478bd9Sstevel@tonic-gate	$(LINK.c) $(WSVCOBJS) -o $@ $(LDLIBS)
1527c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gaterstat_main.o:	rstat.h rstat_v2.h
1557c478bd9Sstevel@tonic-gate
1567c478bd9Sstevel@tonic-gaterstat_svc.o: rstat.h
1577c478bd9Sstevel@tonic-gate
1587c478bd9Sstevel@tonic-gaterstat_V2_svc.o rstat_V2_xdr.o: rstat_v2.h
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gaterpc.rstatd: $(TSVCOBJS)
1617c478bd9Sstevel@tonic-gate	$(LINK.c) $(TSVCOBJS) -o $@ $(LDLIBS)
1627c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1637c478bd9Sstevel@tonic-gate
1647c478bd9Sstevel@tonic-gateinstall: $(PROG) $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IBINPROG) $(ISBINPROG) \
1657c478bd9Sstevel@tonic-gate	$(IWPROG) $(ISPROG) $(IRPROG) $(ITPROG) $(IETCFILES) $(SUBDIRS) \
1667c478bd9Sstevel@tonic-gate	$(ROOTMANIFEST) $(ROOTSVCMETHOD)
1677c478bd9Sstevel@tonic-gate
1687c478bd9Sstevel@tonic-gate$(ROOTDIRS):
1697c478bd9Sstevel@tonic-gate	$(INS.dir)
1707c478bd9Sstevel@tonic-gate
1717c478bd9Sstevel@tonic-gate$(SUBDIRS): FRC
1727c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gate#
1757c478bd9Sstevel@tonic-gate# Derived files
1767c478bd9Sstevel@tonic-gate#
1777c478bd9Sstevel@tonic-gate
1787c478bd9Sstevel@tonic-gaterstat.x: $(PROTOCOL_DIR)/rstat.x
1797c478bd9Sstevel@tonic-gate	$(RM) rstat.x
1807c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.x rstat.x
1817c478bd9Sstevel@tonic-gate
1827c478bd9Sstevel@tonic-gaterstat.h: $(PROTOCOL_DIR)/rstat.h
1837c478bd9Sstevel@tonic-gate	$(RM) rstat.h
1847c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.h rstat.h
1857c478bd9Sstevel@tonic-gate
1867c478bd9Sstevel@tonic-gaterstat_svc.c: rstat.x
1877c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat.x > $@
1887c478bd9Sstevel@tonic-gate
1897c478bd9Sstevel@tonic-gaterstat_v2.h: rstat_v2.x
1907c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h rstat_v2.x > $@
1917c478bd9Sstevel@tonic-gate
1927c478bd9Sstevel@tonic-gaterstat_v2_svc.c: rstat_v2.x
1937c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat_v2.x > $@
1947c478bd9Sstevel@tonic-gate
1957c478bd9Sstevel@tonic-gaterstat_v2_xdr.c: rstat_v2.x
1967c478bd9Sstevel@tonic-gate	$(RPCGEN) -c rstat_v2.x > $@
1977c478bd9Sstevel@tonic-gate
1987c478bd9Sstevel@tonic-gatespray.x: $(PROTOCOL_DIR)/spray.x
1997c478bd9Sstevel@tonic-gate	$(RM) spray.x
2007c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.x spray.x
2017c478bd9Sstevel@tonic-gate
2027c478bd9Sstevel@tonic-gatespray.h: $(PROTOCOL_DIR)/spray.h
2037c478bd9Sstevel@tonic-gate	$(RM) spray.h
2047c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.h spray.h
2057c478bd9Sstevel@tonic-gate
2067c478bd9Sstevel@tonic-gatespray_svc.c: spray.x
2077c478bd9Sstevel@tonic-gate	$(RPCGEN) -s datagram_v -s circuit_v spray.x > $@
2087c478bd9Sstevel@tonic-gate
2097c478bd9Sstevel@tonic-gatespray_clnt.c: spray.x
2107c478bd9Sstevel@tonic-gate	$(RPCGEN) -l spray.x > $@
2117c478bd9Sstevel@tonic-gate
2127c478bd9Sstevel@tonic-gaterwall.x: $(PROTOCOL_DIR)/rwall.x
2137c478bd9Sstevel@tonic-gate	$(RM) rwall.x
2147c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.x rwall.x
2157c478bd9Sstevel@tonic-gate
2167c478bd9Sstevel@tonic-gaterwall.h: $(PROTOCOL_DIR)/rwall.h
2177c478bd9Sstevel@tonic-gate	$(RM) rwall.h
2187c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.h rwall.h
2197c478bd9Sstevel@tonic-gate
2207c478bd9Sstevel@tonic-gaterwall_svc.c: rwall.x
2217c478bd9Sstevel@tonic-gate	$(RPCGEN) -A -s datagram_v rwall.x > $@
2227c478bd9Sstevel@tonic-gate
2237c478bd9Sstevel@tonic-gaterwall_clnt.c: rwall.x
2247c478bd9Sstevel@tonic-gate	$(RPCGEN) -l -M rwall.x > $@
2257c478bd9Sstevel@tonic-gate
2267c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
2277c478bd9Sstevel@tonic-gate
2287c478bd9Sstevel@tonic-gateclean: $(SUBDIRS)
2297c478bd9Sstevel@tonic-gate	-$(RM) $(OBJS) $(DERIVED_FILES)
2307c478bd9Sstevel@tonic-gate
231a192e900Samaguireclobber: $(SUBDIRS)
2327c478bd9Sstevel@tonic-gate
2337c478bd9Sstevel@tonic-gatelint:
2347c478bd9Sstevel@tonic-gate	$(LINT.c) $(WCLNTOBJS:%.o=%.c) -lnsl -lrpcsvc
2357c478bd9Sstevel@tonic-gate	$(LINT.c) $(WSVCOBJS:%.o=%.c) -lnsl -lrpcsvc
2367c478bd9Sstevel@tonic-gate	$(LINT.c) rusers.c -lnsl -lrpcsvc
2377c478bd9Sstevel@tonic-gate
2387c478bd9Sstevel@tonic-gateFRC:
239a192e900Samaguire
240a192e900Samaguireinclude ../Makefile.targ
241