xref: /illumos-gate/usr/src/cmd/rpcsvc/Makefile (revision 5661bb7641e85c46713da7a3002b29ecd2c3daf0)
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#
25*5661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gatePROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateBINPROG= rusers rup
307c478bd9Sstevel@tonic-gateSBINPROG= rwall spray
317c478bd9Sstevel@tonic-gateRPROG= rpc.rusersd
327c478bd9Sstevel@tonic-gateSPROG= rpc.sprayd
337c478bd9Sstevel@tonic-gateWPROG= rpc.rwalld
347c478bd9Sstevel@tonic-gateTPROG= rpc.rstatd
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gatePROG= $(BINPROG) $(SBINPROG) $(RPROG) $(SPROG) $(WPROG) $(TPROG)
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateMANIFEST= \
397c478bd9Sstevel@tonic-gate	rusers.xml \
407c478bd9Sstevel@tonic-gate	spray.xml \
417c478bd9Sstevel@tonic-gate	wall.xml \
427c478bd9Sstevel@tonic-gate	rstat.xml
437c478bd9Sstevel@tonic-gate
4436e852a1SRaja AndraSVCMETHOD=
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gateSCLNTOBJS= spray.o spray_clnt.o
477c478bd9Sstevel@tonic-gateSSVCOBJS= spray_subr.o spray_svc.o
487c478bd9Sstevel@tonic-gateWCLNTOBJS = rwall.o rwall_clnt.o
497c478bd9Sstevel@tonic-gateWSVCOBJS= rwall_subr.o rwall_svc.o
507c478bd9Sstevel@tonic-gateTSVCOBJS= rstat_main.o rstat_proc.o rstat_svc.o rstat_v2_svc.o rstat_v2_xdr.o
517c478bd9Sstevel@tonic-gate
527c478bd9Sstevel@tonic-gateDERIVED_FILES = rstat.x rstat.h rstat_svc.c rstat_v2.h rstat_v2_svc.c \
537c478bd9Sstevel@tonic-gate		rstat_v2_xdr.c spray.x spray.h spray_clnt.c spray_svc.c \
547c478bd9Sstevel@tonic-gate		rwall.x rwall.h rwall_svc.c rwall_clnt.c
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gateCPPFLAGS= -I. $(CPPFLAGS.master)
617014882cSRichard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
627014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable
637014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
647014882cSRichard LoweCERRWARN += -_gcc=-Wno-extra
657014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function
66*5661bb76SJohn Levon
67*5661bb76SJohn Levon# not linted
68*5661bb76SJohn LevonSMATCH=off
69*5661bb76SJohn Levon
707c478bd9Sstevel@tonic-gateLDLIBS += -lnsl
717014882cSRichard Lowerusers :=	CFLAGS += $(CCVERBOSE)
727c478bd9Sstevel@tonic-gate$(BINPROG) :=	LDLIBS += -lrpcsvc
737c478bd9Sstevel@tonic-gate$(RPROG) :=	LDLIBS += -lrpcsvc
747c478bd9Sstevel@tonic-gate$(SPROG) :=	LDLIBS += -lrpcsvc
757c478bd9Sstevel@tonic-gate$(TPROG) :=	LDLIBS += -lrpcsvc
767c478bd9Sstevel@tonic-gatespray :=	LDLIBS += -lrpcsvc
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gate
7936e852a1SRaja AndraSUBDIRS= rpc.bootparamd
807c478bd9Sstevel@tonic-gateOBJS= $(SCLNTOBJS) $(SSVCOBJS) $(WCLNTOBJS) $(WSVCOBJS) $(TSVCOBJS)
817c478bd9Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c) rusers.c rpc.rusersd.c rup.c
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gateETCFILES= rpc
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gateTXTS= $(ETCFILES:%=net_files/%)
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gateNETSVC=	$(ROOTLIB)/netsvc
887c478bd9Sstevel@tonic-gateNIS = $(NETSVC)/nis
897c478bd9Sstevel@tonic-gateRWALL= $(NETSVC)/rwall
907c478bd9Sstevel@tonic-gateRUSERS= $(NETSVC)/rusers
917c478bd9Sstevel@tonic-gateSPRAY= $(NETSVC)/spray
927c478bd9Sstevel@tonic-gateRSTAT= $(NETSVC)/rstat
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gateROOTDIRS= \
957c478bd9Sstevel@tonic-gate		$(NETSVC) \
967c478bd9Sstevel@tonic-gate		$(NIS) \
977c478bd9Sstevel@tonic-gate		$(RWALL) \
987c478bd9Sstevel@tonic-gate		$(RUSERS) \
997c478bd9Sstevel@tonic-gate		$(SPRAY) \
10036e852a1SRaja Andra		$(RSTAT)
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gateIBINPROG=		$(BINPROG:%=$(ROOTBIN)/%)
1037c478bd9Sstevel@tonic-gateISBINPROG=		$(SBINPROG:%=$(ROOTUSRSBIN)/%)
1047c478bd9Sstevel@tonic-gateIWPROG=			$(WPROG:%=$(RWALL)/%)
1057c478bd9Sstevel@tonic-gateISPROG=			$(SPROG:%=$(SPRAY)/%)
1067c478bd9Sstevel@tonic-gateIRPROG=			$(RPROG:%=$(RUSERS)/%)
1077c478bd9Sstevel@tonic-gateITPROG=			$(TPROG:%=$(RSTAT)/%)
1087c478bd9Sstevel@tonic-gateIETCFILES=		$(ETCFILES:%=$(ROOTETC)/%)
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gate# non-default file attributes
1117c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				FILEMODE=	0644
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gateall:=		TARGET= all
1147c478bd9Sstevel@tonic-gateinstall:=	TARGET= install
1157c478bd9Sstevel@tonic-gateclean:=		TARGET= clean
1167c478bd9Sstevel@tonic-gateclobber:=	TARGET= clobber
1177c478bd9Sstevel@tonic-gatelint:=		TARGET= lint
1187c478bd9Sstevel@tonic-gate
1197c478bd9Sstevel@tonic-gaterpc.rstatd:=	LDLIBS += -lkstat
1207c478bd9Sstevel@tonic-gaterwall:=		CPPFLAGS += -D_REENTRANT
1217c478bd9Sstevel@tonic-gaterpc.rwalld:=	CPPFLAGS += -D_REENTRANT
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate# install rules
1247c478bd9Sstevel@tonic-gate
1257c478bd9Sstevel@tonic-gate$(RWALL)/% $(SPRAY)/% $(RUSERS)/% $(RSTAT)/%: %
1267c478bd9Sstevel@tonic-gate	$(INS.file)
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gate$(ROOTETC)/%: ./net_files/%
1297c478bd9Sstevel@tonic-gate	$(INS.file)
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gate.KEEP_STATE:
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gateall: $(PROG) $(TXTS) $(SUBDIRS)
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gate# multi-object targets
1367c478bd9Sstevel@tonic-gate#
1377c478bd9Sstevel@tonic-gatespray:	$(SCLNTOBJS)
1387c478bd9Sstevel@tonic-gate	$(LINK.c) $(SCLNTOBJS) -o $@ $(LDLIBS)
1397c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gatespray_svc.o spray_clnt.o: spray.h
1427c478bd9Sstevel@tonic-gate
1437c478bd9Sstevel@tonic-gaterpc.sprayd: $(SSVCOBJS)
1447c478bd9Sstevel@tonic-gate	$(LINK.c) $(SSVCOBJS) -o $@ $(LDLIBS)
1457c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1467c478bd9Sstevel@tonic-gate
1477c478bd9Sstevel@tonic-gaterwall_svc.o rwall_clnt.o: rwall.h
1487c478bd9Sstevel@tonic-gate
1497c478bd9Sstevel@tonic-gaterwall: $(WCLNTOBJS)
1507c478bd9Sstevel@tonic-gate	$(LINK.c) $(WCLNTOBJS) -o $@ $(LDLIBS)
1517c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gaterpc.rwalld: $(WSVCOBJS)
1547c478bd9Sstevel@tonic-gate	$(LINK.c) $(WSVCOBJS) -o $@ $(LDLIBS)
1557c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1567c478bd9Sstevel@tonic-gate
1577c478bd9Sstevel@tonic-gaterstat_main.o:	rstat.h rstat_v2.h
1587c478bd9Sstevel@tonic-gate
1597c478bd9Sstevel@tonic-gaterstat_svc.o: rstat.h
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gaterstat_V2_svc.o rstat_V2_xdr.o: rstat_v2.h
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gaterpc.rstatd: $(TSVCOBJS)
1647c478bd9Sstevel@tonic-gate	$(LINK.c) $(TSVCOBJS) -o $@ $(LDLIBS)
1657c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1667c478bd9Sstevel@tonic-gate
1677c478bd9Sstevel@tonic-gateinstall: $(PROG) $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IBINPROG) $(ISBINPROG) \
1687c478bd9Sstevel@tonic-gate	$(IWPROG) $(ISPROG) $(IRPROG) $(ITPROG) $(IETCFILES) $(SUBDIRS) \
1697c478bd9Sstevel@tonic-gate	$(ROOTMANIFEST) $(ROOTSVCMETHOD)
1707c478bd9Sstevel@tonic-gate
1717c478bd9Sstevel@tonic-gate$(ROOTDIRS):
1727c478bd9Sstevel@tonic-gate	$(INS.dir)
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gate$(SUBDIRS): FRC
1757c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1767c478bd9Sstevel@tonic-gate
1777c478bd9Sstevel@tonic-gate#
1787c478bd9Sstevel@tonic-gate# Derived files
1797c478bd9Sstevel@tonic-gate#
1807c478bd9Sstevel@tonic-gate
1817c478bd9Sstevel@tonic-gaterstat.x: $(PROTOCOL_DIR)/rstat.x
1827c478bd9Sstevel@tonic-gate	$(RM) rstat.x
1837c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.x rstat.x
1847c478bd9Sstevel@tonic-gate
1857c478bd9Sstevel@tonic-gaterstat.h: $(PROTOCOL_DIR)/rstat.h
1867c478bd9Sstevel@tonic-gate	$(RM) rstat.h
1877c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.h rstat.h
1887c478bd9Sstevel@tonic-gate
1897c478bd9Sstevel@tonic-gaterstat_svc.c: rstat.x
1907c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat.x > $@
1917c478bd9Sstevel@tonic-gate
1927c478bd9Sstevel@tonic-gaterstat_v2.h: rstat_v2.x
1937c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h rstat_v2.x > $@
1947c478bd9Sstevel@tonic-gate
1957c478bd9Sstevel@tonic-gaterstat_v2_svc.c: rstat_v2.x
1967c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat_v2.x > $@
1977c478bd9Sstevel@tonic-gate
1987c478bd9Sstevel@tonic-gaterstat_v2_xdr.c: rstat_v2.x
1997c478bd9Sstevel@tonic-gate	$(RPCGEN) -c rstat_v2.x > $@
2007c478bd9Sstevel@tonic-gate
2017c478bd9Sstevel@tonic-gatespray.x: $(PROTOCOL_DIR)/spray.x
2027c478bd9Sstevel@tonic-gate	$(RM) spray.x
2037c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.x spray.x
2047c478bd9Sstevel@tonic-gate
2057c478bd9Sstevel@tonic-gatespray.h: $(PROTOCOL_DIR)/spray.h
2067c478bd9Sstevel@tonic-gate	$(RM) spray.h
2077c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.h spray.h
2087c478bd9Sstevel@tonic-gate
2097c478bd9Sstevel@tonic-gatespray_svc.c: spray.x
2107c478bd9Sstevel@tonic-gate	$(RPCGEN) -s datagram_v -s circuit_v spray.x > $@
2117c478bd9Sstevel@tonic-gate
2127c478bd9Sstevel@tonic-gatespray_clnt.c: spray.x
2137c478bd9Sstevel@tonic-gate	$(RPCGEN) -l spray.x > $@
2147c478bd9Sstevel@tonic-gate
2157c478bd9Sstevel@tonic-gaterwall.x: $(PROTOCOL_DIR)/rwall.x
2167c478bd9Sstevel@tonic-gate	$(RM) rwall.x
2177c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.x rwall.x
2187c478bd9Sstevel@tonic-gate
2197c478bd9Sstevel@tonic-gaterwall.h: $(PROTOCOL_DIR)/rwall.h
2207c478bd9Sstevel@tonic-gate	$(RM) rwall.h
2217c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.h rwall.h
2227c478bd9Sstevel@tonic-gate
2237c478bd9Sstevel@tonic-gaterwall_svc.c: rwall.x
2247c478bd9Sstevel@tonic-gate	$(RPCGEN) -A -s datagram_v rwall.x > $@
2257c478bd9Sstevel@tonic-gate
2267c478bd9Sstevel@tonic-gaterwall_clnt.c: rwall.x
2277c478bd9Sstevel@tonic-gate	$(RPCGEN) -l -M rwall.x > $@
2287c478bd9Sstevel@tonic-gate
2297c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
2307c478bd9Sstevel@tonic-gate
2317c478bd9Sstevel@tonic-gateclean: $(SUBDIRS)
2327c478bd9Sstevel@tonic-gate	-$(RM) $(OBJS) $(DERIVED_FILES)
2337c478bd9Sstevel@tonic-gate
234a192e900Samaguireclobber: $(SUBDIRS)
2357c478bd9Sstevel@tonic-gate
2367c478bd9Sstevel@tonic-gatelint:
2377c478bd9Sstevel@tonic-gate	$(LINT.c) $(WCLNTOBJS:%.o=%.c) -lnsl -lrpcsvc
2387c478bd9Sstevel@tonic-gate	$(LINT.c) $(WSVCOBJS:%.o=%.c) -lnsl -lrpcsvc
2397c478bd9Sstevel@tonic-gate	$(LINT.c) rusers.c -lnsl -lrpcsvc
2407c478bd9Sstevel@tonic-gate
2417c478bd9Sstevel@tonic-gateFRC:
242a192e900Samaguire
243a192e900Samaguireinclude ../Makefile.targ
244